2 Copyright (c) 2019 The Khronos Group Inc.
3 Use of this source code is governed by an MIT-style license that can be
4 found in the LICENSE.txt file.
10 <meta charset=
"utf-8">
11 <title>Scissor Rectangle Repeated Rendering Test
</title>
12 <link rel=
"stylesheet" href=
"../../resources/js-test-style.css"/>
13 <script src=
"../../js/js-test-pre.js"></script>
14 <script src=
"../../js/webgl-test-utils.js"> </script>
17 <canvas id=
"example" width=
"128" height=
"128"></canvas>
18 <div id=
"description"></div>
19 <div id=
"console"></div>
24 debug('Regression test for <a href="https://code.google.com/p/chromium/issues/detail?id=778770">Chromium bug 778770</a>');
26 var wtu
= WebGLTestUtils
;
28 // These context creation attributes are significant to reproduce the bug.
29 var gl
= wtu
.create3DContext("example", {alpha
: false, antialias
: false});
31 // Draw into the upper right quadrant.
40 gl
.viewport(x
, y
, width
, height
);
41 gl
.scissor(x
, y
, width
, height
);
42 gl
.enable(gl
.SCISSOR_TEST
);
43 gl
.clearColor(0.0, 1.0, 0.0, 1.0);
44 gl
.clear(gl
.COLOR_BUFFER_BIT
);
46 // If anything but black is ever seen in the un-drawn region of
47 // the canvas, the test fails.
48 var black
= [0, 0, 0, 255];
49 wtu
.checkCanvasRect(gl
, 10, 10, 10, 10, black
, "should be black", 1);
51 if (--numRenders
> 0) {
52 window
.requestAnimationFrame(render
);
58 window
.requestAnimationFrame(render
);
60 var successfullyParsed
= true;