-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[ios][platform_view] Use CAShapeLayer as the mask to avoid software rendering #53072
[ios][platform_view] Use CAShapeLayer as the mask to avoid software rendering #53072
Conversation
*/ | ||
CGRect innerClipping1 = CGRectMake(3, 2, 4, 6); | ||
CGRect innerClipping2 = CGRectMake(2, 3, 6, 4); | ||
CGRect outterClipping = CGRectMake(2, 2, 6, 6); |
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.
Again the existing behavior is incorrect (or at least not pixel perfect).
In the picture below, the black rounded rect is the mask.
Pixels within the red rect (innerClipping1
) or green rect (innerClipping2
) should be fully opaque; pixels outside of black bounding rect (outterClipping
) should be fully transparent; the 4 corner pixels ((2, 2), (2, 7), (7, 2) and (7, 7)
) should be partially transparent.
for (int i = 0; i < 10; i++) { | ||
for (int j = 0; j < 10; j++) { | ||
CGPoint point = CGPointMake(i, j); | ||
int alpha = [self alphaOfPoint:CGPointMake(i, j) onView:mockFlutterView]; | ||
// Edges of the clipping might have a semi transparent pixel, we only check the pixels that | ||
// are fully inside the clipped area. | ||
CGRect insideClipping = CGRectMake(3, 3, 1, 1); |
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.
The existing behavior is incorrect - there shouldn't be any semi-transparent pixels on the edge.
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.
(Introduced in #20050)
I am able to confirm the procedures related to software rendering (described here) are gone. For example, |
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.
LGTM!
[self setNeedsDisplay]; | ||
} | ||
|
||
- (void)dealloc { | ||
CGPathRelease(pathSoFar_); | ||
[super dealloc]; |
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.
@jmagman fyi potentially code conflict with your ARC migration PRs
Unsurprisingly there's a scenario test failure here. Expected: checked in screenshot Actual: from the xctest |
df7fb5c
to
b190a44
Compare
b190a44
to
55dc130
Compare
This golden failure is a bit strange:
I can confirm that I have regenerated this image from my simulator iPhone SE (3rd gen) 17.0. |
Maybe something super subtle with the macOS version? Can you pull the attachment right off the failing test or use the one I attached from the failing test? |
916f3b2
to
5f5ba6d
Compare
@cbracken friendly ping since you requested review, but no rush :) |
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.
Yes, only on main thread. |
A reason for requesting a revert of flutter/engine/53072 could |
Reason for revert: compilation errors on iOS targets
|
…oftware rendering (#53072)" (#53220) Reverts: #53072 Initiated by: jason-simmons Reason for reverting: compilation errors on iOS targets ``` FlutterPlatformViews_Internal.mm:277:10: error: ARC forbids explicit message send of 'dealloc' 277 | [super dealloc]; | ~~~~~ ^ ``` (see https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8746006425774972161/+/u/build_ci_ios_debug_unopt_sim_flutter_testing_scenario_app_flutter_shell_platform_darwin_ios:ios_test_flutter/st Original PR Author: hellohuanlin Reviewed By: {cbracken, jonahwilliams} This change reverts the following previous change: This PR uses `CAShapeLayer` as the mask to avoid software rendering. I kept `UIView` as the mask, so that we can measure just the improvement related to avoiding software rendering. This also allows me to land this change sooner. I created [a separate issue](flutter/flutter#149212) to track removing UIView as the mask. Note: the previous behavior seems to be incorrect (or at least not pixel perfect). This PR fixed it. See comments. 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.* Fixes flutter/flutter#142813 Fixes flutter/flutter#142830 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
…149770) flutter/engine@11a32d4...f377330 2024-06-05 skia-flutter-autoroll@skia.org Roll Skia from 37755d48cca3 to 8448abc95867 (7 revisions) (flutter/engine#53230) 2024-06-05 skia-flutter-autoroll@skia.org Roll Dart SDK from dac7c04c7342 to f838a9a8d45f (3 revisions) (flutter/engine#53225) 2024-06-05 skia-flutter-autoroll@skia.org Roll Skia from 337c3c4d1f1b to 37755d48cca3 (45 revisions) (flutter/engine#53224) 2024-06-05 yjbanov@google.com [web] enable always_specify_types for web_ui (flutter/engine#53226) 2024-06-05 matanlurey@users.noreply.github.com Re-land #52859: Revamp the engine style guide, remove `always_specify_types` (flutter/engine#53223) 2024-06-05 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from pagJoGS4kQ8Efa_if... to 2xWubo2mRP_2_wXKJ... (flutter/engine#53222) 2024-06-05 fmil@google.com [icu] Manual roll of icu (flutter/engine#53199) 2024-06-05 98614782+auto-submit[bot]@users.noreply.github.com Reverts "[ios][platform_view] Use CAShapeLayer as the mask to avoid software rendering (#53072)" (flutter/engine#53220) 2024-06-05 41930132+hellohuanlin@users.noreply.github.com [ios][platform_view] Use CAShapeLayer as the mask to avoid software rendering (flutter/engine#53072) 2024-06-05 skia-flutter-autoroll@skia.org Roll Dart SDK from 343c20614708 to dac7c04c7342 (1 revision) (flutter/engine#53209) 2024-06-04 jonahwilliams@google.com [Impeller] Intel iOS Simulators must block on GPU completion. (flutter/engine#53073) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from pagJoGS4kQ8E to 2xWubo2mRP_2 If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Please CC matanl@google.com,rmistry@google.com,zra@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Flutter: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…ftware rendering #53072" (#53256) The previous PR was reverted because it was on top of an outdated commit prior to ARC. This PR rebases the main. The only change is removing the `[super dealloc]` call that caused the compiler error. *List which issues are fixed by this PR. You must list at least one issue.* Fixes flutter/flutter#142813 Fixes flutter/flutter#142830 *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This PR uses
CAShapeLayer
as the mask to avoid software rendering.I kept
UIView
as the mask, so that we can measure just the improvement related to avoiding software rendering. This also allows me to land this change sooner. I created a separate issue to track removing UIView as the mask.Note: the previous behavior seems to be incorrect (or at least not pixel perfect). This PR fixed it. See comments.
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.
Fixes flutter/flutter#142813
Fixes flutter/flutter#142830
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.