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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/webgl/canvas-2d-webgl-texture.html

Issue 2447493002: Removed some duplicate layout tests under fast/canvas/webgl (Closed)
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
(Empty)
1 <html>
2 <head>
3 <script src="../../../resources/js-test.js"></script>
4 <script src="resources/webgl-test.js"></script>
5 <script src="resources/webgl-test-utils.js"> </script>
6 </head>
7 <script>
8 description("Checks that copying canvas results to a WebGL texture functions wit hout error.");
9
10 var wtu = WebGLTestUtils;
11
12 if (window.testRunner) {
13 testRunner.dumpAsText();
14 testRunner.waitUntilDone();
15 }
16
17 var canvas;
18 var gl;
19 var ctx;
20
21 function draw()
22 {
23 ctx.fillStyle = "rgb(200, 0, 0)";
24 ctx.fillRect(0, 0, 256, 256);
25 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas2d);
26
27 wtu.drawQuad(gl);
28 wtu.checkCanvasRect(gl, 0, 0, 1, 1, [200, 0, 0, 255], "Should have rendered re d.", 1);
29
30 ctx.fillStyle = "rgb(0, 0, 200)";
31 ctx.fillRect(0, 0, 256, 256);
32 gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas2d);
33 ctx.fillStyle = "rgb(200, 0, 0)";
34 ctx.fillRect(0, 0, 256, 256);
35
36 wtu.drawQuad(gl);
37 wtu.checkCanvasRect(gl, 0, 0, 1, 1, [0, 0, 200, 255], "Should have rendered bl ue.", 1);
38
39 if (window.testRunner)
40 testRunner.notifyDone();
41 }
42
43 window.onload = function()
44 {
45 if (window.initNonKhronosFramework)
46 window.initNonKhronosFramework(false);
47
48 canvas = document.getElementById("webgl-canvas");
49 gl = create3DContext(canvas);
50
51 canvas2d = document.getElementById("canvas-2d");
52
53 // Set a size that ensures a hardware-accelerated canvas.
54 canvas2d.width = 256;
55 canvas2d.height = 256;
56 ctx = canvas2d.getContext("2d");
57
58 var program = wtu.setupTexturedQuad(gl);
59 var bufferObjects = wtu.setupUnitQuad(gl);
60
61 var texture = gl.createTexture();
62 gl.bindTexture(gl.TEXTURE_2D, texture);
63 gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR);
64
65 gl.uniform1i(gl.getUniformLocation(program, "tex"), 0);
66 gl.viewport(0, 0, canvas.width, canvas.height);
67
68 // Ensure that the compositor has become active.
69 setTimeout(draw, 0);
70 }
71 </script>
72 <body>
73 <div id="description"></div>
74 <div id="console"></div>
75 <canvas id="webgl-canvas" width="32px" height="32px"></canvas>
76 <canvas id="canvas-2d" style="transform: translateZ(0);"></canvas>
77 </body>
78 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698