forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Explicit check for degenerate SVG radial gradients
Both Canvas2D and SVG expect degenerate radial gradients (p0 == p1 && r0 == r1) to not draw anything [1]. Canvas2D enforces this behavior explicitly, but SVG relies on the current Skia semantics. Skia is about to start handling this case differently [2]. This CL updates LayoutSVGResourceRadialGradient to also enforce the spec behavior explicitly: * add a DegenerateHandling flag to Gradient (all subtypes) to control degenerate behavior * when degenerates are not allowed, return an SkEmptyShader to draw nothing * in order to support the above, plumb SkEmptyShader in PaintShader * update clients to pass this new flag as required by spec * clean up degenerate tracking in CanvasGradient/BaseRenderingContext2D (no longer needed) * also drop the bool return type for BaseRenderingContext2D::Draw (not used) [1] https://html.spec.whatwg.org/multipage/canvas.html#dom-context-2d-createradialgradient [2] https://skia-review.googlesource.com/c/skia/+/168487 Change-Id: I940fcfd87907ebd2df9fae59102770a6031606e5 Reviewed-on: https://chromium-review.googlesource.com/c/1324612 Reviewed-by: Fernando Serboncini <fserb@chromium.org> Reviewed-by: Khushal <khushalsagar@chromium.org> Reviewed-by: Fredrik Söderquist <fs@opera.com> Commit-Queue: Florin Malita <fmalita@chromium.org> Cr-Commit-Position: refs/heads/master@{#606553}
- Loading branch information
Showing
10 changed files
with
105 additions
and
39 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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