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] Only remove platform views from flutter view in reset. #41709
Conversation
@@ -624,6 +624,9 @@ static bool ClipRRectContainsPlatformViewBoundingRect(const SkRRect& clip_rrect, | |||
void FlutterPlatformViewsController::Reset() { | |||
UIView* flutter_view = flutter_view_.get(); | |||
for (UIView* sub_view in [flutter_view subviews]) { | |||
if (![sub_view isKindOfClass:[ChildClippingView class]]) { |
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.
We shy away from RTTI-ish things in the engine. Can we avoid the same in ObjC TUs as well.
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.
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.
Good point, I will fix it. Also filed flutter/flutter#126868
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.
Interesting read. tho that means we will need to manually keep track of the child clipping views array, and keep that in sync with UIView::subviews
. not sure if it's worth the effort.
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.
manually keep track of the child clipping views array
We have it: active_composition_order_
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.
@chinmaygarde @hellohuanlin Fixed, ptal
UIView* flutter_view = flutter_view_.get(); | ||
for (UIView* sub_view in [flutter_view subviews]) { | ||
for (int64_t view_id : active_composition_order_) { | ||
UIView* sub_view = root_views_[view_id].get(); |
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.
can you add a comment clarifying that there may be non-platform views left in flutter_view's subviews (which was the confusing part that have caused this bug right?)
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.
There wasn't any bug AFAIK. The old code was just not careful about what to remove.
I agree if we used the old approach with (isKindOf), a comment is helpful.
The new approach doesn't even assume the super view is flutter view. I'm not sure what I should say in a comment to not make it confusing.
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.
sg
…126919) flutter/engine@c4d4b40...d7a5de6 2023-05-16 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from JCoP2Fekj3MBIqskE... to N4LwCRxg0oIevhQ_O... (flutter/engine#42070) 2023-05-16 zhangzhijian.123@bytedance.com [Impeller] Fix issue about saveLayer ignoring opacity of paint with advanced blend mode (flutter/engine#41972) 2023-05-16 ychris@google.com [ios_platform_view] Only remove platform views from flutter view in reset. (flutter/engine#41709) 2023-05-16 godofredoc@google.com Add drone_dimensions as top level target property. (flutter/engine#42064) Also rolling transitive DEPS: fuchsia/sdk/core/mac-amd64 from JCoP2Fekj3MB to N4LwCRxg0oIe 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#126919) flutter/engine@c4d4b40...d7a5de6 2023-05-16 skia-flutter-autoroll@skia.org Roll Fuchsia Mac SDK from JCoP2Fekj3MBIqskE... to N4LwCRxg0oIevhQ_O... (flutter/engine#42070) 2023-05-16 zhangzhijian.123@bytedance.com [Impeller] Fix issue about saveLayer ignoring opacity of paint with advanced blend mode (flutter/engine#41972) 2023-05-16 ychris@google.com [ios_platform_view] Only remove platform views from flutter view in reset. (flutter/engine#41709) 2023-05-16 godofredoc@google.com Add drone_dimensions as top level target property. (flutter/engine#42064) Also rolling transitive DEPS: fuchsia/sdk/core/mac-amd64 from JCoP2Fekj3MB to N4LwCRxg0oIe 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
Add a class type check during reset when removing the PlatformViews.
Fixes: flutter/flutter#125999
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.