From 0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:47:29 +0200 Subject: Adding upstream version 115.8.0esr. Signed-off-by: Daniel Baumann --- .../extra/50x50pixel-black-with-red-triangle.png | Bin 0 -> 3032 bytes .../checkout/extra/big-fbos-example.html | 256 +++++++ .../checkout/extra/buffer-gc-stress.html | 155 ++++ .../webgl-conf/checkout/extra/buffer-sizes.html | 268 +++++++ .../checkout/extra/canvas-compositing-test.html | 88 +++ .../checkout/extra/canvas-compositing-test.png | Bin 0 -> 212531 bytes .../extra/constant-index-out-of-range.html | 219 ++++++ .../context-creation-and-destruction-stress.html | 35 + .../extra/cube-map-uploads-out-of-order.html | 91 +++ .../checkout/extra/fbo-lost-context.html | 202 +++++ .../getbuffersubdata-nonblocking-benchmark.html | 223 ++++++ .../webgl-conf/checkout/extra/logo-256x256.png | Bin 0 -> 4155 bytes .../checkout/extra/lots-of-polys-example.html | 89 +++ .../extra/lots-of-polys-shader-example.html | 155 ++++ .../extra/multisample-corruption-stress.html | 37 + .../webgl-conf/checkout/extra/offscreen-issue.html | 43 ++ .../extra/out-of-bounds-uniform-array-access.html | 105 +++ .../webgl-conf/checkout/extra/out-of-memory.html | 84 ++ .../checkout/extra/out-of-resources.html | 120 +++ .../webgl-conf/checkout/extra/out-of-vram.html | 114 +++ .../checkout/extra/point-no-attributes-stress.html | 61 ++ .../webgl-conf/checkout/extra/program-test-1.html | 80 ++ .../checkout/extra/readpixels-after-alert.html | 65 ++ .../test/webgl-conf/checkout/extra/sample-100.png | Bin 0 -> 960 bytes .../test/webgl-conf/checkout/extra/sample-200.png | Bin 0 -> 2364 bytes .../test/webgl-conf/checkout/extra/sample-400.png | Bin 0 -> 5181 bytes .../test/webgl-conf/checkout/extra/sample.svg | 4 + .../extra/simulated-attrib-0-bug-test.html | 36 + .../checkout/extra/slow-shader-example.html | 112 +++ .../checkout/extra/tex-image-with-video-test.html | 27 + .../checkout/extra/tex-image-with-video-test.js | 158 ++++ .../extra/texture-allocation-stress-test.html | 47 ++ .../checkout/extra/texture-from-camera-stress.html | 79 ++ .../webgl-conf/checkout/extra/texture-sizing.html | 229 ++++++ ...webgl-compressed-texture-size-limit-stress.html | 33 + .../extra/webgl-drawelements-validation.html | 142 ++++ .../test/webgl-conf/checkout/extra/webgl-info.html | 275 +++++++ .../checkout/extra/webgl-translate-shader.html | 153 ++++ .../checkout/extra/workload-simulator.html | 851 +++++++++++++++++++++ 39 files changed, 4636 insertions(+) create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/50x50pixel-black-with-red-triangle.png create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/big-fbos-example.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/buffer-gc-stress.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/buffer-sizes.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/canvas-compositing-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/canvas-compositing-test.png create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/constant-index-out-of-range.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/context-creation-and-destruction-stress.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/cube-map-uploads-out-of-order.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/fbo-lost-context.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/getbuffersubdata-nonblocking-benchmark.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/logo-256x256.png create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/lots-of-polys-example.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/lots-of-polys-shader-example.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/multisample-corruption-stress.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/offscreen-issue.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/out-of-bounds-uniform-array-access.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/out-of-memory.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/out-of-resources.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/out-of-vram.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/point-no-attributes-stress.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/program-test-1.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/readpixels-after-alert.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/sample-100.png create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/sample-200.png create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/sample-400.png create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/sample.svg create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/simulated-attrib-0-bug-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/slow-shader-example.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/tex-image-with-video-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/tex-image-with-video-test.js create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/texture-allocation-stress-test.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/texture-from-camera-stress.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/texture-sizing.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/webgl-compressed-texture-size-limit-stress.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/webgl-drawelements-validation.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/webgl-info.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/webgl-translate-shader.html create mode 100644 dom/canvas/test/webgl-conf/checkout/extra/workload-simulator.html (limited to 'dom/canvas/test/webgl-conf/checkout/extra') diff --git a/dom/canvas/test/webgl-conf/checkout/extra/50x50pixel-black-with-red-triangle.png b/dom/canvas/test/webgl-conf/checkout/extra/50x50pixel-black-with-red-triangle.png new file mode 100644 index 0000000000..4ec9751070 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/extra/50x50pixel-black-with-red-triangle.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/extra/big-fbos-example.html b/dom/canvas/test/webgl-conf/checkout/extra/big-fbos-example.html new file mode 100644 index 0000000000..0e0a09bcef --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/big-fbos-example.html @@ -0,0 +1,256 @@ + + + + + + +WebGL Big FBO Test + + + + + + + +
+
+ + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/buffer-gc-stress.html b/dom/canvas/test/webgl-conf/checkout/extra/buffer-gc-stress.html new file mode 100644 index 0000000000..86056747e2 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/buffer-gc-stress.html @@ -0,0 +1,155 @@ + + + + + + +Float32Array garbage collection test + + + + + + +
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/buffer-sizes.html b/dom/canvas/test/webgl-conf/checkout/extra/buffer-sizes.html new file mode 100644 index 0000000000..736c135b7a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/buffer-sizes.html @@ -0,0 +1,268 @@ + + + + + + +Buffer allocation test + + + + + +
+
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/canvas-compositing-test.html b/dom/canvas/test/webgl-conf/checkout/extra/canvas-compositing-test.html new file mode 100644 index 0000000000..6eab0020bc --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/canvas-compositing-test.html @@ -0,0 +1,88 @@ + + + + + + +Canvas Compositing Test + + + + + +Below are 2 50x50 pixel canvas but using CSS to display them at 100x100 pixels.
+They are solid black with a red triangle
+They each have a 10px CSS solid black border around them.
+Depending on how the browser composites the canvas with the page they will get +a white outline
+
+2d canvas
+ +
+
+3d canvas
+
+ +
+
+img tag
+ +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/canvas-compositing-test.png b/dom/canvas/test/webgl-conf/checkout/extra/canvas-compositing-test.png new file mode 100644 index 0000000000..ba80dbe760 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/extra/canvas-compositing-test.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/extra/constant-index-out-of-range.html b/dom/canvas/test/webgl-conf/checkout/extra/constant-index-out-of-range.html new file mode 100644 index 0000000000..f16ade96af --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/constant-index-out-of-range.html @@ -0,0 +1,219 @@ + + + + + + +Indexing with a constant expression should compile only if the index is in range + + + + + + + + + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/context-creation-and-destruction-stress.html b/dom/canvas/test/webgl-conf/checkout/extra/context-creation-and-destruction-stress.html new file mode 100644 index 0000000000..7f316da3a0 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/context-creation-and-destruction-stress.html @@ -0,0 +1,35 @@ + + + + + + +Test that contexts are freed and garbage collected reasonably + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/cube-map-uploads-out-of-order.html b/dom/canvas/test/webgl-conf/checkout/extra/cube-map-uploads-out-of-order.html new file mode 100644 index 0000000000..abf9d1dd7d --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/cube-map-uploads-out-of-order.html @@ -0,0 +1,91 @@ + + + + + + +WebGL cube map out of order upload test. + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/fbo-lost-context.html b/dom/canvas/test/webgl-conf/checkout/extra/fbo-lost-context.html new file mode 100644 index 0000000000..b23113d909 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/fbo-lost-context.html @@ -0,0 +1,202 @@ + + + + + + +WebGL FBO Lost Context Test + + + + + + +
+
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/getbuffersubdata-nonblocking-benchmark.html b/dom/canvas/test/webgl-conf/checkout/extra/getbuffersubdata-nonblocking-benchmark.html new file mode 100644 index 0000000000..e6233ea83f --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/getbuffersubdata-nonblocking-benchmark.html @@ -0,0 +1,223 @@ + + + + + + +getBufferSubData non-blocking test + + + + + +
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/logo-256x256.png b/dom/canvas/test/webgl-conf/checkout/extra/logo-256x256.png new file mode 100644 index 0000000000..b6a9ef1acd Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/extra/logo-256x256.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/extra/lots-of-polys-example.html b/dom/canvas/test/webgl-conf/checkout/extra/lots-of-polys-example.html new file mode 100644 index 0000000000..1c4fe866f6 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/lots-of-polys-example.html @@ -0,0 +1,89 @@ + + + + + + +WebGL Lots of polygons example. + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/lots-of-polys-shader-example.html b/dom/canvas/test/webgl-conf/checkout/extra/lots-of-polys-shader-example.html new file mode 100644 index 0000000000..2c57fbe1c3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/lots-of-polys-shader-example.html @@ -0,0 +1,155 @@ + + + + + + +WebGL Lots of polygons example. + + + + + + +
+
+ + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/multisample-corruption-stress.html b/dom/canvas/test/webgl-conf/checkout/extra/multisample-corruption-stress.html new file mode 100644 index 0000000000..a24db37681 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/multisample-corruption-stress.html @@ -0,0 +1,37 @@ + + + + + + +WebGL Multisample Renderbuffer Corruption Test + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/offscreen-issue.html b/dom/canvas/test/webgl-conf/checkout/extra/offscreen-issue.html new file mode 100644 index 0000000000..b35eefbf38 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/offscreen-issue.html @@ -0,0 +1,43 @@ + + + + + + + + + +
content that is tall like several articles
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/out-of-bounds-uniform-array-access.html b/dom/canvas/test/webgl-conf/checkout/extra/out-of-bounds-uniform-array-access.html new file mode 100644 index 0000000000..917361e986 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/out-of-bounds-uniform-array-access.html @@ -0,0 +1,105 @@ + + + + + + +WebGL out of bounds uniform array access. + + + + + +
+
+
elem mult:
+ +
line width:
+ + + + + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/out-of-memory.html b/dom/canvas/test/webgl-conf/checkout/extra/out-of-memory.html new file mode 100644 index 0000000000..e02984d44c --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/out-of-memory.html @@ -0,0 +1,84 @@ + + + + + + +WebGL Out Of Memory Test + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/out-of-resources.html b/dom/canvas/test/webgl-conf/checkout/extra/out-of-resources.html new file mode 100644 index 0000000000..8e88c1ebfd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/out-of-resources.html @@ -0,0 +1,120 @@ + + + + + + +WebGL Out Of Resources Test + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/out-of-vram.html b/dom/canvas/test/webgl-conf/checkout/extra/out-of-vram.html new file mode 100644 index 0000000000..02f82949f7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/out-of-vram.html @@ -0,0 +1,114 @@ + + + + + + +WebGL Out Of VRAM Test + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/point-no-attributes-stress.html b/dom/canvas/test/webgl-conf/checkout/extra/point-no-attributes-stress.html new file mode 100644 index 0000000000..f567264907 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/point-no-attributes-stress.html @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + +
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/program-test-1.html b/dom/canvas/test/webgl-conf/checkout/extra/program-test-1.html new file mode 100644 index 0000000000..e7cee66c9a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/program-test-1.html @@ -0,0 +1,80 @@ + + + + + + + + + + +

