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
[macOS] Clean up PlatformView mutator scaling #42110
Conversation
It looks like this pull request may not have tests. Please make sure to add tests before merging. If you need an exemption to this rule, contact Hixie on the #hackers channel in Chat (don't just cc him here, he won't see it! He's on Discord!). If you are not sure if you need tests, consider this rule of thumb: the purpose of a test is to make sure someone doesn't accidentally revert the fix. Ask yourself, is there anything in your PR that you feel it is important we not accidentally revert back to how it was before your fix? Reviewers: Read the Tree Hygiene page and make sure this patch meets those guidelines before LGTMing. |
test-exempt: code refactor with no semantic change |
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.
Still needs tests, of course.
shell/platform/darwin/macos/framework/Source/FlutterMutatorView.mm
Outdated
Show resolved
Hide resolved
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.
When applying platform view mutators, the mutations array includes a transform from logical to physical coordinates. Since Cocoa deals only in logical points, we inject a physical to logical coordinate transform to counteract this. Rather than applying this multiple times throughout the `[FlutterMutatorView applyFlutterLayer]` method we gather a list of transforms that includes the additional physical to logical scale transform. This change is a cleanup change for readability and makes no semantic changes to how mutator views are applied. Existing unit tests in FlutterMutatorViewTest.mm are expected to pass without changes.
…127116) flutter/engine@a22dd64...843ce0b 2023-05-18 skia-flutter-autoroll@skia.org Roll Skia from a3a9fb5f4a31 to ad8fa4a38668 (1 revision) (flutter/engine#42121) 2023-05-18 skia-flutter-autoroll@skia.org Roll Dart SDK from 7f6fabbe9fba to 1991015ad460 (4 revisions) (flutter/engine#42120) 2023-05-18 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from wNfsef5we4l8hxEII... to jNFpQ1gTCMNbzSZCw... (flutter/engine#42118) 2023-05-18 skia-flutter-autoroll@skia.org Roll Skia from caff30d16ae7 to a3a9fb5f4a31 (1 revision) (flutter/engine#42117) 2023-05-18 skia-flutter-autoroll@skia.org Roll Skia from ffa425bacfc4 to caff30d16ae7 (29 revisions) (flutter/engine#42116) 2023-05-18 chris@bracken.jp [macOS] Clean up PlatformView mutator scaling (flutter/engine#42110) Also rolling transitive DEPS: fuchsia/sdk/core/mac-amd64 from wNfsef5we4l8 to jNFpQ1gTCMNb 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 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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
…lutter#127116) flutter/engine@a22dd64...843ce0b 2023-05-18 skia-flutter-autoroll@skia.org Roll Skia from a3a9fb5f4a31 to ad8fa4a38668 (1 revision) (flutter/engine#42121) 2023-05-18 skia-flutter-autoroll@skia.org Roll Dart SDK from 7f6fabbe9fba to 1991015ad460 (4 revisions) (flutter/engine#42120) 2023-05-18 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from wNfsef5we4l8hxEII... to jNFpQ1gTCMNbzSZCw... (flutter/engine#42118) 2023-05-18 skia-flutter-autoroll@skia.org Roll Skia from caff30d16ae7 to a3a9fb5f4a31 (1 revision) (flutter/engine#42117) 2023-05-18 skia-flutter-autoroll@skia.org Roll Skia from ffa425bacfc4 to caff30d16ae7 (29 revisions) (flutter/engine#42116) 2023-05-18 chris@bracken.jp [macOS] Clean up PlatformView mutator scaling (flutter/engine#42110) Also rolling transitive DEPS: fuchsia/sdk/core/mac-amd64 from wNfsef5we4l8 to jNFpQ1gTCMNb 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 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://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
When applying platform view mutators, the mutations array includes a transform from logical to physical coordinates. Since Cocoa deals only in logical points, we inject a physical to logical coordinate transform to counteract this.
Rather than applying this multiple times throughout the
[FlutterMutatorView applyFlutterLayer]
method we gather a list of transforms that includes the additional physical to logical scale transform.This change is a cleanup change for readability and makes no semantic changes to how mutator views are applied. Existing unit tests in FlutterMutatorViewTest.mm are expected to pass without changes.
This is refactoring prior to applying a fix for rotation handling.
Issue: flutter/flutter#124490
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.