@@ -420,14 +420,14 @@ static bool ClipBoundsContainsPlatformViewBoundingRect(const SkRect& clip_bounds
420
420
}
421
421
422
422
void FlutterPlatformViewsController::ClipViewAddMaskView (UIView* clipView) {
423
- // if (clipView.maskView) {
424
- // return;
425
- // }
426
- // UIView* flutterView = flutter_view_.get();
427
- // CGRect frame = CGRectMake(-clipView.frame.origin.x, -clipView.frame.origin.y,
428
- // CGRectGetWidth(flutterView.bounds) ,
429
- // CGRectGetHeight(flutterView.bounds));
430
- // clipView.maskView = [mask_view_pool_.get() getMaskViewWithFrame:frame];
423
+ if (clipView.maskView ) {
424
+ return ;
425
+ }
426
+ UIView* flutterView = flutter_view_.get ();
427
+ CGRect frame =
428
+ CGRectMake (-clipView. frame . origin . x , -clipView. frame . origin . y ,
429
+ CGRectGetWidth (flutterView. bounds ), CGRectGetHeight (flutterView.bounds ));
430
+ clipView.maskView = [mask_view_pool_.get () getMaskViewWithFrame: frame];
431
431
}
432
432
433
433
void FlutterPlatformViewsController::ApplyMutators (const MutatorsStack& mutators_stack,
@@ -444,13 +444,10 @@ static bool ClipBoundsContainsPlatformViewBoundingRect(const SkRect& clip_bounds
444
444
NSMutableArray * blurFilters = [[[NSMutableArray alloc ] init ] autorelease ];
445
445
FML_DCHECK (!clipView.maskView ||
446
446
[clipView.maskView isKindOfClass: [FlutterClippingMaskView class ]]);
447
- FlutterClippingMaskView* maskView = (FlutterClippingMaskView*)clipView.maskView ;
448
447
if (mask_view_pool_.get () == nil ) {
449
448
mask_view_pool_.reset ([[FlutterClippingMaskViewPool alloc ] initWithCapacity: 5 ]);
450
449
}
451
- if (maskView) {
452
- [mask_view_pool_.get () markAvailable: maskView];
453
- }
450
+ [mask_view_pool_.get () recycleMaskViews ];
454
451
clipView.maskView = nil ;
455
452
auto iter = mutators_stack.Begin ();
456
453
while (iter != mutators_stack.End ()) {
@@ -533,28 +530,28 @@ static bool ClipBoundsContainsPlatformViewBoundingRect(const SkRect& clip_bounds
533
530
[clipView applyBlurBackdropFilters: blurFilters];
534
531
}
535
532
536
- // CGFloat screenScale = [UIScreen mainScreen].scale;
537
- // // The UIKit frame is set based on the logical resolution (points) instead of physical.
538
- // //
533
+ CGFloat screenScale = [UIScreen mainScreen ].scale ;
534
+ // The UIKit frame is set based on the logical resolution (points) instead of physical.
535
+ //
539
536
// (https://developer.apple.com/library/archive/documentation/DeviceInformation/Reference/iOSDeviceCompatibility/Displays/Displays.html).
540
- // // However, flow is based on the physical resolution. For example, 1000 pixels in flow equals
541
- // // 500 points in UIKit for devices that has screenScale of 2. We need to scale the
537
+ // However, flow is based on the physical resolution. For example, 1000 pixels in flow equals
538
+ // 500 points in UIKit for devices that has screenScale of 2. We need to scale the
542
539
// transformMatrix
543
- // // down to the logical resoltion before applying it to the layer of PlatformView.
544
- // transformMatrix.postScale(1 / screenScale, 1 / screenScale);
545
-
546
- // // Reverse the offset of the clipView.
547
- // // The clipView's frame includes the final translate of the final transform matrix.
548
- // // Thus, this translate needs to be reversed so the platform view can layout at the correct
549
- // // offset.
550
- // //
551
- // // Note that the transforms are not applied to the clipping paths because clipping paths happen
540
+ // down to the logical resoltion before applying it to the layer of PlatformView.
541
+ transformMatrix.postScale (1 / screenScale, 1 / screenScale);
542
+
543
+ // Reverse the offset of the clipView.
544
+ // The clipView's frame includes the final translate of the final transform matrix.
545
+ // Thus, this translate needs to be reversed so the platform view can layout at the correct
546
+ // offset.
547
+ //
548
+ // Note that the transforms are not applied to the clipping paths because clipping paths happen
552
549
// on
553
- // // the mask view, whose origin is always (0,0) to the flutter_view.
554
- // transformMatrix.postTranslate(-clipView.frame.origin.x, -clipView.frame.origin.y);
550
+ // the mask view, whose origin is always (0,0) to the flutter_view.
551
+ transformMatrix.postTranslate (-clipView.frame .origin .x , -clipView.frame .origin .y );
555
552
556
- // embedded_view.layer.transform = flutter::GetCATransform3DFromSkMatrix(transformMatrix);
557
- embedded_view.frame = clipView.bounds ;
553
+ embedded_view.layer .transform = flutter::GetCATransform3DFromSkMatrix (transformMatrix);
554
+ // embedded_view.frame = clipView.bounds;
558
555
}
559
556
560
557
void FlutterPlatformViewsController::CompositeWithParams (int view_id,
@@ -880,6 +877,7 @@ static bool ClipBoundsContainsPlatformViewBoundingRect(const SkRect& clip_bounds
880
877
if (catransaction_added_) {
881
878
FML_DCHECK ([[NSThread currentThread ] isMainThread ]);
882
879
[CATransaction commit ];
880
+
883
881
catransaction_added_ = false ;
884
882
}
885
883
}
0 commit comments