-
Notifications
You must be signed in to change notification settings - Fork 6k
[macOS] Group per-view information in FlutterCompositor
into a class
#51738
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 "@test-exemption-reviewer" in the #hackers channel in Chat (don't just cc them here, they won't see it! Use 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. |
@knopp Can you take a look? In addition to the change itself, how do you think I can test it (and further changes to the composition code)? Because macOS |
FML_DCHECK([[NSThread currentThread] isMainThread]) | ||
<< "Must be on the main thread to present platform views"; | ||
|
||
// Active mutator views for this frame. | ||
NSMutableArray<FlutterMutatorView*>* present_mutators = [NSMutableArray array]; | ||
|
||
for (const auto& platform_view : platform_views) { | ||
[present_mutators addObject:PresentPlatformView(default_base_view, platform_view.first, |
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.
Just a nit - The formatting looks bit weird after adding additional argument. Maybe use a temporary variable for the result of PresentPlatformView?
Looks good, left couple of nits, is this still a draft? |
@knopp I'm mostly wondering if there's any unit tests you'd like me to add. I'm also ok with skipping this one and testing the macOS engine as a whole in a later patch. The change itself is finished. I've marked it as ready to review. |
Right. It is currently only tested in I think this is a fairly minor refactor I'd be okay with this landing without tests. |
…145990) flutter/engine@68aa9ba...b16c0f1 2024-03-29 skia-flutter-autoroll@skia.org Roll Skia from 94c0af1297ae to a12e40efacea (3 revisions) (flutter/engine#51776) 2024-03-29 skia-flutter-autoroll@skia.org Roll Skia from b2a01ae03cdf to 94c0af1297ae (1 revision) (flutter/engine#51773) 2024-03-29 skia-flutter-autoroll@skia.org Roll Skia from 6042ad386bcf to b2a01ae03cdf (4 revisions) (flutter/engine#51772) 2024-03-29 skia-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from uzI3wnbEGlZ_dtO0Z... to 3vgfbp1vjXkdMZ09m... (flutter/engine#51767) 2024-03-29 jacksongardner@google.com [skwasm] Fix `toString` methods on Paint and ImageFilter/ColorFilter (flutter/engine#51766) 2024-03-29 john@johnmccutchan.com Reland flutter/engine#51391 (flutter/engine#51764) 2024-03-29 737941+loic-sharma@users.noreply.github.com Add completion callback to `Shell::AddView` (flutter/engine#51659) 2024-03-29 737941+loic-sharma@users.noreply.github.com [Windows] Move keyboard initialization (flutter/engine#51758) 2024-03-29 737941+loic-sharma@users.noreply.github.com [Windows] Don't always stop engine on view destruction (flutter/engine#51681) 2024-03-28 dkwingsmt@users.noreply.github.com [macOS] Group per-view information in `FlutterCompositor` into a class (flutter/engine#51738) Also rolling transitive DEPS: fuchsia/sdk/core/linux-amd64 from uzI3wnbEGlZ_ to 3vgfbp1vjXkd 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 jacksongardner@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
This PR removes the view ID check added in #51738, which has been causing a test `FlutterEngineTest.CompositorIgnoresUnknownView`, added in #51436, to fail. This problem was missed by the CI because the test and the view ID check were added in two PRs recently and they were not using the latest engine to check. The view ID check is not needed anyway, and is only a temporary check until the multiview support is landed. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style
This PR groups per-view information in
FlutterCompositor
into a private class,ViewPresenter
. This makes it easier to manage per-view data and write view operations.Part of flutter/flutter#145874.
Currently, view presenters are never removed once created, since the macOS runner doesn't support removing views. This will be added in the future.
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.