summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/canvas
diff options
context:
space:
mode:
authorajuma <ajuma@chromium.org>2016-01-18 12:39:02 -0800
committerCommit bot <commit-bot@chromium.org>2016-01-18 20:40:00 +0000
commitd69e12d35e3b986fe0ba40e04368f85cda57b99c (patch)
tree1dbbc212a63088b83d793aecd8eb742d2fde0329 /third_party/WebKit/LayoutTests/fast/canvas
parent8cd953cb73b418e3fc924a92b298abe82fa298f6 (diff)
downloadchromium_src-d69e12d35e3b986fe0ba40e04368f85cda57b99c.zip
chromium_src-d69e12d35e3b986fe0ba40e04368f85cda57b99c.tar.gz
chromium_src-d69e12d35e3b986fe0ba40e04368f85cda57b99c.tar.bz2
Use an up-to-date canvas size when building canvas filters
When canvas filters specify a filter primitive subregion (e.g. by specifying a width or height), filter building depends on having an up to date canvas size; otherwise, the crop rect computed for the filter is incorrect. This CL directly passes the canvas size to filter building code, rather than having the filter builder use a size from the layout tree, since the latter might be stale. BUG=561045 Review URL: https://codereview.chromium.org/1583103007 Cr-Commit-Position: refs/heads/master@{#370047}
Diffstat (limited to 'third_party/WebKit/LayoutTests/fast/canvas')
-rw-r--r--third_party/WebKit/LayoutTests/fast/canvas/canvas-filter-width-height-expected.html7
-rw-r--r--third_party/WebKit/LayoutTests/fast/canvas/canvas-filter-width-height.html17
2 files changed, 24 insertions, 0 deletions
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-filter-width-height-expected.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-filter-width-height-expected.html
new file mode 100644
index 0000000..0e23e3f
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-filter-width-height-expected.html
@@ -0,0 +1,7 @@
+<canvas id="canvas" width="100" height="100"></canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var ctx = canvas.getContext('2d');
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 50, 40);
+</script>
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/canvas-filter-width-height.html b/third_party/WebKit/LayoutTests/fast/canvas/canvas-filter-width-height.html
new file mode 100644
index 0000000..1185895
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/canvas/canvas-filter-width-height.html
@@ -0,0 +1,17 @@
+<svg style="display: block; width: 0; height: 0">
+ <defs>
+ <filter id="crop" primitiveUnits="objectBoundingBox">
+ <femerge x="0" y="0" width="50%" height="40%">
+ <femergenode in="SourceGraphic"></femergenode>
+ </femerge>
+ </filter>
+ </defs>
+</svg>
+<canvas id="canvas" width="100" height="100"></canvas>
+<script>
+var canvas = document.getElementById('canvas');
+var ctx = canvas.getContext('2d');
+ctx.filter = 'url(#crop)';
+ctx.fillStyle = '#0f0';
+ctx.fillRect(0, 0, 90, 90);
+</script>