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..1ad50d1a5e223a41ee199bf051a2dd338f2738ab |
| --- /dev/null |
| +++ b/LayoutTests/compositing/webgl/webgl-with-accelerated-background-color.html |
| @@ -0,0 +1,84 @@ |
| +<!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> |
| + #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: relative; |
| + } |
| + .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.internals) |
| + window.internals.forceCompositingUpdate(document); |
|
dshwang
2013/11/26 11:49:02
@jamesr, I add this line to ensure re-evaluating c
|
| + 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("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("", "", [], [ 1.0, 0.0, 0.0, 1.0 ], 1); |
| + gl.viewport(0, 0, 200, 200); |
| + 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> |