Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Conversation

flar
Copy link
Contributor

@flar flar commented May 25, 2023

The original PR caused some golden test failures down the line, likely due to bad analysis of when the combined BlendMode and color would result in a NOP situation.

This PR adds tests that go through every BlandMode and pair it with a variety of colors and Color/ImageFilters to verify that the operations are only omitted when they actually produce no change in the output. It also checks the validity of the "modifies_transparent_black" property of DisplayLists which can be used in place of the current CanvasSpy/DlOpSpy classes.

The description from the previous PR updated with the new name of the DL property:


This optimization avoids recording unnecessary render operations that will not affect the output and also eliminates the need for "draw detection" mechanisms like DlOpSpy and CanvasSpy by remembering if any non-transparent operations were included. The DlOpSpy unit tests were updated to check if the results from that object match the new DisplayList::modifies_transparent_black() method.

Fixes flutter/flutter#125338

In addition, this change will unblock some other Issues:

@flar flar requested a review from jonahwilliams May 26, 2023 00:18
Copy link
Contributor

@jonahwilliams jonahwilliams left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@flar flar added the autosubmit Merge PR when tree becomes green via auto submit App label Jun 1, 2023
@auto-submit auto-submit bot merged commit 3a453f2 into flutter:main Jun 1, 2023
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Jun 1, 2023
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Jun 1, 2023
…128064)

flutter/engine@7c0a639...3a453f2

2023-06-01 flar@google.com Reland "add non-rendering operation culling to DisplayListBuilder" (#41463) (flutter/engine#42330)

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 jonahwilliams@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://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
@flar
Copy link
Contributor Author

flar commented Jun 2, 2023

This PR seems to have caused some golden failures down the line so I'm creating a revert.

flar added a commit that referenced this pull request Jun 2, 2023
auto-submit bot pushed a commit that referenced this pull request Jun 2, 2023
…lder" (#41463)" (#42525)

Reverts #42330

Some golden failures down the line were discovered in internal testing. See b/285539451
auto-submit bot pushed a commit that referenced this pull request Jun 5, 2023
Fixes: flutter/flutter#128159

In diagnosing test failures for #42330 we discovered that the DisplayList code was not always backwards compatible with computing the bounds of inverted rectangles (where left > right or top > bottom). Historically such rectangles were always rendered as if they were sorted (i.e. `SkRect::makeSorted()`), but we computed bounds as if the bounds only mattered if the supplied rectangle was ordered. So, we would sometimes render a rectangle for which we mis-computed the bounds.

This would rarely surface in the current code as most rendered rectangles would pass through `SkMatrix::mapRect()` which implicitly orders the rectangle as it transforms it, but any attributes applied to the bounds before that method may have been applied "in the wrong direction" - such as:

- stroke width padding
- mask blur padding
- image filter padding
auto-submit bot pushed a commit that referenced this pull request Jun 11, 2023
…41463) (#42584)

This reverts commit 2553def.

Fixes flutter/flutter#125338

This PR should fix the blendmode/color analysis that caused failures for #41463 as well as the bounds failures for inverted rectangles that caused failures for #42330 (incorporating the fix from #42556).

The description from the [previous PR](#41463) updated with the new name of the DL property:

---------------------------------
This optimization avoids recording unnecessary render operations that will not affect the output and also eliminates the need for "draw detection" mechanisms like `DlOpSpy` and `CanvasSpy` by remembering if any non-transparent operations were included. The `DlOpSpy` unit tests were updated to check if the results from that object match the new `DisplayList::modifies_transparent_black()` method.

Fixes flutter/flutter#125338

In addition, this change will unblock some other Issues:

- flutter/flutter#125318
- flutter/flutter#125403
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
autosubmit Merge PR when tree becomes green via auto submit App
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[DisplayList] Improve DisplayList detection of non-operations
2 participants