| Summary: | Add support for premultiplied alpha interpolated gradients and defaulted off option to use them for CSS Gradients | ||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Sam Weinig <sam> | ||||||||||||||||||||||||||||||
| Component: | New Bugs | Assignee: | Sam Weinig <sam> | ||||||||||||||||||||||||||||||
| Status: | RESOLVED FIXED | ||||||||||||||||||||||||||||||||
| Severity: | Normal | CC: | annulen, bramus, esprehn+autocc, ews-watchlist, glenn, gyuyoung.kim, macpherson, menard, mitz, ryuan.choi, sergio, simon.fraser, tmjenox, webkit-bug-importer | ||||||||||||||||||||||||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||||||||||||||||||||||||
| Version: | WebKit Nightly Build | ||||||||||||||||||||||||||||||||
| Hardware: | Unspecified | ||||||||||||||||||||||||||||||||
| OS: | Unspecified | ||||||||||||||||||||||||||||||||
| Bug Depends on: | |||||||||||||||||||||||||||||||||
| Bug Blocks: | 150940 | ||||||||||||||||||||||||||||||||
| Attachments: |
|
||||||||||||||||||||||||||||||||
|
Description
Sam Weinig
2021-12-19 13:14:34 PST
Created attachment 447558 [details]
For the bots
Created attachment 447559 [details]
Patch
Created attachment 447565 [details]
Patch
Created attachment 447567 [details]
Patch
Created attachment 447568 [details]
Patch
Created attachment 447569 [details]
Patch
Created attachment 447579 [details]
Patch
Created attachment 447580 [details]
Patch
Created attachment 447582 [details]
Patch
Created attachment 447614 [details]
Patch
Created attachment 447654 [details]
Patch
Comment on attachment 447654 [details]
Patch
Still need to figure out what to do about the GTK port, since it doesn't look like Cairo has premultiplied alpha support, but this is good to review now.
Comment on attachment 447654 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=447654&action=review > Source/WTF/Scripts/Preferences/WebPreferencesExperimental.yaml:287 > +CSSGradientAlphaPremultipliedInterpolationEnabled: 287CSSGradientAlphaPremultipliedInterpolationEnabled -> 287CSSGradientPremultipliedAlphaInterpolationEnabled ? > Source/WebCore/platform/graphics/cg/GradientCGStrategy.h:82 > + using Strategy = std::variant<Gradient, Shading>; I don't like the naming here. To me, a "strategy" sounds like an enum value describing which implementation to use. I was confused that pickStrategy(), makeGradient() and makeShading() all return something called a "Strategy". std::variant<Gradient, Shading> is more like "GradientRenderer" or something. Created attachment 447668 [details]
Patch
Created attachment 447685 [details]
Patch
Created attachment 447686 [details]
Patch
Committed r287310 (245462@main): <https://commits.webkit.org/245462@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 447686 [details]. Comment on attachment 447686 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=447686&action=review > Source/WebCore/platform/graphics/cg/GradientRendererCG.cpp:53 > + // FIXME: Use gradient strategy if none of the stops have alpha. For performance, it may be useful to do this also whenever the only stops with non-1 alpha have 0 alpha, by adjusting and, if necessary, repeating the transparent stop. There are likely other cases (likely the most common cases) that can be optimized this way. *** Bug 150940 has been marked as a duplicate of this bug. *** |