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
[canvaskit] Clip before applying ColorFilter so it doesn't filter beyond child bounds #52704
Merged
harryterkelsen
merged 3 commits into
flutter:main
from
harryterkelsen:colorfiltered-scrollview
May 10, 2024
Merged
[canvaskit] Clip before applying ColorFilter so it doesn't filter beyond child bounds #52704
harryterkelsen
merged 3 commits into
flutter:main
from
harryterkelsen:colorfiltered-scrollview
May 10, 2024
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
yjbanov
approved these changes
May 10, 2024
@@ -409,12 +411,23 @@ class ImageFilterEngineLayer extends ContainerLayer | |||
childMatrix.translate(_offset.dx, _offset.dy); | |||
prerollContext.mutatorsStack | |||
.pushTransform(Matrix4.translationValues(_offset.dx, _offset.dy, 0.0)); | |||
final CkManagedSkImageFilterConvertible convertible; |
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.
Can this be a field that's populated in the constructor and reused by both preroll
and paint
?
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's only used in preroll
. In paint
we use the filter
directly
engine-flutter-autoroll
added a commit
to engine-flutter-autoroll/flutter
that referenced
this pull request
May 10, 2024
…filter beyond child bounds (flutter/engine#52704)
This change had SkiaGold diffs in two tests on the roll to the framework. https://flutter-gold.skia.org/search?crs=github&issue=148147&patchsets=8&positive=true&untriaged=false They looked correct, and I accepted them. |
auto-submit bot
pushed a commit
to flutter/flutter
that referenced
this pull request
May 10, 2024
…148147) flutter/engine@d4f705c...ba8e0d3 2024-05-10 [email protected] [canvaskit] Clip before applying ColorFilter so it doesn't filter beyond child bounds (flutter/engine#52704) 2024-05-10 [email protected] Migrate FlutterView, FlutterPlatformViews, FlutterOverlayView to ARC (flutter/engine#52535) 2024-05-10 [email protected] Infer `--rbe` based on the existence of `//flutter/build/rbe` (flutter/engine#52700) 2024-05-10 [email protected] [Impeller] Disable AHB swapchain. (flutter/engine#52713) 2024-05-10 [email protected] Roll Skia from c7cd1e9690d1 to 11d892ce49b6 (25 revisions) (flutter/engine#52712) 2024-05-10 [email protected] [Impeller] Document how to do basic rendering in Impeller. (flutter/engine#52703) 2024-05-10 [email protected] [impeller] adds experimental canvas docstring (flutter/engine#52710) 2024-05-10 [email protected] Roll third_party/freetype2 from 3bea27612 to af4c2d86d (2 revisions) (flutter/engine#52689) 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] 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
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 a ColorFilter affects transparent black, it will expand its bounds to the entire screen, even if the
saveLayer
call is bounded. This applies a clip before applying the ColorFilter so the filter is bounded to just the child drawings.Also fixes bug with ColorFilter being used as an ImageFilter.
Before:

After:

Fixes flutter/flutter#88866
Fixes flutter/flutter#144015
Pre-launch Checklist
///
).If you need help, consider asking for advice on the #hackers-new channel on Discord.