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>Check that the canvas is NOT recomposited after calling readPixels
</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 border:
1px solid black;
20 border:
1px solid black;
21 background-color: #
00ff00;
27 This test must be run manually.
29 This test tests that a canvas is NOT cleared
30 and recomposited after calling readPixels.
32 You should see a
<span class=
"correct">green rectangle
</span>
33 with black a outline on success.
35 <canvas id='c'
></canvas>
36 <div id=
"console"></div>
39 var wtu
= WebGLTestUtils
;
40 var c
= document
.getElementById("c");
41 var gl
= wtu
.create3DContext(c
);
42 gl
.clearColor(0,1,0,1);
43 gl
.clear(gl
.COLOR_BUFFER_BIT
);
44 wtu
.waitForComposite(function() {
45 gl
.readPixels(0, 0, 1, 1, gl
.RGBA
, gl
.UNSIGNED_BYTE
, new Uint8Array(4));
46 wtu
.glErrorShouldBe(gl
, gl
.NO_ERROR
, "no errors");