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

Unified Diff: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-drawImage.html

Issue 2294383002: Make OffscreenCanvas a member of CanvasImageSource (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 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
Index: third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-drawImage.html
diff --git a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-drawImage.html b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-drawImage.html
index f4e1a1c045cc5a37ba8f76297e20a1b45be89635..f62058299c1f9552715021ea2ec66df53c758ad3 100644
--- a/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-drawImage.html
+++ b/third_party/WebKit/LayoutTests/fast/canvas/OffscreenCanvas-2d-drawImage.html
@@ -13,6 +13,8 @@
<canvas id="videoOutput" width="150" height="150"></canvas>
<canvas id="imageOutput" width="150" height="150"></canvas>
<canvas id="canvasOutput" width="150" height="150"></canvas>
+<canvas id="offscreenCanvas2DOutput" width="150" height="150"></canvas>
+<canvas id="offscreenCanvasWebGLOutput" width="150" height="150"></canvas>
<script>
function drawImageSourceToOffscreenCanvas(imageSource, outputCanvas) {
@@ -59,6 +61,22 @@ htmlCanvasCtx.fillStyle = "red";
htmlCanvasCtx.fillRect(15, 0, 30, 30);
drawImageSourceToOffscreenCanvas(htmlCanvas, document.getElementById('canvasOutput'));
+// image source as OffscreenCanvas with 2D context
+var offscreenCanvas2D = new OffscreenCanvas(30, 30);
+var offscreenCanvas2DCtx = offscreenCanvas2D.getContext("2d");
+offscreenCanvas2DCtx.fillStyle = "blue";
+offscreenCanvas2DCtx.fillRect(0, 0, 15, 30);
+offscreenCanvas2DCtx.fillStyle = "red";
+offscreenCanvas2DCtx.fillRect(15, 0, 30, 30);
+drawImageSourceToOffscreenCanvas(offscreenCanvas2D, document.getElementById('offscreenCanvas2DOutput'));
+
+// Image source as OffscreenCanvas with webGL context
+var offscreenCanvasWebGL = new OffscreenCanvas(30, 30);
+var gl = offscreenCanvasWebGL.getContext("webgl");
+gl.clearColor(0.0, 0.0, 1.0, 1.0);
+gl.clear(gl.COLOR_BUFFER_BIT);
+drawImageSourceToOffscreenCanvas(offscreenCanvasWebGL, document.getElementById('offscreenCanvasWebGLOutput'));
+
</script>
</body>

Powered by Google App Engine
This is Rietveld 408576698