Add support for CanvasPattern.setTransform()
authorsimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Nov 2017 21:33:44 +0000 (21:33 +0000)
committersimon.fraser@apple.com <simon.fraser@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 23 Nov 2017 21:33:44 +0000 (21:33 +0000)
commitdfcdacafa186d4fa97a558e3601a7d9d0f6a00a3
tree08aa92a597ee06e6fb01a7dd78becd44869b5084
parent6bd3a40f258eb35c8d5bcde5212fda26403b2673
Add support for CanvasPattern.setTransform()
https://bugs.webkit.org/show_bug.cgi?id=179935

Reviewed by Sam Weinig.

Source/WebCore:

Add support for setTransform() on CanvasPattern, per
<https://html.spec.whatwg.org/multipage/canvas.html#dom-canvaspattern-settransform>
It uses [MayThrowException] since the "validate and fixup" steps for DOMMatrix can throw
an exception.

Under the hood, the transform is just pushed onto Pattern as the patternSpaceTransform().

Minor cleanup in Pattern.

Test: fast/canvas/canvas-pattern-with-transform.html

* html/canvas/CanvasPattern.cpp:
(WebCore::CanvasPattern::setTransform):
* html/canvas/CanvasPattern.h:
* html/canvas/CanvasPattern.idl:
* platform/graphics/Pattern.h:

LayoutTests:

Moved the test previously known as canvas-pattern-transform.html to canvas-pattern-with-transform.html
and added a new test.

* fast/canvas/canvas-pattern-transform-expected.txt:
* fast/canvas/canvas-pattern-transform.html:
* fast/canvas/canvas-pattern-with-transform-expected.txt: Copied from LayoutTests/fast/canvas/canvas-pattern-transform-expected.txt.
* fast/canvas/canvas-pattern-with-transform.html: Copied from LayoutTests/fast/canvas/canvas-pattern-transform.html.
* fast/canvas/canvas-pattern-with-transform.js: Renamed from LayoutTests/fast/canvas/canvas-pattern-transform.js.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@225121 268f45cc-cd09-0410-ab3c-d52691b4dbfc
12 files changed:
LayoutTests/ChangeLog
LayoutTests/fast/canvas/canvas-pattern-transform-expected.txt
LayoutTests/fast/canvas/canvas-pattern-transform.html
LayoutTests/fast/canvas/canvas-pattern-with-transform-expected.txt [new file with mode: 0644]
LayoutTests/fast/canvas/canvas-pattern-with-transform.html [new file with mode: 0644]
LayoutTests/fast/canvas/canvas-pattern-with-transform.js [moved from LayoutTests/fast/canvas/canvas-pattern-transform.js with 100% similarity]
Source/WebCore/ChangeLog
Source/WebCore/html/canvas/CanvasPattern.cpp
Source/WebCore/html/canvas/CanvasPattern.h
Source/WebCore/html/canvas/CanvasPattern.idl
Source/WebCore/platform/graphics/Pattern.h
Source/WebCore/platform/graphics/cairo/PlatformContextCairo.cpp