Should be green in the rectangle below:

+ +
+ + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/readpixels-after-alert.html b/dom/canvas/test/webgl-conf/checkout/extra/readpixels-after-alert.html new file mode 100644 index 0000000000..0fbb9cb159 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/readpixels-after-alert.html @@ -0,0 +1,65 @@ + + + + + + +WebGL Behavior After Alert and Read Pixels Test + + + + + + + +
Verify WebGL behavior after an alert and then a readPixels()
+
+ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/sample-100.png b/dom/canvas/test/webgl-conf/checkout/extra/sample-100.png new file mode 100644 index 0000000000..197c869b6d Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/extra/sample-100.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/extra/sample-200.png b/dom/canvas/test/webgl-conf/checkout/extra/sample-200.png new file mode 100644 index 0000000000..89f2b782a5 Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/extra/sample-200.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/extra/sample-400.png b/dom/canvas/test/webgl-conf/checkout/extra/sample-400.png new file mode 100644 index 0000000000..aaee3ce0dc Binary files /dev/null and b/dom/canvas/test/webgl-conf/checkout/extra/sample-400.png differ diff --git a/dom/canvas/test/webgl-conf/checkout/extra/sample.svg b/dom/canvas/test/webgl-conf/checkout/extra/sample.svg new file mode 100644 index 0000000000..dfca524023 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/sample.svg @@ -0,0 +1,4 @@ + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/simulated-attrib-0-bug-test.html b/dom/canvas/test/webgl-conf/checkout/extra/simulated-attrib-0-bug-test.html new file mode 100644 index 0000000000..83564e824a --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/simulated-attrib-0-bug-test.html @@ -0,0 +1,36 @@ + + + + + +Simulated Attrib 0 Bug Test + + + + +
Simulated Attrib 0 Bug Test
+
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/slow-shader-example.html b/dom/canvas/test/webgl-conf/checkout/extra/slow-shader-example.html new file mode 100644 index 0000000000..2397bbbec8 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/slow-shader-example.html @@ -0,0 +1,112 @@ + + + + + + +WebGL Slow Shader example. + + + + + + + +
+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/tex-image-with-video-test.html b/dom/canvas/test/webgl-conf/checkout/extra/tex-image-with-video-test.html new file mode 100644 index 0000000000..3c25b7c985 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/tex-image-with-video-test.html @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + +
+
+ + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/tex-image-with-video-test.js b/dom/canvas/test/webgl-conf/checkout/extra/tex-image-with-video-test.js new file mode 100644 index 0000000000..01f56b56c3 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/tex-image-with-video-test.js @@ -0,0 +1,158 @@ +/* +Copyright (c) 2019 The Khronos Group Inc. +Use of this source code is governed by an MIT-style license that can be +found in the LICENSE.txt file. +*/ + +// This block needs to be outside the onload handler in order for this +// test to run reliably in WebKit's test harness (at least the +// Chromium port). https://bugs.webkit.org/show_bug.cgi?id=87448 +initTestingHarness(); + +var old = debug; +var debug = function(msg) { + console.log(msg); + old(msg); +}; + +function generateTest(pixelFormat, pixelType, prologue) { + var wtu = WebGLTestUtils; + var gl = null; + var textureLoc = null; + var successfullyParsed = false; + + // Test each format separately because many browsers implement each + // differently. Some might be GPU accelerated, some might not. Etc... + var videos = [ + { src: "../resources/red-green.mp4" , type: 'video/mp4; codecs="avc1.42E01E, mp4a.40.2"', }, + { src: "../resources/red-green.webmvp8.webm", type: 'video/webm; codecs="vp8, vorbis"', }, + { src: "../resources/red-green.webmvp9.webm", type: 'video/webm; codecs="vp9"', }, + { src: "../resources/red-green.theora.ogv", type: 'video/ogg; codecs="theora, vorbis"', }, + ]; + + var videoNdx = 0; + var video; + + function runNextVideo() { + if (video) { + video.pause(); + } + + if (videoNdx == videos.length) { + finishTest(); + return; + } + + var info = videos[videoNdx++]; + debug(""); + debug("testing: " + info.type); + video = document.createElement("video"); + video.muted = true; + var canPlay = true; + if (!video.canPlayType) { + testFailed("video.canPlayType required method missing"); + runNextVideo(); + return; + } + + if(!video.canPlayType(info.type).replace(/no/, '')) { + debug(info.type + " unsupported"); + runNextVideo(); + return; + }; + + document.body.appendChild(video); + video.type = info.type; + video.crossOrigin = 'anonymous'; + video.src = info.src; + wtu.startPlayingAndWaitForVideo(video, runTest); + } + + var init = function() + { + description('Verify texImage2D and texSubImage2D code paths taking video elements (' + pixelFormat + '/' + pixelType + ')'); + + gl = wtu.create3DContext("example"); + + if (!prologue(gl)) { + finishTest(); + return; + } + + var program = wtu.setupTexturedQuad(gl); + + gl.clearColor(0,0,0,1); + gl.clearDepth(1); + + textureLoc = gl.getUniformLocation(program, "tex"); + runNextVideo(); + } + + function runOneIteration(videoElement, useTexSubImage2D, flipY, topColor, bottomColor) + { + debug('Testing ' + (useTexSubImage2D ? 'texSubImage2D' : 'texImage2D') + + ' with flipY=' + flipY); + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); + // Disable any writes to the alpha channel + gl.colorMask(1, 1, 1, 0); + var texture = gl.createTexture(); + // Bind the texture to texture unit 0 + gl.bindTexture(gl.TEXTURE_2D, texture); + // Set up texture parameters + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.NEAREST); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.NEAREST); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + // Set up pixel store parameters + gl.pixelStorei(gl.UNPACK_FLIP_Y_WEBGL, flipY); + gl.pixelStorei(gl.UNPACK_PREMULTIPLY_ALPHA_WEBGL, false); + // Upload the videoElement into the texture + if (useTexSubImage2D) { + // Initialize the texture to black first + gl.texImage2D(gl.TEXTURE_2D, 0, gl[pixelFormat], + videoElement.videoWidth, videoElement.videoHeight, 0, + gl[pixelFormat], gl[pixelType], null); + gl.texSubImage2D(gl.TEXTURE_2D, 0, 0, 0, gl[pixelFormat], gl[pixelType], videoElement); + } else { + gl.texImage2D(gl.TEXTURE_2D, 0, gl[pixelFormat], gl[pixelFormat], gl[pixelType], videoElement); + } + + var c = document.createElement("canvas"); + c.width = 16; + c.height = 16; + c.style.border = "1px solid black"; + var ctx = c.getContext("2d"); + ctx.drawImage(videoElement, 0, 0, 16, 16); + document.body.appendChild(c); + + // Point the uniform sampler to texture unit 0 + gl.uniform1i(textureLoc, 0); + // Draw the triangles + wtu.clearAndDrawUnitQuad(gl, [0, 0, 0, 255]); + // Check a few pixels near the top and bottom and make sure they have + // the right color. + var tolerance = 5; + debug("Checking lower left corner"); + wtu.checkCanvasRect(gl, 4, 4, 2, 2, bottomColor, + "shouldBe " + bottomColor, tolerance); + debug("Checking upper left corner"); + wtu.checkCanvasRect(gl, 4, gl.canvas.height - 8, 2, 2, topColor, + "shouldBe " + topColor, tolerance); + } + + function runTest(videoElement) + { + var red = [255, 0, 0]; + var green = [0, 255, 0]; + runOneIteration(videoElement, false, true, red, green); + runOneIteration(videoElement, false, false, green, red); + runOneIteration(videoElement, true, true, red, green); + runOneIteration(videoElement, true, false, green, red); + + wtu.glErrorShouldBe(gl, gl.NO_ERROR, "should be no errors"); + + runNextVideo(); + } + + return init; +} diff --git a/dom/canvas/test/webgl-conf/checkout/extra/texture-allocation-stress-test.html b/dom/canvas/test/webgl-conf/checkout/extra/texture-allocation-stress-test.html new file mode 100644 index 0000000000..e27628b621 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/texture-allocation-stress-test.html @@ -0,0 +1,47 @@ + + + + + + +Tests that resources allocated by a WebGL context are freed in a reasonable timeframe. + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/texture-from-camera-stress.html b/dom/canvas/test/webgl-conf/checkout/extra/texture-from-camera-stress.html new file mode 100644 index 0000000000..0a9816ae07 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/texture-from-camera-stress.html @@ -0,0 +1,79 @@ + + + + + + +Stresses the camera-to-texture upload path. + + + + + +
+
+ + + + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/texture-sizing.html b/dom/canvas/test/webgl-conf/checkout/extra/texture-sizing.html new file mode 100644 index 0000000000..efbb65fea7 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/texture-sizing.html @@ -0,0 +1,229 @@ + + + + +Testing resolution of texture uploads + + + + + +
+
+

