4 <script src=
"../../../resources/js-test.js"></script>
5 <script src=
"resources/webgl-test.js"></script>
6 <script src=
"resources/webgl-test-utils.js"></script>
9 <canvas id=
"example" width=
"4px" height=
"4px"></canvas>
10 <div id=
"description"></div>
11 <div id=
"console"></div>
13 description('Verifies that GL texture bindings do not change when canvas is resized');
16 var wtu
= WebGLTestUtils
;
17 var canvas
= document
.getElementById("example");
18 var gl
= wtu
.create3DContext(canvas
);
19 var program
= wtu
.setupTexturedQuad(gl
);
21 var green
= [0, 255, 0, 255];
22 var blue
= [0, 0, 255, 255];
23 var tex0
= gl
.createTexture();
24 wtu
.fillTexture(gl
, tex0
, 1, 1, blue
, 0);
25 gl
.activeTexture(gl
.TEXTURE1
)
26 var tex1
= gl
.createTexture();
27 wtu
.fillTexture(gl
, tex1
, 1, 1, green
, 0);
29 var loc
= gl
.getUniformLocation(program
, "tex");
32 gl
.viewport(0, 0, canvas
.width
, canvas
.height
);
35 wtu
.checkCanvas(gl
, blue
, "should be blue");
38 wtu
.checkCanvas(gl
, green
, "should be green");
41 debug("test before resizing canvas");
43 debug("test after resizing canvas");
47 successfullyParsed
= true;