Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(668)

Unified Diff: LayoutTests/compositing/webgl/webgl-with-accelerated-background-color.html

Issue 63943006: Re-enable solid background color optimization for composited layers. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add window.internals.forceCompositingUpdate(document) to webgl test to avoid flaky Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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>

Powered by Google App Engine
This is Rietveld 408576698