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> |