OLD | NEW |
---|---|
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 | 2 |
3 <!-- READ BEFORE UPDATING: | 3 <!-- READ BEFORE UPDATING: |
4 If this test is updated make sure to increment the "revision" value of the | 4 If this test is updated make sure to increment the "revision" value of the |
5 associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure | 5 associated test in content/test/gpu/page_sets/pixel_tests.py. This will ensure |
6 that the baseline images are regenerated on the next run. | 6 that the baseline images are regenerated on the next run. |
7 --> | 7 --> |
8 | 8 |
9 <html> | 9 <html> |
10 <head> | 10 <head> |
11 <title>OffscreenCanvas commit flow on main thread: green square on white backgro und.</title> | 11 <title>OffscreenCanvas 2D commit flow on main thread: green square on white back ground.</title> |
12 <style type="text/css"> | 12 <style type="text/css"> |
13 .nomargin { | 13 .nomargin { |
14 margin: 0px auto; | 14 margin: 0px auto; |
15 } | 15 } |
16 </style> | 16 </style> |
17 <script> | 17 <script> |
18 var g_swapsBeforeAck = 15; | 18 var g_swapsBeforeAck = 15; |
19 | 19 |
20 function main() | 20 function main() |
21 { | 21 { |
22 draw(); | 22 draw(); |
23 waitForFinish(); | 23 waitForFinish(); |
24 } | 24 } |
25 | 25 |
26 function draw() | 26 function draw() |
27 { | 27 { |
28 var canvas = document.getElementById("c"); | 28 var canvas = document.getElementById("c"); |
29 var offscreenCanvas = canvas.transferControlToOffscreen(); | 29 var offscreenCanvas = canvas.transferControlToOffscreen(); |
30 var gl = offscreenCanvas.getContext("webgl"); | 30 var offscreen2d = offscreenCanvas.getContext("2d"); |
31 gl.clearColor(0.0, 1.0, 0.0, 1.0); | 31 offscreen2d.commit(); |
Ken Russell (switch to Gerrit)
2016/09/22 00:50:36
This doesn't seem to do anything with the context
xidachen
2016/09/22 00:58:15
Sorry that this is confusing. I forgot to clarify:
Ken Russell (switch to Gerrit)
2016/09/22 01:12:09
Yes, please either:
1) Remove the 2D canvas tests
| |
32 gl.clear(gl.COLOR_BUFFER_BIT); | |
33 gl.commit(); | |
34 } | 32 } |
35 | 33 |
36 function waitForFinish() | 34 function waitForFinish() |
37 { | 35 { |
38 if (g_swapsBeforeAck == 0) { | 36 if (g_swapsBeforeAck == 0) { |
39 domAutomationController.setAutomationId(1); | 37 domAutomationController.setAutomationId(1); |
40 domAutomationController.send("SUCCESS"); | 38 domAutomationController.send("SUCCESS"); |
41 } else { | 39 } else { |
42 g_swapsBeforeAck--; | 40 g_swapsBeforeAck--; |
43 document.getElementById('container').style.zIndex = g_swapsBeforeAck + 1; | 41 document.getElementById('container').style.zIndex = g_swapsBeforeAck + 1; |
44 window.webkitRequestAnimationFrame(waitForFinish); | 42 window.webkitRequestAnimationFrame(waitForFinish); |
45 } | 43 } |
46 } | 44 } |
47 </script> | 45 </script> |
48 </head> | 46 </head> |
49 <body onload="main()"> | 47 <body onload="main()"> |
50 <div style="position:relative; width:200px; height:200px; background-color:white "> | 48 <div style="position:relative; width:200px; height:200px; background-color:white "> |
51 </div> | 49 </div> |
52 <div id="container" style="position:absolute; top:0px; left:0px"> | 50 <div id="container" style="position:absolute; top:0px; left:0px"> |
53 <canvas id="c" width="200" height="200" class="nomargin"></canvas> | 51 <canvas id="c" width="200" height="200" class="nomargin"></canvas> |
54 </div> | 52 </div> |
55 </body> | 53 </body> |
56 </html> | 54 </html> |
OLD | NEW |