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

fix bounds of inverted rendered rectangles #42556

Merged
merged 1 commit into from
Jun 5, 2023

Conversation

flar
Copy link
Contributor

@flar flar commented 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

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

flutter/engine@7f12e34...220ece4

2023-06-05 [email protected] Ensure Dart roll script picks up udpates to dart-sdk/tools (flutter/engine#42576)
2023-06-05 [email protected] Run dependabot in off peak hours (flutter/engine#42572)
2023-06-05 [email protected] fix bounds of inverted rendered rectangles (flutter/engine#42556)
2023-06-05 [email protected] Roll Fuchsia Mac SDK from fgfgAhpxFpse7Xi4i... to tCxDcZ3yi0rnKGVHt... (flutter/engine#42574)
2023-06-05 [email protected] Add missing #include of SkCFObject.h (flutter/engine#42573)
2023-06-05 [email protected] Improve getting non-overlapping rectangles from RTree (flutter/engine#42399)

Also rolling transitive DEPS:
  fuchsia/sdk/core/mac-amd64 from fgfgAhpxFpse to tCxDcZ3yi0rn

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 [email protected],[email protected],[email protected] 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
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
Status: Done
Development

Successfully merging this pull request may close these issues.

DisplayList mishandles unordered rectangles
2 participants