|
66 | 66 | // Reuse a maskView from the pool, or allocate a new one. |
67 | 67 | - (FlutterClippingMaskView*)getMaskViewWithFrame:(CGRect)frame; |
68 | 68 |
|
69 | | -// Mark all the maskViews available. |
| 69 | +// Insert the `maskView` into the pool. |
70 | 70 | - (void)insertViewToPool:(FlutterClippingMaskView*)maskView; |
71 | 71 |
|
72 | 72 | @end |
@@ -291,27 +291,30 @@ class FlutterPlatformViewsController { |
291 | 291 | int CountClips(const MutatorsStack& mutators_stack); |
292 | 292 |
|
293 | 293 | void ClipViewSetMaskView(UIView* clipView); |
| 294 | + |
294 | 295 | // Applies the mutators in the mutators_stack to the UIView chain that was constructed by |
295 | 296 | // `ReconstructClipViewsChain` |
296 | 297 | // |
297 | | - // Clips are applied to the super view with a CALayer mask. Transforms are applied to the |
298 | | - // current view that's at the head of the chain. For example the following mutators stack [T_1, |
299 | | - // C_2, T_3, T_4, C_5, T_6] where T denotes a transform and C denotes a clip, will result in the |
300 | | - // following UIView tree: |
301 | | - // |
302 | | - // C_2 -> C_5 -> PLATFORM_VIEW |
303 | | - // (PLATFORM_VIEW is a subview of C_5 which is a subview of C_2) |
304 | | - // |
305 | | - // T_1 is applied to C_2, T_3 and T_4 are applied to C_5, and T_6 is applied to PLATFORM_VIEW. |
306 | | - // |
307 | | - // After each clip operation, we update the head to the super view of the current head. |
| 298 | + // Clips are applied to the `embedded_view`'s super view(|ChildClippingView|) using a |
| 299 | + // |FlutterClippingMaskView|. Transforms are applied to `embedded_view` |
308 | 300 | // |
309 | 301 | // The `bounding_rect` is the final bounding rect of the PlatformView |
310 | 302 | // (EmbeddedViewParams::finalBoundingRect). If a clip mutator's rect contains the final bounding |
311 | 303 | // rect of the PlatformView, the clip mutator is not applied for performance optimization. |
| 304 | + // |
| 305 | + // This method is only called when thew `embedded_view` needs to be re-composited at the current |
| 306 | + // frame. See: `CompositeWithParams` for details. |
312 | 307 | void ApplyMutators(const MutatorsStack& mutators_stack, |
313 | 308 | UIView* embedded_view, |
314 | 309 | const SkRect& bounding_rect); |
| 310 | + |
| 311 | + // Composite the PlatformView with `view_id`. |
| 312 | + // Every frame, during the paint traversal of the layer tree, this method is called for all |
| 313 | + // the PlatformViews in `views_to_recomposite_`. |
| 314 | + // |
| 315 | + // Note that `views_to_recomposite_` does not represent all the views in the view hierarchy, |
| 316 | + // if a PlatformView does not change its composition parameter from last frame, it is not |
| 317 | + // included in the `views_to_recomposite_`. |
315 | 318 | void CompositeWithParams(int64_t view_id, const EmbeddedViewParams& params); |
316 | 319 |
|
317 | 320 | // Allocates a new FlutterPlatformViewLayer if needed, draws the pixels within the rect from |
|
0 commit comments