IMG to SVG with 200x200 attributes

+
+
+ +
+
+
+
+

+
+
+
+
+

IMG to 100x100 PNG with 200x200 attributes

+
+
+ +
+
+
+
+

+
+
+
+
+

IMG to 200x200 PNG with 200x200 attributes

+
+
+ +
+
+
+
+

+
+
+
+
+

IMG to 400x400 PNG with 200x200 attributes

+
+
+ +
+
+
+
+

+
+
+
+
+

IMG SRCSET to multiple PNGs with 200x200 attributes

+
+
+ +
+
+
+
+

+
+
+
+
+

IMG to SVG with no attributes - 200x200 sizing via CSS

+
+
+ +
+
+
+
+

+
+
+
+
+

IMG to 400x400 PNG with no attributes - 200x200 sizing via CSS

+
+
+ +
+
+
+
+

+
+
+
+
+

+ IMG to SVG with no attributes and no sizing via CSS
+ (although the width and height of the container set a size) +

+
+
+ +
+
+
+
+

+
+
+
+
+

Out of page SVG with no dimensions

+
+
+ Not a child of document +
+
+
+
+

+
+
+
+
+

Out of page SVG with 200x200 specified

+
+
+ Not a child of document +
+
+
+
+

+
+
+ + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/webgl-compressed-texture-size-limit-stress.html b/dom/canvas/test/webgl-conf/checkout/extra/webgl-compressed-texture-size-limit-stress.html new file mode 100644 index 0000000000..9f515be7ac --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/webgl-compressed-texture-size-limit-stress.html @@ -0,0 +1,33 @@ + + + + + + +WebGL compressed texture size limit stress test + + + + + + + +
+
+ + + \ No newline at end of file diff --git a/dom/canvas/test/webgl-conf/checkout/extra/webgl-drawelements-validation.html b/dom/canvas/test/webgl-conf/checkout/extra/webgl-drawelements-validation.html new file mode 100644 index 0000000000..c7e11b8cec --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/webgl-drawelements-validation.html @@ -0,0 +1,142 @@ + + + + + +Micro-benchmark for WebGL drawElements index validation + + + + + +

