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

Side by Side 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 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE>
2 <html>
3 <head>
4 <!-- Check for compositing WebGL layer and accelerated background-color layer. - ->
5 <!-- On load, there is not WebGL layer. WebGL layer is created on the fly. -->
6 <style>
7 #background {
8 width: 200px;
9 height: 200px;
10 display: block;
11 }
12 #canvas {
13 width: 200px;
14 height: 200px;
15 display: block;
16 }
17 .blue {
18 width: 50px;
19 height: 50px;
20 background-color: rgba(0, 0, 255, 0.5);
21 display: block;
22 top: -50px;
23 position: relative;
24 }
25 .composited {
26 -webkit-transform: translateZ(0);
27 }
28 </style>
29 <script type="text/javascript" charset="utf-8">
30 if (window.testRunner) {
31 testRunner.waitUntilDone();
32 testRunner.dumpAsTextWithPixelResults();
33 }
34
35 function doTest()
36 {
37 window.setTimeout(function() {
38 makeWebGLLayer();
39 if (window.internals)
40 window.internals.forceCompositingUpdate(document);
dshwang 2013/11/26 11:49:02 @jamesr, I add this line to ensure re-evaluating c
41 if (window.testRunner) {
42 window.setTimeout(function() {
43 testRunner.notifyDone();
44 }, 0);
45 }
46 }, 0);
47 }
48
49 function initWebGL(vshader, fshader, attribs, clearColor, clearDepth)
50 {
51 var canvas = document.getElementById('canvas');
52 var gl = canvas.getContext("webgl");
53 if (!gl) {
54 alert("No WebGL context found");
55 return null;
56 }
57
58 gl.clearColor(clearColor[0], clearColor[1], clearColor[2], clearColor[3] );
59 gl.clearDepth(clearDepth);
60
61 gl.enable(gl.DEPTH_TEST);
62 gl.enable(gl.BLEND);
63 gl.blendFunc(gl.SRC_ALPHA, gl.ONE);
64
65 return gl;
66 }
67
68 function makeWebGLLayer()
69 {
70 var gl = initWebGL("", "", [], [ 1.0, 0.0, 0.0, 1.0 ], 1);
71 gl.viewport(0, 0, 200, 200);
72 gl.clear(gl.COLOR_BUFFER_BIT | gl.DEPTH_BUFFER_BIT);
73 }
74
75 window.addEventListener('load', doTest, false);
76 </script>
77 </head>
78 <body>
79 <div id="background">
80 <canvas id="canvas"></canvas>
81 <div class="blue composited"></div>
82 </div>
83 </body>
84 </html>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698