-
Notifications
You must be signed in to change notification settings - Fork 6k
[DRAFT][ios][platform_view]Use CAShapeLayer as the mask to avoid software rendering #52957
[DRAFT][ios][platform_view]Use CAShapeLayer as the mask to avoid software rendering #52957
Conversation
CGRectMake(-clipView.frame.origin.x, -clipView.frame.origin.y, | ||
CGRectGetWidth(flutterView.bounds), CGRectGetHeight(flutterView.bounds)); | ||
clipView.maskView = [mask_view_pool_.get() getMaskViewWithFrame:frame]; | ||
clipView.layer.mask = [mask_view_pool_.get() getMaskViewWithFrame:frame]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is obviously still a draft since I haven't renamed mask_view_pool
to mask_layer_pool
etc.
@jonahwilliams @jmagman So this is still a draft PR, but wanna share the benchmark result first:
Observation
I think we should also ignore 90th/99th/worst due to large noise, and focus on the average frames, as discussed previously. The result of this PR feels slightly better than (1) it not only avoids software rendering, but also removes I think despite that the improvement is small (if any at all, due to noise), we should land it, let it run for a week or 2, and see a more accurate result |
|
||
@implementation ChildClippingView | ||
|
||
- (id<CAAction>)actionForLayer:(CALayer*)layer forKey:(NSString*)event { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cross ref: #51661 (comment)
We should absolutely land this change, we know that software rasterization is slow - evne if there are other things going on on this benchmark. I would expect an improvement to 99%+ times and not average times, so we may need to run the benchmark on CI for a while to see an improvement there. |
I am closing this in favor of #53072, because there are 2 improvements in this PR and I want to separate them: (1) avoid software rendering (PR linked above); This allows us to (1) measure improvement separately for a better understanding; and also (2) we can land the software rendering PR sooner, since there are quite a lot of testing changes needed to complete this PR. |
This PR uses
CAShapeLayer
as the mask to avoid software rendering.Running benchmark now, will post in comment.
See design doc: https://docs.google.com/document/d/1TqG_N4GK_qctuk73Gk3zOdAiILUrwMqxoCMgroK_AeA/edit?resourcekey=0-jUiidfzIS642ngG2w9vSUA&tab=t.0
List which issues are fixed by this PR. You must list at least one issue.
If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.