-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
[Skia] Implement support for shadows that ignore transforms #25178
[Skia] Implement support for shadows that ignore transforms #25178
Conversation
EWS run on previous version of this PR (hash a63db86) |
a63db86
to
bc9d51d
Compare
EWS run on previous version of this PR (hash bc9d51d) |
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.
r=me with comments
|
||
// Ignoring the CTM is practically equal as applying the inverse of | ||
// the CTM when post-processing the drop shadow. | ||
if (const std::optional<SkMatrix>& inverse = ctm.inverse()) { |
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.
Any particular reason for converting directly to SkMatrix? IMHO AffineTransform is more readable.
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 because the methods mapHomogeneousPoints
and mapRadius
only exist in SkMatrix, unless I've missed something?
// the CTM when post-processing the drop shadow. | ||
if (const std::optional<SkMatrix>& inverse = ctm.inverse()) { | ||
SkPoint3 p = SkPoint3::Make(offset.width(), offset.height(), 0); | ||
inverse->mapHomogeneousPoints(&p, &p, 1); |
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.
Makes sense! You need to transform all lengths to be in identity space - as you intent to remove the CTM.
bc9d51d
to
e124da8
Compare
EWS run on current version of this PR (hash e124da8) |
https://bugs.webkit.org/show_bug.cgi?id=270175 Reviewed by Carlos Garcia Campos and Nikolas Zimmermann. When creating the drop shadow filter, if state.shadowsIgnoreTransforms() is true, render the drop shadow with trasformed coordinates and blur radius, by adjusting them against the CTM inverse. This is enough to make various canvas tests happy. Some of them are still failing with off-by-one colors, and it's not clear why. * Source/WebCore/platform/graphics/skia/GraphicsContextSkia.cpp: (WebCore::GraphicsContextSkia::createDropShadowFilterIfNeeded const): Canonical link: https://commits.webkit.org/275492@main
e124da8
to
caf3994
Compare
Committed 275492@main (caf3994): https://commits.webkit.org/275492@main Reviewed commits have been landed. Closing PR #25178 and removing active labels. |
caf3994
e124da8
π§ͺ wpe-wk2π§ͺ ios-wk2π§ͺ api-wpeπ§ͺ ios-wk2-wptπ§ͺ gtk-wk2π tvπ§ͺ api-gtkπ tv-simπ watchπ watch-sim