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 rectangle with yellow b
order on white background.</title> |
| 12 <!-- The canvas css style is added to check if the style change on html canvas |
| 13 element can be correctly rendered to the screen via compositor commit. |
| 14 The intrinsic size of canvas remains 300X300 whilst the rendered canvas on |
| 15 the screen follows 100X200 css style restriction. |
| 16 --> |
12 <style type="text/css"> | 17 <style type="text/css"> |
13 .nomargin { | 18 .nomargin { |
14 margin: 0px auto; | 19 margin: 0px auto; |
15 } | 20 } |
| 21 canvas { |
| 22 width: 100px; |
| 23 height: 200px; |
| 24 border: 10px solid yellow; |
| 25 } |
16 </style> | 26 </style> |
17 <script id="myWorker" type="text/worker"> | 27 <script id="myWorker" type="text/worker"> |
18 function drawTriangle(canvas) | 28 function drawTriangle(canvas) |
19 { | 29 { |
20 var gl = canvas.getContext("webgl"); | 30 var gl = canvas.getContext("webgl"); |
21 gl.clearColor(0, 1, 0, 1); | 31 gl.clearColor(0, 1, 0, 1); |
22 gl.clear(gl.COLOR_BUFFER_BIT); | 32 gl.clear(gl.COLOR_BUFFER_BIT); |
23 | 33 |
24 var prog = gl.createProgram(); | 34 var prog = gl.createProgram(); |
25 var vs = gl.createShader(gl.VERTEX_SHADER); | 35 var vs = gl.createShader(gl.VERTEX_SHADER); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 </script> | 114 </script> |
105 </head> | 115 </head> |
106 <body onload="main()"> | 116 <body onload="main()"> |
107 <div style="position:relative; width:300px; height:300px; background-color:white
"> | 117 <div style="position:relative; width:300px; height:300px; background-color:white
"> |
108 </div> | 118 </div> |
109 <div id="container" style="position:absolute; top:0px; left:0px"> | 119 <div id="container" style="position:absolute; top:0px; left:0px"> |
110 <canvas id="c" width="300" height="300" class="nomargin"></canvas> | 120 <canvas id="c" width="300" height="300" class="nomargin"></canvas> |
111 </div> | 121 </div> |
112 </body> | 122 </body> |
113 </html> | 123 </html> |
OLD | NEW |