-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
[Impeller] Turn off Aiks bounds tracking for filtered SaveLayers. #49076
Conversation
be75fc9
to
53cb037
Compare
Here is similar code in the DisplayListBuilder for reference: engine/display_list/dl_builder.cc Line 548 in 91f65ee
engine/display_list/dl_builder.cc Line 420 in 91f65ee
|
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.
Safe, but we should look at some more optimum solutions at some point.
// applied. | ||
// See also: https://github.com/flutter/flutter/issues/139294 | ||
if (paint.image_filter) { | ||
transform_stack_.back().cull_rect = std::nullopt; |
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.
Another technique could be to run the current cull_rect through the filter to get a reverse bounds, as in:
/// @brief Determines the coverage of source pixels that will be needed |
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.
Another optimization would be to see if the filter modifies location at all. The ColorFilterImageFilter would not need to clear the cull_rect, for instance.
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.
I don't think that's quite enough. In order to produce a correct cull rect, wouldn't we need to pass each new clip's bounds through the chain of all parent filters? Also, it would need to be forward bounds, not reverse, since the cull rect needs to expand for kernel filters.
Am I missing something?
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.
It is done for each filter on each restore:
…140255) flutter/engine@6e3a048...ca329dd 2023-12-15 bdero@google.com [Impeller] Turn off Aiks bounds tracking for filtered SaveLayers. (flutter/engine#49076) 2023-12-15 skia-flutter-autoroll@skia.org Roll Skia from cf84bab13da3 to 191943f9c43e (1 revision) (flutter/engine#49105) 2023-12-15 skia-flutter-autoroll@skia.org Roll Dart SDK from e6528d1b7997 to d66f9c854db7 (1 revision) (flutter/engine#49104) 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 jsimmons@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
…utter#49076) We use this bounds rect for querying the DisplayList rtree when culling. But when sub-DisplayLists are being dispatched, the DisplayList's rtree is local and doesn't incorporate parent layer filters. So sub-DisplayLists are getting culled as if no filters are being applied. Technically our local bounds tracking in Aiks is actually correct here, but this is a quick fix to alleviate the problem. I don't know what the best longterm solution for this is. (cherry picked from commit ca329dd)
…utter#49076) We use this bounds rect for querying the DisplayList rtree when culling. But when sub-DisplayLists are being dispatched, the DisplayList's rtree is local and doesn't incorporate parent layer filters. So sub-DisplayLists are getting culled as if no filters are being applied. Technically our local bounds tracking in Aiks is actually correct here, but this is a quick fix to alleviate the problem. I don't know what the best longterm solution for this is. (cherry picked from commit ca329dd)
#49198) Cherry-pick for #49076. For issue: flutter/flutter#139294
* [CP] Fix _availability_version_check for iOS 11 and 12 (flutter#48926) CP of flutter@5587d26 into 3.16 for flutter/flutter#138711. * [CP] [Impeller] Turn off Aiks bounds tracking for filtered SaveLayers. (flutter#49198) Cherry-pick for flutter#49076. For issue: flutter/flutter#139294 * [CP] Fix for AnimatedOpacity affects blended color overlay render (flutter#49190) This PR cherry-picks the following two commits: flutter@2dbc5d2 flutter@0b0fab8 to address flutter/flutter#139571 * [cherrypick-stable]Skip unexpected events in MultiPlatformViewBackgroundForegroundScenar… (flutter#49247) â�¦io (flutter#48456) Fixes flutter/flutter#138193. Was first attempted to fix in flutter#48096, but that was not reliable since it's all asynchronous. ------------------------------------------- cherry pick to fix mac unopt failures on stable branch: https://flutter-dashboard.appspot.com/#/build?repo=engine&branch=flutter-3.16-candidate.0 --------- Co-authored-by: Zachary Anderson <zanderso@users.noreply.github.com> Co-authored-by: Brandon DeRosier <bdero@google.com> Co-authored-by: Xilai Zhang <xilaizhang@google.com>
…. (#49198) Cherry-pick for flutter/engine#49076. For issue: flutter/flutter#139294
Resolves flutter/flutter#139294.
We use this bounds rect for querying the DisplayList rtree when culling. But when sub-DisplayLists are being dispatched, the DisplayList's rtree is local and doesn't incorporate parent layer filters. So sub-DisplayLists are getting culled as if no filters are being applied.
Technically our local bounds tracking in Aiks is actually correct here, but this is a quick fix to alleviate the problem. I don't know what the best longterm solution for this is.