Chromium Code Reviews| Index: LayoutTests/compositing/webgl/webgl-with-accelerated-background-color.html |
| diff --git a/LayoutTests/compositing/webgl/webgl-with-accelerated-background-color.html b/LayoutTests/compositing/webgl/webgl-with-accelerated-background-color.html |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..995d84464a8fd2653140342dd2022b5c498cd12a |
| --- /dev/null |
| +++ b/LayoutTests/compositing/webgl/webgl-with-accelerated-background-color.html |
| @@ -0,0 +1,83 @@ |
| +<!DOCTYPE> |
| +<html> |
| +<head> |
| +<!-- Check for compositing WebGL layer and accelerated background-color layer. --> |
| +<!-- On load, there is not WebGL layer. WebGL layer is created on the fly. --> |
| +<style type="text/css" media="screen"> |
|
jamesr
2013/11/26 06:08:00
the 'type' and 'media' attributes here aren't stri
|
| + #background { |
| + width: 200px; |
| + height: 200px; |
| + display: block; |
| + } |
| + #canvas { |
| + width: 200px; |
| + height: 200px; |
| + display: block; |
| + } |
| + .blue { |
| + width: 50px; |
| + height: 50px; |
| + background-color: rgba(0, 0, 255, 0.5); |
| + display: block; |
| + top: 50px; |
| + position: absolute; |
| + } |
| + .composited { |
| + -webkit-transform: translateZ(0); |
| + } |
| +</style> |
| +<script type="text/javascript" charset="utf-8"> |
| + if (window.testRunner) { |
| + testRunner.waitUntilDone(); |
| + testRunner.dumpAsTextWithPixelResults(); |
| + } |
| + |
| + function doTest() |
| + { |
| + window.setTimeout(function() { |
| + makeWebGLLayer(); |
| + if (window.testRunner) { |
| + window.setTimeout(function() { |
| + testRunner.notifyDone(); |
| + }, 0); |
| + } |
| + }, 0); |
| + } |
| + |
| + function initWebGL(vshader, fshader, attribs, clearColor, clearDepth) |
| + { |
| + var canvas = document.getElementById('canvas'); |
| + var gl = canvas.getContext("experimental-webgl"); |
| + if (!gl) { |
| + alert("No WebGL context found"); |
| + return null; |
| + } |
| + |
| + gl.clearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3]); |
| + gl.clearDepth(clearDepth); |
| + |
| + gl.enable(gl.DEPTH_TEST); |
| + gl.enable(gl.BLEND); |
| + gl.blendFunc(gl.SRC_ALPHA, gl.ONE); |
| + |
| + return gl; |
| + } |
| + |
| + function makeWebGLLayer() |
| + { |
| + var gl = initWebGL("", "", [], [ 0, 0, 0, 0 ], 1); |
| + gl.viewport(0, 0, 200, 200); |
| + gl.clearColor(1.0, 0.0, 0.0, 1.0); |
| + gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT); |
| + } |
| + |
| + window.addEventListener('load', doTest, false); |
| +</script> |
| +</head> |
| +<body> |
| +<div id="background"> |
| + <canvas id="canvas"></canvas> |
| + <div class="blue composited"></div> |
| +</div> |
| +</body> |
| +</html> |