Add support for spreadMethod=reflect and repeat on SVG gradients (for CoreGraphics...
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Sep 2018 23:55:37 +0000 (23:55 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 14 Sep 2018 23:55:37 +0000 (23:55 +0000)
commit82bf37b26ef6892b9eb31531414d1f5b6561d8d3
tree2ce52b7a90b3a395b19b26e27c809f7a0379ed48
parent339d7e8d7bbf42e694a1e007c4c57315e95613dd
Add support for spreadMethod=reflect and repeat on SVG gradients (for CoreGraphics platforms)
https://bugs.webkit.org/show_bug.cgi?id=5968

Source/WebCore:

Add support for spreadMethod=repeat and reflect. Also, the opacity of a gradient is now
the result of multiplying stop-opacity with the opacity of the color.

Patch by Justin Michaud <justin_michaud@apple.com> on 2018-09-14
Reviewed by Simon Fraser.

Tests: svg/gradients/spreadMethod-expected.svg
       svg/gradients/spreadMethod.svg
       svg/gradients/spreadMethodAlpha-expected.svg
       svg/gradients/spreadMethodAlpha.svg
       svg/gradients/spreadMethodClose0-expected-mismatch.svg
       svg/gradients/spreadMethodClose0.svg
       svg/gradients/spreadMethodClose1-expected-mismatch.svg
       svg/gradients/spreadMethodClose1.svg
       svg/gradients/spreadMethodClose2-expected.svg
       svg/gradients/spreadMethodClose2.svg
       svg/gradients/spreadMethodDiagonal-expected.svg
       svg/gradients/spreadMethodDiagonal.svg
       svg/gradients/spreadMethodDiagonal2-expected.svg
       svg/gradients/spreadMethodDiagonal2.svg
       svg/gradients/spreadMethodDuplicateStop-expected.svg
       svg/gradients/spreadMethodDuplicateStop.svg
       svg/gradients/spreadMethodReversed-expected.svg
       svg/gradients/spreadMethodReversed.svg
       svg/gradients/stopAlpha-expected.svg
       svg/gradients/stopAlpha.svg

* platform/graphics/cg/GradientCG.cpp:
(WebCore::Gradient::paint):
* svg/SVGStopElement.cpp:
(WebCore::SVGStopElement::stopColorIncludingOpacity const):

LayoutTests:

Add new svg tests for linear gradients with spreadMethod, and alpha values specified in
both stop-opacity and color.

Patch by Justin Michaud <justin_michaud@apple.com> on 2018-09-14
Reviewed by Simon Fraser.

* platform/mac/svg/W3C-SVG-1.1/pservers-grad-10-b-expected.png:
* svg/gradients/spreadMethod-expected.svg: Added.
* svg/gradients/spreadMethod.svg: Added.
* svg/gradients/spreadMethodAlpha-expected.svg: Added.
* svg/gradients/spreadMethodAlpha.svg: Added.
* svg/gradients/spreadMethodClose0-expected-mismatch.svg: Added.
* svg/gradients/spreadMethodClose0.svg: Added.
* svg/gradients/spreadMethodClose1-expected-mismatch.svg: Added.
* svg/gradients/spreadMethodClose1.svg: Added.
* svg/gradients/spreadMethodClose2-expected.svg: Added.
* svg/gradients/spreadMethodClose2.svg: Added.
* svg/gradients/spreadMethodDiagonal-expected.svg: Added.
* svg/gradients/spreadMethodDiagonal.svg: Added.
* svg/gradients/spreadMethodDiagonal2-expected.svg: Added.
* svg/gradients/spreadMethodDiagonal2.svg: Added.
* svg/gradients/spreadMethodDuplicateStop-expected.svg: Added.
* svg/gradients/spreadMethodDuplicateStop.svg: Added.
* svg/gradients/spreadMethodReversed-expected.svg: Added.
* svg/gradients/spreadMethodReversed.svg: Added.
* svg/gradients/stopAlpha-expected.svg: Added.
* svg/gradients/stopAlpha.svg: Added.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@236024 268f45cc-cd09-0410-ab3c-d52691b4dbfc
29 files changed:
LayoutTests/ChangeLog
LayoutTests/platform/mac/svg/W3C-SVG-1.1/pservers-grad-10-b-expected.png
LayoutTests/svg/gradients/spreadMethod-expected.svg [new file with mode: 0644]
LayoutTests/svg/gradients/spreadMethod.svg [new file with mode: 0644]
LayoutTests/svg/gradients/spreadMethodAlpha-expected.svg [new file with mode: 0644]
LayoutTests/svg/gradients/spreadMethodAlpha.svg [new file with mode: 0644]
LayoutTests/svg/gradients/spreadMethodClose0-expected-mismatch.svg [new file with mode: 0644]
LayoutTests/svg/gradients/spreadMethodClose0.svg [new file with mode: 0644]
LayoutTests/svg/gradients/spreadMethodClose1-expected-mismatch.svg [new file with mode: 0644]
LayoutTests/svg/gradients/spreadMethodClose1.svg [new file with mode: 0644]
LayoutTests/svg/gradients/spreadMethodClose2-expected.svg [new file with mode: 0644]
LayoutTests/svg/gradients/spreadMethodClose2.svg [new file with mode: 0644]
LayoutTests/svg/gradients/spreadMethodDiagonal-expected.svg [new file with mode: 0644]
LayoutTests/svg/gradients/spreadMethodDiagonal.svg [new file with mode: 0644]
LayoutTests/svg/gradients/spreadMethodDiagonal2-expected.svg [new file with mode: 0644]
LayoutTests/svg/gradients/spreadMethodDiagonal2.svg [new file with mode: 0644]
LayoutTests/svg/gradients/spreadMethodDiagonal3-expected.svg [new file with mode: 0644]
LayoutTests/svg/gradients/spreadMethodDiagonal3.svg [new file with mode: 0644]
LayoutTests/svg/gradients/spreadMethodDiagonal4-expected.svg [new file with mode: 0644]
LayoutTests/svg/gradients/spreadMethodDiagonal4.svg [new file with mode: 0644]
LayoutTests/svg/gradients/spreadMethodDuplicateStop-expected.svg [new file with mode: 0644]
LayoutTests/svg/gradients/spreadMethodDuplicateStop.svg [new file with mode: 0644]
LayoutTests/svg/gradients/spreadMethodReversed-expected.svg [new file with mode: 0644]
LayoutTests/svg/gradients/spreadMethodReversed.svg [new file with mode: 0644]
LayoutTests/svg/gradients/stopAlpha-expected.svg [new file with mode: 0644]
LayoutTests/svg/gradients/stopAlpha.svg [new file with mode: 0644]
Source/WebCore/ChangeLog
Source/WebCore/platform/graphics/cg/GradientCG.cpp
Source/WebCore/svg/SVGStopElement.cpp