Micro-benchmark for WebGL drawElements index validation

+

Note that these test cases are completely artificial, and their results only very rough indicators of the performance of a specific part of the system.

+

The benchmark does not perform any drawing, but rather measures the time the browser takes to upload indices and to check if there are out-of-range indices.

+ + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/webgl-info.html b/dom/canvas/test/webgl-conf/checkout/extra/webgl-info.html new file mode 100644 index 0000000000..9929edb178 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/webgl-info.html @@ -0,0 +1,275 @@ + + + + + + +WebGL Information + + + + + +

WebGL Info

+
+

WebGL Extensions

+
+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/webgl-translate-shader.html b/dom/canvas/test/webgl-conf/checkout/extra/webgl-translate-shader.html new file mode 100644 index 0000000000..55176b6ffd --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/webgl-translate-shader.html @@ -0,0 +1,153 @@ + + + + + + +WebGL Shader Translator + + + + + + +

WebGL Shader Translator

+

This page uses the browser's built-in shader translation facilities to show how a shader +is changed before being passed on to the underlying platform's graphics driver.

+ +

WebGL GLSL shader

+ +

+ + +

+

Shader translated for graphics driver

+ +

Enabled shader extensions

+

None

+

Shader info log

+ + + + diff --git a/dom/canvas/test/webgl-conf/checkout/extra/workload-simulator.html b/dom/canvas/test/webgl-conf/checkout/extra/workload-simulator.html new file mode 100644 index 0000000000..fa01977321 --- /dev/null +++ b/dom/canvas/test/webgl-conf/checkout/extra/workload-simulator.html @@ -0,0 +1,851 @@ + + +WebGL workload simulator + + + + + + +
+
+Drag the WebGL logo.
+ + + +
+ + + + + + +
+
+ + Target FPS: 60 +
+
+
+ Canvas options +
+ Canvas size pixels2 + + + +
+ +
+
+
+
+ WebGL rendering work +
+ + draw 64K pixels per view +
+ + using 1 draw call(s) per view +
+ Multiply the above slider values by: + + + +
+ + 0.00 MB glBufferData +
+ +
+ +
+
+ WebGL context creation options + + + + + + + + +
+ Power preference + + + +
+ +
+
+ + Draw 1 views(s) +
+ + +
+
+  
+
+ Context attributes +

+  
+
+ Supported Extensions +
+
+
+ +0 ms extra Javascript work per frame +
+ + +
+ +
+ +

+ +

+
+
+ + + +

WebGL workload simulator

+
+ + -- cgit v1.2.3