mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Backed out changeset 0ad31c2bda31 (bug 883364)
This commit is contained in:
parent
ffa29aa985
commit
be310c2627
@ -1,50 +1,43 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<script type="text/javascript" src="webgl-utils.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* Clear Test
|
||||
*
|
||||
* Clear the canvas to green to test that we get pixels to the screen.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
function renderGL(gl) {
|
||||
gl.clearColor(0.0, 1.0, 0.0, 1.0);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
gl.finish();
|
||||
}
|
||||
|
||||
function renderFailure(canvas) {
|
||||
// This will also trigger RAF for us.
|
||||
var context = canvas.getContext("2d");
|
||||
context.fillText('WebGL failed.', 64, 64);
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
var canvas = document.getElementById("canvas");
|
||||
var gl = initGL(canvas);
|
||||
|
||||
if (gl)
|
||||
renderGL(gl);
|
||||
else
|
||||
renderFailure(canvas);
|
||||
|
||||
rAF(testComplete);
|
||||
}
|
||||
|
||||
function testComplete() {
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="rAF(runTest);">
|
||||
<canvas id="canvas" width="256" height="256"></canvas>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<script type="text/javascript" src="webgl-utils.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* Clear Test
|
||||
*
|
||||
* Clear the canvas to green to test that we get pixels to the screen.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
function renderGL(gl) {
|
||||
gl.clearColor(0.0, 1.0, 0.0, 1.0);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
gl.finish();
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
var canvas = document.getElementById("canvas");
|
||||
var gl = initGL(canvas);
|
||||
|
||||
if (gl)
|
||||
renderGL(gl);
|
||||
else
|
||||
document.write("Failed to get WebGL context.");
|
||||
|
||||
rAF(testComplete);
|
||||
}
|
||||
|
||||
function testComplete() {
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="rAF(runTest);">
|
||||
<canvas id="canvas" width="256" height="256"></canvas>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
@ -1,81 +1,75 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<script type="text/javascript" src="webgl-utils.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* Color-Alpha Test
|
||||
*
|
||||
* Clear the four quadrants of the canvas as follows:
|
||||
* +------+------+
|
||||
* | red |green |
|
||||
* | | |
|
||||
* +------+------+
|
||||
* | blue |white |
|
||||
* | | |
|
||||
* +------+------+
|
||||
* However, unlike the Color test, clear with a given alpha value.
|
||||
* What effect this has depends on the context-creation args passed
|
||||
* to this page.
|
||||
*
|
||||
* Here we check that we handle various combinations of alpha and
|
||||
* premultipliedAlpha correctly.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
function renderGL(gl, value, alpha) {
|
||||
gl.enable(gl.SCISSOR_TEST);
|
||||
|
||||
gl.scissor(0, 128, 128, 128);
|
||||
gl.clearColor(value, 0.0, 0.0, alpha);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
|
||||
gl.scissor(128, 128, 128, 128);
|
||||
gl.clearColor(0.0, value, 0.0, alpha);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
|
||||
gl.scissor(0, 0, 128, 128);
|
||||
gl.clearColor(0.0, 0.0, value, alpha);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
|
||||
gl.scissor(128, 0, 128, 128);
|
||||
gl.clearColor(value, value, value, alpha);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
|
||||
gl.finish();
|
||||
}
|
||||
|
||||
function renderFailure(canvas) {
|
||||
// This will also trigger RAF for us.
|
||||
var context = canvas.getContext("2d");
|
||||
context.fillText('WebGL failed.', 64, 64);
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
var canvas = document.getElementById("canvas");
|
||||
var gl = initGL(canvas);
|
||||
|
||||
var value = arg("colorVal");
|
||||
var alpha = arg("alphaVal");
|
||||
|
||||
if (gl)
|
||||
renderGL(gl, value, alpha);
|
||||
else
|
||||
renderFailure(canvas);
|
||||
|
||||
rAF(testComplete);
|
||||
}
|
||||
|
||||
function testComplete() {
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="rAF(runTest);">
|
||||
<canvas id="canvas" width="256" height="256"></canvas>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<script type="text/javascript" src="webgl-utils.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* Color-Alpha Test
|
||||
*
|
||||
* Clear the four quadrants of the canvas as follows:
|
||||
* +------+------+
|
||||
* | red |green |
|
||||
* | | |
|
||||
* +------+------+
|
||||
* | blue |white |
|
||||
* | | |
|
||||
* +------+------+
|
||||
* However, unlike the Color test, clear with a given alpha value.
|
||||
* What effect this has depends on the context-creation args passed
|
||||
* to this page.
|
||||
*
|
||||
* Here we check that we handle various combinations of alpha and
|
||||
* premultipliedAlpha correctly.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
function renderGL(gl, value, alpha) {
|
||||
gl.enable(gl.SCISSOR_TEST);
|
||||
|
||||
gl.scissor(0, 128, 128, 128);
|
||||
gl.clearColor(value, 0.0, 0.0, alpha);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
|
||||
gl.scissor(128, 128, 128, 128);
|
||||
gl.clearColor(0.0, value, 0.0, alpha);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
|
||||
gl.scissor(0, 0, 128, 128);
|
||||
gl.clearColor(0.0, 0.0, value, alpha);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
|
||||
gl.scissor(128, 0, 128, 128);
|
||||
gl.clearColor(value, value, value, alpha);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
|
||||
gl.finish();
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
var canvas = document.getElementById("canvas");
|
||||
var gl = initGL(canvas);
|
||||
|
||||
var value = arg("colorVal");
|
||||
var alpha = arg("alphaVal");
|
||||
|
||||
if (gl)
|
||||
renderGL(gl, value, alpha);
|
||||
else
|
||||
document.write("Failed to get WebGL context.");
|
||||
|
||||
rAF(testComplete);
|
||||
}
|
||||
|
||||
function testComplete() {
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="rAF(runTest);">
|
||||
<canvas id="canvas" width="256" height="256"></canvas>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
@ -1,76 +1,70 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<script type="text/javascript" src="webgl-utils.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* Color Test
|
||||
*
|
||||
* Clear the four quadrants of the canvas as follows:
|
||||
* +------+------+
|
||||
* | red |green |
|
||||
* | | |
|
||||
* +------+------+
|
||||
* | blue |white |
|
||||
* | | |
|
||||
* +------+------+
|
||||
*
|
||||
* This is for checking that we're getting the right colors when
|
||||
* we ask for them. This combined with the Orientation test assure
|
||||
* that we are getting the correct colors in the correct places.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
function renderGL(gl) {
|
||||
gl.enable(gl.SCISSOR_TEST);
|
||||
|
||||
gl.scissor(0, 128, 128, 128);
|
||||
gl.clearColor(1.0, 0.0, 0.0, 1.0);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
|
||||
gl.scissor(128, 128, 128, 128);
|
||||
gl.clearColor(0.0, 1.0, 0.0, 1.0);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
|
||||
gl.scissor(0, 0, 128, 128);
|
||||
gl.clearColor(0.0, 0.0, 1.0, 1.0);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
|
||||
gl.scissor(128, 0, 128, 128);
|
||||
gl.clearColor(1.0, 1.0, 1.0, 1.0);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
|
||||
gl.finish();
|
||||
}
|
||||
|
||||
function renderFailure(canvas) {
|
||||
// This will also trigger RAF for us.
|
||||
var context = canvas.getContext("2d");
|
||||
context.fillText('WebGL failed.', 64, 64);
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
var canvas = document.getElementById("canvas");
|
||||
var gl = initGL(canvas);
|
||||
|
||||
if (gl)
|
||||
renderGL(gl);
|
||||
else
|
||||
renderFailure(canvas);
|
||||
|
||||
rAF(testComplete);
|
||||
}
|
||||
|
||||
function testComplete() {
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="rAF(runTest);">
|
||||
<canvas id="canvas" width="256" height="256"></canvas>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<script type="text/javascript" src="webgl-utils.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* Color Test
|
||||
*
|
||||
* Clear the four quadrants of the canvas as follows:
|
||||
* +------+------+
|
||||
* | red |green |
|
||||
* | | |
|
||||
* +------+------+
|
||||
* | blue |white |
|
||||
* | | |
|
||||
* +------+------+
|
||||
*
|
||||
* This is for checking that we're getting the right colors when
|
||||
* we ask for them. This combined with the Orientation test assure
|
||||
* that we are getting the correct colors in the correct places.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
function renderGL(gl) {
|
||||
gl.enable(gl.SCISSOR_TEST);
|
||||
|
||||
gl.scissor(0, 128, 128, 128);
|
||||
gl.clearColor(1.0, 0.0, 0.0, 1.0);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
|
||||
gl.scissor(128, 128, 128, 128);
|
||||
gl.clearColor(0.0, 1.0, 0.0, 1.0);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
|
||||
gl.scissor(0, 0, 128, 128);
|
||||
gl.clearColor(0.0, 0.0, 1.0, 1.0);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
|
||||
gl.scissor(128, 0, 128, 128);
|
||||
gl.clearColor(1.0, 1.0, 1.0, 1.0);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
|
||||
gl.finish();
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
var canvas = document.getElementById("canvas");
|
||||
var gl = initGL(canvas);
|
||||
|
||||
if (gl)
|
||||
renderGL(gl);
|
||||
else
|
||||
document.write("Failed to get WebGL context.");
|
||||
|
||||
rAF(testComplete);
|
||||
}
|
||||
|
||||
function testComplete() {
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="rAF(runTest);">
|
||||
<canvas id="canvas" width="256" height="256"></canvas>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
@ -1,58 +1,52 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<script type="text/javascript" src="webgl-utils.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* Hanging Framebuffer Test
|
||||
*
|
||||
* Clear the canvas to green, but create and bind a new framebuffer
|
||||
* before returning. This will fail if we blindly read from the bound
|
||||
* framebuffer, instead of binding to the screen and reading from that.
|
||||
*
|
||||
* How failure looks isn't well defined, since this is an empty framebuffer,
|
||||
* thus is incomplete, and should cause errors if it's read from.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
function renderGL(gl) {
|
||||
gl.clearColor(0.0, 1.0, 0.0, 1.0);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
|
||||
var fb = gl.createFramebuffer();
|
||||
gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
|
||||
|
||||
gl.finish();
|
||||
}
|
||||
|
||||
function renderFailure(canvas) {
|
||||
// This will also trigger RAF for us.
|
||||
var context = canvas.getContext("2d");
|
||||
context.fillText('WebGL failed.', 64, 64);
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
var canvas = document.getElementById("canvas");
|
||||
var gl = initGL(canvas);
|
||||
|
||||
if (gl)
|
||||
renderGL(gl);
|
||||
else
|
||||
renderFailure(canvas);
|
||||
|
||||
rAF(testComplete);
|
||||
}
|
||||
|
||||
function testComplete() {
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="rAF(runTest);">
|
||||
<canvas id="canvas" width="256" height="256"></canvas>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<script type="text/javascript" src="webgl-utils.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* Hanging Framebuffer Test
|
||||
*
|
||||
* Clear the canvas to green, but create and bind a new framebuffer
|
||||
* before returning. This will fail if we blindly read from the bound
|
||||
* framebuffer, instead of binding to the screen and reading from that.
|
||||
*
|
||||
* How failure looks isn't well defined, since this is an empty framebuffer,
|
||||
* thus is incomplete, and should cause errors if it's read from.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
function renderGL(gl) {
|
||||
gl.clearColor(0.0, 1.0, 0.0, 1.0);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
|
||||
var fb = gl.createFramebuffer();
|
||||
gl.bindFramebuffer(gl.FRAMEBUFFER, fb);
|
||||
|
||||
gl.finish();
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
var canvas = document.getElementById("canvas");
|
||||
var gl = initGL(canvas);
|
||||
|
||||
if (gl)
|
||||
renderGL(gl);
|
||||
else
|
||||
document.write("Failed to get WebGL context.");
|
||||
|
||||
rAF(testComplete);
|
||||
}
|
||||
|
||||
function testComplete() {
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="rAF(runTest);">
|
||||
<canvas id="canvas" width="256" height="256"></canvas>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
@ -1,57 +1,51 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<script type="text/javascript" src="webgl-utils.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* Hanging Scissor Test
|
||||
*
|
||||
* Clear the canvas to green, but create and enable and set scissor values
|
||||
* before returning. This can fail if we blindly blit or read from the screen
|
||||
* without disabling scissor-test.
|
||||
*
|
||||
* Failure should look like only the top-left quadrant is rendered.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
function renderGL(gl) {
|
||||
gl.clearColor(0.0, 1.0, 0.0, 1.0);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
|
||||
gl.enable(gl.SCISSOR_TEST);
|
||||
gl.scissor(0, 128, 128, 128);
|
||||
|
||||
gl.finish();
|
||||
}
|
||||
|
||||
function renderFailure(canvas) {
|
||||
// This will also trigger RAF for us.
|
||||
var context = canvas.getContext("2d");
|
||||
context.fillText('WebGL failed.', 64, 64);
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
var canvas = document.getElementById("canvas");
|
||||
var gl = initGL(canvas);
|
||||
|
||||
if (gl)
|
||||
renderGL(gl);
|
||||
else
|
||||
renderFailure(canvas);
|
||||
|
||||
rAF(testComplete);
|
||||
}
|
||||
|
||||
function testComplete() {
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="rAF(runTest);">
|
||||
<canvas id="canvas" width="256" height="256"></canvas>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<script type="text/javascript" src="webgl-utils.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* Hanging Scissor Test
|
||||
*
|
||||
* Clear the canvas to green, but create and enable and set scissor values
|
||||
* before returning. This can fail if we blindly blit or read from the screen
|
||||
* without disabling scissor-test.
|
||||
*
|
||||
* Failure should look like only the top-left quadrant is rendered.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
function renderGL(gl) {
|
||||
gl.clearColor(0.0, 1.0, 0.0, 1.0);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
|
||||
gl.enable(gl.SCISSOR_TEST);
|
||||
gl.scissor(0, 128, 128, 128);
|
||||
|
||||
gl.finish();
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
var canvas = document.getElementById("canvas");
|
||||
var gl = initGL(canvas);
|
||||
|
||||
if (gl)
|
||||
renderGL(gl);
|
||||
else
|
||||
document.write("Failed to get WebGL context.");
|
||||
|
||||
rAF(testComplete);
|
||||
}
|
||||
|
||||
function testComplete() {
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="rAF(runTest);">
|
||||
<canvas id="canvas" width="256" height="256"></canvas>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
@ -1,57 +1,51 @@
|
||||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<script type="text/javascript" src="webgl-utils.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* Orientation Test
|
||||
*
|
||||
* Clear the canvas to black, and clear the upper-left quadrant
|
||||
* to white. If this doesn't pass, but the Clear test does, then
|
||||
* likely y-flip is wrong.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
function renderGL(gl) {
|
||||
gl.clearColor(0.0, 0.0, 0.0, 1.0);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
|
||||
gl.enable(gl.SCISSOR_TEST);
|
||||
gl.scissor(0, 128, 128, 128);
|
||||
gl.clearColor(1.0, 1.0, 1.0, 1.0);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
|
||||
gl.finish();
|
||||
}
|
||||
|
||||
function renderFailure(canvas) {
|
||||
// This will also trigger RAF for us.
|
||||
var context = canvas.getContext("2d");
|
||||
context.fillText('WebGL failed.', 64, 64);
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
var canvas = document.getElementById("canvas");
|
||||
var gl = initGL(canvas);
|
||||
|
||||
if (gl)
|
||||
renderGL(gl);
|
||||
else
|
||||
renderFailure(canvas);
|
||||
|
||||
rAF(testComplete);
|
||||
}
|
||||
|
||||
function testComplete() {
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="rAF(runTest);">
|
||||
<canvas id="canvas" width="256" height="256"></canvas>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
<!DOCTYPE html>
|
||||
<html class="reftest-wait">
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
|
||||
<script type="text/javascript" src="webgl-utils.js"></script>
|
||||
<script type="text/javascript">
|
||||
/* Orientation Test
|
||||
*
|
||||
* Clear the canvas to black, and clear the upper-left quadrant
|
||||
* to white. If this doesn't pass, but the Clear test does, then
|
||||
* likely y-flip is wrong.
|
||||
*/
|
||||
|
||||
"use strict";
|
||||
|
||||
function renderGL(gl) {
|
||||
gl.clearColor(0.0, 0.0, 0.0, 1.0);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
|
||||
gl.enable(gl.SCISSOR_TEST);
|
||||
gl.scissor(0, 128, 128, 128);
|
||||
gl.clearColor(1.0, 1.0, 1.0, 1.0);
|
||||
gl.clear(gl.COLOR_BUFFER_BIT);
|
||||
|
||||
gl.finish();
|
||||
}
|
||||
|
||||
function runTest() {
|
||||
var canvas = document.getElementById("canvas");
|
||||
var gl = initGL(canvas);
|
||||
|
||||
if (gl)
|
||||
renderGL(gl);
|
||||
else
|
||||
document.write("Failed to get WebGL context.");
|
||||
|
||||
rAF(testComplete);
|
||||
}
|
||||
|
||||
function testComplete() {
|
||||
document.documentElement.removeAttribute("class");
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="rAF(runTest);">
|
||||
<canvas id="canvas" width="256" height="256"></canvas>
|
||||
</body>
|
||||
|
||||
</html>
|
||||
|
Loading…
Reference in New Issue
Block a user