Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(10)

Unified Diff: LayoutTests/fast/canvas/canvas-drawImage-out-of-bounds-src-expected.html

Issue 19267027: Fixing src rectangle clipping with drawImage (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: retry without video Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: LayoutTests/fast/canvas/canvas-drawImage-out-of-bounds-src-expected.html
diff --git a/LayoutTests/fast/canvas/canvas-drawImage-out-of-bounds-src-expected.html b/LayoutTests/fast/canvas/canvas-drawImage-out-of-bounds-src-expected.html
new file mode 100644
index 0000000000000000000000000000000000000000..d1670f9c9a13a1eff14881edc0a56514f511e37a
--- /dev/null
+++ b/LayoutTests/fast/canvas/canvas-drawImage-out-of-bounds-src-expected.html
@@ -0,0 +1,49 @@
+<html>
+<body>
+<canvas id="c1" width="250" height="250"></canvas>
+<canvas id="c2" width="250" height="250"></canvas>
+<br>
+<canvas id="c3" width="250" height="250"></canvas>
+<canvas id="c4" width="250" height="250"></canvas>
+<script type="text/javascript">
+var ctx1 = document.getElementById('c1').getContext('2d');
+var ctx2 = document.getElementById('c2').getContext('2d');
+var ctx3 = document.getElementById('c3').getContext('2d');
+var ctx4 = document.getElementById('c4').getContext('2d');
+ctx1.fillStyle = 'green';
+ctx2.fillStyle = 'green';
+ctx3.fillStyle = 'green';
+ctx4.fillStyle = 'green';
+ctx1.fillRect(25, 25, 200, 200);
+ctx2.fillRect(25, 25, 200, 200);
+if (window.createImageBitmap) {
+ ctx4.fillRect(25, 25, 200, 200);
+}
+
+if (window.testRunner) {
+ testRunner.waitUntilDone();
+}
+var video = document.createElement("video");
+video.autoplay = false;
+video.addEventListener("canplaythrough", videoLoaded, false);
+video.src = "resources/green.ogv";
+
+function videoLoaded() {
+ var w = video.videoWidth;
+ var h = video.videoHeight;
+ ctx3.drawImage(video, 0, 0, w, h, 75, 75, 100, 100);
+ ctx3.drawImage(video, 0, 0, w, h, 25, 25, 50, 50);
+ ctx3.drawImage(video, 0, 0, w, h, 75, 25, 100, 50);
+ ctx3.drawImage(video, 0, 0, w, h, 175, 25, 50, 50);
+ ctx3.drawImage(video, 0, 0, w, h, 25, 75, 50, 100);
+ ctx3.drawImage(video, 0, 0, w, h, 175, 75, 50, 100);
+ ctx3.drawImage(video, 0, 0, w, h, 25, 175, 50, 50);
+ ctx3.drawImage(video, 0, 0, w, h, 75, 175, 100, 50);
+ ctx3.drawImage(video, 0, 0, w, h, 175, 175, 50, 50);
+ if (window.testRunner) {
+ testRunner.notifyDone();
+ }
+}
+
+</script>
+</body></html>

Powered by Google App Engine
This is Rietveld 408576698