OLD | NEW |
| (Empty) |
1 description("Test of texImage2d and texSubImage2d"); | |
2 | |
3 if (window.internals) | |
4 window.internals.settings.setWebGLErrorsToConsoleEnabled(false); | |
5 | |
6 var context = create3DContext(); | |
7 var image = document.createElement("img"); | |
8 var video = document.createElement("video"); | |
9 var canvas2d = document.createElement("canvas"); | |
10 var context2d = canvas2d.getContext("2d"); | |
11 var imageData = context2d.createImageData(64, 64); | |
12 var array = new Uint8Array([ 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255, 25
5, 0, 0, 0, 255 ]); | |
13 | |
14 shouldThrow("context.texImage2D(context.TEXTURE_2D)"); | |
15 shouldBeUndefined("context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 64, 6
4, 0, context.RGBA, context.UNSIGNED_BYTE, null)"); | |
16 shouldThrow("context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 0, context.
RGBA, context.UNSIGNED_BYTE, 0)"); | |
17 shouldThrow("context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 0, context.
RGBA, context.UNSIGNED_BYTE, 0, 0)"); | |
18 shouldBeUndefined("context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, 2, 2,
0, context.RGBA, context.UNSIGNED_BYTE, array)"); | |
19 shouldBeUndefined("context.pixelStorei(context.UNPACK_FLIP_Y_WEBGL, true)"); | |
20 shouldBeUndefined("context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, conte
xt.RGBA, context.UNSIGNED_BYTE, imageData)"); | |
21 shouldBeUndefined("context.pixelStorei(context.UNPACK_FLIP_Y_WEBGL, false)"); | |
22 shouldBeUndefined("context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, conte
xt.RGBA, context.UNSIGNED_BYTE, image)"); | |
23 shouldBeUndefined("context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, conte
xt.RGBA, context.UNSIGNED_BYTE, canvas2d)"); | |
24 shouldBeUndefined("context.pixelStorei(context.UNPACK_FLIP_Y_WEBGL, true)"); | |
25 shouldBeUndefined("context.texImage2D(context.TEXTURE_2D, 0, context.RGBA, conte
xt.RGBA, context.UNSIGNED_BYTE, video)"); | |
26 | |
27 shouldThrow("context.texSubImage2D(context.TEXTURE_2D)"); | |
28 shouldBeUndefined("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, co
ntext.RGBA, context.UNSIGNED_BYTE, null)"); | |
29 shouldThrow("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, 0, context.
RGBA, context.UNSIGNED_BYTE, 0)"); | |
30 shouldThrow("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, 0, context.UNS
IGNED_BYTE, 0)"); | |
31 shouldBeUndefined("context.pixelStorei(context.UNPACK_FLIP_Y_WEBGL, false)"); | |
32 shouldBeUndefined("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, context.
RGBA, context.UNSIGNED_BYTE, imageData)"); | |
33 shouldBeUndefined("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, context.
RGBA, context.UNSIGNED_BYTE, image)"); | |
34 shouldBeUndefined("context.pixelStorei(context.UNPACK_FLIP_Y_WEBGL, true)"); | |
35 shouldBeUndefined("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, context.
RGBA, context.UNSIGNED_BYTE, canvas2d)"); | |
36 shouldBeUndefined("context.pixelStorei(context.UNPACK_FLIP_Y_WEBGL, false)"); | |
37 shouldBeUndefined("context.pixelStorei(context.UNPACK_PREMULTIPLY_ALPHA_WEBGL, t
rue)"); | |
38 shouldBeUndefined("context.texSubImage2D(context.TEXTURE_2D, 0, 10, 20, context.
RGBA, context.UNSIGNED_BYTE, video)"); | |
OLD | NEW |