2 <html class=
"reftest-wait">
6 <script type=
"text/javascript" src=
"webgl-utils.js"></script>
7 <script type=
"text/javascript">
8 /* Hanging Scissor Test
10 * Clear the canvas to green, but create and enable and set scissor values
11 * before returning. This can fail if we blindly blit or read from the screen
12 * without disabling scissor-test.
14 * Failure should look like only the top-left quadrant is rendered.
19 function renderGL(gl
) {
20 gl
.clearColor(0.0, 1.0, 0.0, 1.0);
21 gl
.clear(gl
.COLOR_BUFFER_BIT
);
23 gl
.enable(gl
.SCISSOR_TEST
);
24 gl
.scissor(0, 128, 128, 128);
29 function renderFailure(canvas
) {
30 // This will also trigger RAF for us.
31 var context
= canvas
.getContext("2d");
32 context
.fillText('WebGL failed.', 64, 64);
36 var canvas
= document
.getElementById("canvas");
37 var gl
= initGL(canvas
);
42 renderFailure(canvas
);
44 waitForComposite(testComplete
);
47 function testComplete() {
48 document
.documentElement
.removeAttribute("class");
53 <body onload=
"rAF(runTest);">
54 <canvas id=
"canvas" width=
"256" height=
"256"></canvas>