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

Unified Diff: LayoutTests/fast/canvas/webgl/resources/draw-webgl-to-canvas-2d.js

Issue 750273003: canvas: calling toDataURL without context doesn't create a buffer of canvas 2d. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: fix typo Created 6 years, 1 month 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/webgl/resources/draw-webgl-to-canvas-2d.js
diff --git a/LayoutTests/fast/canvas/webgl/draw-webgl-to-canvas-2d.html b/LayoutTests/fast/canvas/webgl/resources/draw-webgl-to-canvas-2d.js
similarity index 54%
copy from LayoutTests/fast/canvas/webgl/draw-webgl-to-canvas-2d.html
copy to LayoutTests/fast/canvas/webgl/resources/draw-webgl-to-canvas-2d.js
index 72aa06fedf1cf7e3cd2ad576f9e8545abba09c93..8cdc0fed98912b1e981c4b2584f7ed6a9a2becf6 100644
--- a/LayoutTests/fast/canvas/webgl/draw-webgl-to-canvas-2d.html
+++ b/LayoutTests/fast/canvas/webgl/resources/draw-webgl-to-canvas-2d.js
@@ -1,33 +1,3 @@
-<!DOCTYPE html>
-<html>
-<body>
-<span id="description" style="color: white">
-This test checks for drawing webgl to canvas 2d. The test process is as follows:
-1. draw a green rect on a webgl context.
-2. draw a red rect on a canvas 2d context, and check a pixel (should be red).
-3. draw the webgl contents on the canvas 2d context, and check a pixel (should be green).
-4. wait for few frames.
-5. draw a red rect on the canvas 2d context, and check a pixel (should be red).
-6. draw the webgl contents on the canvas 2d context, and check a pixel (see below explanation).
-
-Above test is executed for both preserve and non-preserve webgl contexts.
-For the preserve webgl context, the pixel on #6 is green.
-For the non-preserve webgl context, the pixel on #6 is undefined.[1]
-
-[1] http://www.khronos.org/registry/webgl/specs/latest/1.0/.
-"This default behavior can be changed by setting the preserveDrawingBuffer
-attribute of the WebGLContextAttributes object. If this flag is true, the
-contents of the drawing buffer shall be preserved until the author either clears
-or overwrites them. If this flag is false, attempting to perform operations
-using this context as a source image after the rendering function has returned
-can lead to undefined behavior.".
-</span>
-<canvas id="preserve-canvas3d" width="100" height="100"></canvas>
-<canvas id="preserve-canvas2d" width="100" height="100"></canvas>
-<canvas id="nonpreserve-canvas3d" width="100" height="100"></canvas>
-<canvas id="nonpreserve-canvas2d" width="100" height="100"></canvas>
-<script src="../../../resources/js-test.js"></script>
-<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
@@ -41,15 +11,6 @@ var nonpreserve_canvas3D;
var nonpreserve_gl;
var imgdata;
-function createContexts() {
- preserve_ctx2D = document.getElementById("preserve-canvas2d").getContext("2d");
- preserve_canvas3D = document.getElementById('preserve-canvas3d');
- preserve_gl = preserve_canvas3D.getContext('webgl', {'preserveDrawingBuffer': true});
- nonpreserve_ctx2D = document.getElementById("nonpreserve-canvas2d").getContext("2d");
- nonpreserve_canvas3D = document.getElementById('nonpreserve-canvas3d');
- nonpreserve_gl = nonpreserve_canvas3D.getContext('webgl', {'preserveDrawingBuffer': false});
-}
-
function renderWebGL(gl) {
gl.clearColor(0, 1, 0, 1);
gl.clear(gl.COLOR_BUFFER_BIT);
@@ -118,7 +79,3 @@ function startTestAfterFirstPaint() {
window.onload = function () {
window.requestAnimationFrame(startTestAfterFirstPaint);
}
-
-</script>
-</body>
-</html>

Powered by Google App Engine
This is Rietveld 408576698