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 worker thread: red square on white backgro und.</title> | 11 <title>OffscreenCanvas commit flow on worker thread: red square on white backgro und.</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 id="myWorker" type="text/worker"> | 17 <script id="myWorker" type="text/worker"> |
18 self.onmessage = function(e) { | 18 self.onmessage = function(e) { |
19 var transferredOffscreenCanvas = e.data; | 19 var transferredOffscreenCanvas = e.data; |
20 var gl = transferredOffscreenCanvas.getContext("webgl"); | 20 var gl = transferredOffscreenCanvas.getContext("webgl"); |
21 gl.clearColor(1.0, 0.0, 0.0, 1.0); | 21 gl.clearColor(1.0, 0.0, 0.0, 1.0); |
22 gl.clear(gl.COLOR_BUFFER_BIT); | 22 gl.clear(gl.COLOR_BUFFER_BIT); |
23 gl.commit(); | 23 gl.commit(); |
24 self.postMessage(""); | |
Ken Russell (switch to Gerrit)
2016/09/22 21:11:44
I think you need to wait for this to be received b
| |
24 }; | 25 }; |
25 </script> | 26 </script> |
26 <script> | 27 <script> |
27 var g_swapsBeforeAck = 15; | 28 var g_swapsBeforeAck = 15; |
28 | 29 |
29 function makeWorker(script) { | 30 function makeWorker(script) { |
30 var blob = new Blob([script]); | 31 var blob = new Blob([script]); |
31 return new Worker(URL.createObjectURL(blob)); | 32 return new Worker(URL.createObjectURL(blob)); |
32 } | 33 } |
33 | 34 |
(...skipping 25 matching lines...) Expand all Loading... | |
59 </script> | 60 </script> |
60 </head> | 61 </head> |
61 <body onload="main()"> | 62 <body onload="main()"> |
62 <div style="position:relative; width:200px; height:200px; background-color:white "> | 63 <div style="position:relative; width:200px; height:200px; background-color:white "> |
63 </div> | 64 </div> |
64 <div id="container" style="position:absolute; top:0px; left:0px"> | 65 <div id="container" style="position:absolute; top:0px; left:0px"> |
65 <canvas id="c" width="200" height="200" class="nomargin"></canvas> | 66 <canvas id="c" width="200" height="200" class="nomargin"></canvas> |
66 </div> | 67 </div> |
67 </body> | 68 </body> |
68 </html> | 69 </html> |
OLD | NEW |