This repository was archived by the owner on Feb 25, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6k
Always save canvas to prevent ClipRects from drawing on top of higher layers. #6199
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
liyuqian
reviewed
Sep 7, 2018
flow/layers/clip_rect_layer.cc
Outdated
@@ -41,7 +41,7 @@ void ClipRectLayer::Paint(PaintContext& context) const { | |||
TRACE_EVENT0("flutter", "ClipRectLayer::Paint"); | |||
FML_DCHECK(needs_painting()); | |||
|
|||
SkAutoCanvasRestore save(&context.canvas, clip_behavior_ != Clip::hardEdge); | |||
SkAutoCanvasRestore save(&context.canvas, true); |
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.
Ah, yes, this was my mistake.
It should be
SkAutoCanvasRestore save(&context.canvas, true);
context.canvas.clipRect(paint_bounds(), clip_behavior_ != Clip::hardEdge);
BTW, can you write a golden test in flutter/flutter to verify this bug and ensure that we won't regress in the future?
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.
Ahh that version makes a lot more sense! Yeah, I'll get a golden test in.
GaryQian
added a commit
to flutter/goldens
that referenced
this pull request
Sep 7, 2018
liyuqian
approved these changes
Sep 7, 2018
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
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Sep 7, 2018
flutter/engine@58a1894...93dac2a git log 58a1894..93dac2a --no-merges --oneline 93dac2a Always save canvas and correctly pass antialias boolean in ClipRects. (flutter/engine#6199) 16c56af Roll src/third_party/skia 300b6197e344..094b3eaf479c (17 commits) (flutter/engine#6200) 2af72eb Don't map iOS reduce motion to disabled animations (flutter/engine#6194) 687cf08 Add option to invert paint colors to be used for smart invert accessibility on iOS (flutter/engine#6176) 85d47fb Accept file URIs as parameters in the RunInView service RPC (flutter/engine#6191) 5a19d76 Roll src/third_party/skia 0b80e62a14ae..300b6197e344 (9 commits) (flutter/engine#6198) f33615c Roll src/third_party/skia b090b2b26803..0b80e62a14ae (2 commits) (flutter/engine#6197) 75f6bdf Revert "Dart SDK roll for 2018/09/06 (flutter#6189)" (flutter/engine#6192) b09563b Roll src/third_party/skia 106d04e907c1..b090b2b26803 (1 commits) (flutter/engine#6193) e164e83 Reset the raster cache when the compositor context is created. (flutter/engine#6150) f02fc8c Dart SDK roll for 2018/09/06 (flutter/engine#6189) The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff, who should be CC'd on the roll, and stop the roller if necessary.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Sep 7, 2018
flutter/engine@58a1894...e27a2e9 git log 58a1894..e27a2e9 --no-merges --oneline e27a2e9 Dart SDK roll for 2018/09/07 (flutter/engine#6201) 93dac2a Always save canvas and correctly pass antialias boolean in ClipRects. (flutter/engine#6199) 16c56af Roll src/third_party/skia 300b6197e344..094b3eaf479c (17 commits) (flutter/engine#6200) 2af72eb Don't map iOS reduce motion to disabled animations (flutter/engine#6194) 687cf08 Add option to invert paint colors to be used for smart invert accessibility on iOS (flutter/engine#6176) 85d47fb Accept file URIs as parameters in the RunInView service RPC (flutter/engine#6191) 5a19d76 Roll src/third_party/skia 0b80e62a14ae..300b6197e344 (9 commits) (flutter/engine#6198) f33615c Roll src/third_party/skia b090b2b26803..0b80e62a14ae (2 commits) (flutter/engine#6197) 75f6bdf Revert "Dart SDK roll for 2018/09/06 (flutter#6189)" (flutter/engine#6192) b09563b Roll src/third_party/skia 106d04e907c1..b090b2b26803 (1 commits) (flutter/engine#6193) e164e83 Reset the raster cache when the compositor context is created. (flutter/engine#6150) f02fc8c Dart SDK roll for 2018/09/06 (flutter/engine#6189) The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff, who should be CC'd on the roll, and stop the roller if necessary.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Sep 8, 2018
flutter/engine@58a1894...bf96dbe git log 58a1894..bf96dbe --no-merges --oneline bf96dbe Revert "Some cleanups enabled by removing support for Dart. (flutter#5621)" (flutter/engine#6205) 3358115 Roll src/third_party/skia 094b3eaf479c..2810c856dfa2 (6 commits) (flutter/engine#6203) 4c2448d Some cleanups enabled by removing support for Dart. (flutter/engine#5621) e27a2e9 Dart SDK roll for 2018/09/07 (flutter/engine#6201) 93dac2a Always save canvas and correctly pass antialias boolean in ClipRects. (flutter/engine#6199) 16c56af Roll src/third_party/skia 300b6197e344..094b3eaf479c (17 commits) (flutter/engine#6200) 2af72eb Don't map iOS reduce motion to disabled animations (flutter/engine#6194) 687cf08 Add option to invert paint colors to be used for smart invert accessibility on iOS (flutter/engine#6176) 85d47fb Accept file URIs as parameters in the RunInView service RPC (flutter/engine#6191) 5a19d76 Roll src/third_party/skia 0b80e62a14ae..300b6197e344 (9 commits) (flutter/engine#6198) f33615c Roll src/third_party/skia b090b2b26803..0b80e62a14ae (2 commits) (flutter/engine#6197) 75f6bdf Revert "Dart SDK roll for 2018/09/06 (flutter#6189)" (flutter/engine#6192) b09563b Roll src/third_party/skia 106d04e907c1..b090b2b26803 (1 commits) (flutter/engine#6193) e164e83 Reset the raster cache when the compositor context is created. (flutter/engine#6150) f02fc8c Dart SDK roll for 2018/09/06 (flutter/engine#6189) The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff, who should be CC'd on the roll, and stop the roller if necessary.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Sep 8, 2018
flutter/engine@58a1894...b952331 git log 58a1894..b952331 --no-merges --oneline b952331 Allow embedders to specify a custom GL proc address resolver. (flutter/engine#6204) bf96dbe Revert "Some cleanups enabled by removing support for Dart. (flutter#5621)" (flutter/engine#6205) 3358115 Roll src/third_party/skia 094b3eaf479c..2810c856dfa2 (6 commits) (flutter/engine#6203) 4c2448d Some cleanups enabled by removing support for Dart. (flutter/engine#5621) e27a2e9 Dart SDK roll for 2018/09/07 (flutter/engine#6201) 93dac2a Always save canvas and correctly pass antialias boolean in ClipRects. (flutter/engine#6199) 16c56af Roll src/third_party/skia 300b6197e344..094b3eaf479c (17 commits) (flutter/engine#6200) 2af72eb Don't map iOS reduce motion to disabled animations (flutter/engine#6194) 687cf08 Add option to invert paint colors to be used for smart invert accessibility on iOS (flutter/engine#6176) 85d47fb Accept file URIs as parameters in the RunInView service RPC (flutter/engine#6191) 5a19d76 Roll src/third_party/skia 0b80e62a14ae..300b6197e344 (9 commits) (flutter/engine#6198) f33615c Roll src/third_party/skia b090b2b26803..0b80e62a14ae (2 commits) (flutter/engine#6197) 75f6bdf Revert "Dart SDK roll for 2018/09/06 (flutter#6189)" (flutter/engine#6192) b09563b Roll src/third_party/skia 106d04e907c1..b090b2b26803 (1 commits) (flutter/engine#6193) e164e83 Reset the raster cache when the compositor context is created. (flutter/engine#6150) f02fc8c Dart SDK roll for 2018/09/06 (flutter/engine#6189) The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff, who should be CC'd on the roll, and stop the roller if necessary.
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
Sep 8, 2018
flutter/engine@58a1894...bf3c224 git log 58a1894..bf3c224 --no-merges --oneline bf3c224 Roll src/third_party/skia 2810c856dfa2..a3dc329d1db1 (1 commits) (flutter/engine#6206) b952331 Allow embedders to specify a custom GL proc address resolver. (flutter/engine#6204) bf96dbe Revert "Some cleanups enabled by removing support for Dart. (flutter#5621)" (flutter/engine#6205) 3358115 Roll src/third_party/skia 094b3eaf479c..2810c856dfa2 (6 commits) (flutter/engine#6203) 4c2448d Some cleanups enabled by removing support for Dart. (flutter/engine#5621) e27a2e9 Dart SDK roll for 2018/09/07 (flutter/engine#6201) 93dac2a Always save canvas and correctly pass antialias boolean in ClipRects. (flutter/engine#6199) 16c56af Roll src/third_party/skia 300b6197e344..094b3eaf479c (17 commits) (flutter/engine#6200) 2af72eb Don't map iOS reduce motion to disabled animations (flutter/engine#6194) 687cf08 Add option to invert paint colors to be used for smart invert accessibility on iOS (flutter/engine#6176) 85d47fb Accept file URIs as parameters in the RunInView service RPC (flutter/engine#6191) 5a19d76 Roll src/third_party/skia 0b80e62a14ae..300b6197e344 (9 commits) (flutter/engine#6198) f33615c Roll src/third_party/skia b090b2b26803..0b80e62a14ae (2 commits) (flutter/engine#6197) 75f6bdf Revert "Dart SDK roll for 2018/09/06 (flutter#6189)" (flutter/engine#6192) b09563b Roll src/third_party/skia 106d04e907c1..b090b2b26803 (1 commits) (flutter/engine#6193) e164e83 Reset the raster cache when the compositor context is created. (flutter/engine#6150) f02fc8c Dart SDK roll for 2018/09/06 (flutter/engine#6189) The AutoRoll server is located here: https://autoroll.skia.org/r/flutter-engine-flutter-autoroll Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+/master/autoroll/README.md If the roll is causing failures, please contact the current sheriff, who should be CC'd on the roll, and stop the roller if necessary.
This was referenced Sep 11, 2018
GaryQian
added a commit
to GaryQian/flutter
that referenced
this pull request
Sep 12, 2018
Hixie
pushed a commit
that referenced
this pull request
Sep 12, 2018
GaryQian
added a commit
to flutter/flutter
that referenced
this pull request
Sep 13, 2018
Previously, the engine did not properly pass the AA flag on ClipRect.clipBehavior. flutter/engine#6199 fixes this and enables AA. However, default AA on clipRects has caused severe regressions in benchmark performance. To maintain expected performance, we should now default the clipBehavior to hardEdge to disable default AA. This is consistent with any flutter projects that did not previously explicitly set the clipBehavior and should not change app appearance.
amirh
pushed a commit
to amirh/engine
that referenced
this pull request
Sep 21, 2018
amirh
pushed a commit
to amirh/engine
that referenced
this pull request
Sep 21, 2018
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When ClipRects have hardEdge clipBehavior, the cliprect will draw on top of the performance overlay. This prevents that by always saving when doing SkAutoCanvasRestore.
Fixes flutter/flutter#21095