| Summary: | Move the space transform outside the Gradient class | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Said Abou-Hallawa <sabouhallawa> | ||||||||||
| Component: | Layout and Rendering | Assignee: | Said Abou-Hallawa <sabouhallawa> | ||||||||||
| Status: | RESOLVED FIXED | ||||||||||||
| Severity: | Normal | CC: | bfulgham, changseok, dino, esprehn+autocc, ews-watchlist, fmalita, glenn, gyuyoung.kim, kondapallykalyan, pdr, schenney, sergio, simon.fraser, webkit-bug-importer, zalan | ||||||||||
| Priority: | P2 | Keywords: | InRadar | ||||||||||
| Version: | WebKit Nightly Build | ||||||||||||
| Hardware: | Unspecified | ||||||||||||
| OS: | Unspecified | ||||||||||||
| Bug Depends on: | |||||||||||||
| Bug Blocks: | 219468 | ||||||||||||
| Attachments: |
|
||||||||||||
|
Description
Said Abou-Hallawa
2020-12-21 20:41:49 PST
Created attachment 416650 [details]
Patch
Created attachment 416651 [details]
Patch
Created attachment 416653 [details]
Patch
Comment on attachment 416653 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=416653&action=review > Source/WebCore/platform/graphics/Gradient.h:77 > + GradientSpreadMethod spreadMethod { GradientSpreadMethod::Pad }; I think you can keep GradientSpreadMethod as part of Gradient. All existing code sets it at the same time as the color stops. It's only gradientSpaceTransform that's change per-paint (see RenderSVGResourceGradient::applyResource()). Comment on attachment 416653 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=416653&action=review >> Source/WebCore/platform/graphics/Gradient.h:77 >> + GradientSpreadMethod spreadMethod { GradientSpreadMethod::Pad }; > > I think you can keep GradientSpreadMethod as part of Gradient. All existing code sets it at the same time as the color stops. It's only gradientSpaceTransform that's change per-paint (see RenderSVGResourceGradient::applyResource()). I looked at CanvasGradient https://developer.mozilla.org/en-US/docs/Web/API/CanvasGradient and tried to make the Gradient class store what it stores: gradient data and color stops. (In reply to Said Abou-Hallawa from comment #5) > Comment on attachment 416653 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=416653&action=review > > >> Source/WebCore/platform/graphics/Gradient.h:77 > >> + GradientSpreadMethod spreadMethod { GradientSpreadMethod::Pad }; > > > > I think you can keep GradientSpreadMethod as part of Gradient. All existing code sets it at the same time as the color stops. It's only gradientSpaceTransform that's change per-paint (see RenderSVGResourceGradient::applyResource()). > > I looked at CanvasGradient > https://developer.mozilla.org/en-US/docs/Web/API/CanvasGradient and tried to > make the Gradient class store what it stores: gradient data and color stops. Right but the spread method isn't exposed for canvas gradients. Created attachment 417509 [details]
Patch
Comment on attachment 417509 [details]
Patch
Nice!
Committed r271472: <https://trac.webkit.org/changeset/271472> All reviewed patches have been landed. Closing bug and clearing flags on attachment 417509 [details]. |