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

Unified Diff: LayoutTests/fast/canvas/canvas-drawImage-video.html

Issue 526073004: Canvas: composite video on canvas correctly. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/canvas/canvas-drawImage-video-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/canvas/canvas-drawImage-video.html
diff --git a/LayoutTests/fast/canvas/canvas-drawImage-video.html b/LayoutTests/fast/canvas/canvas-drawImage-video.html
new file mode 100644
index 0000000000000000000000000000000000000000..1647594a6a2866d908b23973e6d663fc18979f90
--- /dev/null
+++ b/LayoutTests/fast/canvas/canvas-drawImage-video.html
@@ -0,0 +1,45 @@
+<html>
+<head>
+ <title>Ensure correct behavior of drawImage video elements.</title>
+ <style trpe="text/css">
+ video {
+ display: none;
+ }
+ </style>
+</head>
+<body>
+ <canvas id="canvas"></canvas>
+ <video id="video" loop>
+ <source src="resources/canvas_video.mp4" type='video/mp4' />
+ <source src="resources/canvas_video.webm" type='video/webm' />
+ <source src="resources/canvas_video.ogv" type='video/ogg' />
+ </video>
+ <script>
+ if (window.testRunner) {
+ testRunner.dumpAsTextWithPixelResults();
+ testRunner.waitUntilDone();
+ }
+
+ var length = 150;
+ var canvas = document.getElementById("canvas");
+ canvas.setAttribute("width", length);
+ canvas.setAttribute("height", length);
+ var ctx = canvas.getContext("2d");
+
+ var video = document.getElementById("video");
+ video.addEventListener("playing", drawImageToCanvas, true);
+ video.play();
+
+ function drawImageToCanvas() {
+ video.removeEventListener("playing", drawImageToCanvas, true);
+ ctx.fillStyle = "blue";
+ ctx.fillRect(0, 0, length, length);
+ ctx.drawImage(video, 0, 0);
+ ctx.globalAlpha = 0.5;
+ ctx.drawImage(video, 0, 60);
+ if (window.testRunner)
+ testRunner.notifyDone();
+ }
+ </script>
+</body>
+</html>
« no previous file with comments | « LayoutTests/TestExpectations ('k') | LayoutTests/fast/canvas/canvas-drawImage-video-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698