Skip to content
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

Always save canvas to prevent ClipRects from drawing on top of higher layers. #6199

Merged
merged 1 commit into from
Sep 7, 2018

Conversation

GaryQian
Copy link
Contributor

@GaryQian GaryQian commented Sep 7, 2018

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

@@ -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);
Copy link
Contributor

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?

Copy link
Contributor Author

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
Copy link
Contributor

@liyuqian liyuqian left a comment

Choose a reason for hiding this comment

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

LGTM

@GaryQian GaryQian merged commit 93dac2a into flutter:master Sep 7, 2018
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.
GaryQian added a commit to GaryQian/flutter 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.
@GaryQian GaryQian deleted the textshift branch November 29, 2018 01:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants