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> |
(...skipping 16 matching lines...) Expand all Loading... |
27 canvas.style.width = canvas.style.height = "150px"; | 27 canvas.style.width = canvas.style.height = "150px"; |
28 var c2d = canvas.getContext("2d"); | 28 var c2d = canvas.getContext("2d"); |
29 c2d.clearRect(0, 0, canvas.width, canvas.height); | 29 c2d.clearRect(0, 0, canvas.width, canvas.height); |
30 c2d.fillStyle = "rgba(255, 0, 0, 0.5)"; | 30 c2d.fillStyle = "rgba(255, 0, 0, 0.5)"; |
31 c2d.fillRect(50, 50, 100, 100); | 31 c2d.fillRect(50, 50, 100, 100); |
32 | 32 |
33 var webglCanvas = document.getElementById("c2"); | 33 var webglCanvas = document.getElementById("c2"); |
34 gl = initGL(webglCanvas); | 34 gl = initGL(webglCanvas); |
35 if (!gl) { | 35 if (!gl) { |
36 console.log('Failed to initialize GL from canvas: ' + webglCanvas); | 36 console.log('Failed to initialize GL from canvas: ' + webglCanvas); |
37 domAutomationController.setAutomationId(1); | |
38 domAutomationController.send("FAILURE"); | 37 domAutomationController.send("FAILURE"); |
39 return; | 38 return; |
40 } | 39 } |
41 | 40 |
42 if (!setup(gl)) { | 41 if (!setup(gl)) { |
43 console.log('Failed to set up GL: ' + gl); | 42 console.log('Failed to set up GL: ' + gl); |
44 domAutomationController.setAutomationId(1); | |
45 domAutomationController.send("FAILURE"); | 43 domAutomationController.send("FAILURE"); |
46 return; | 44 return; |
47 } | 45 } |
48 | 46 |
49 gl.viewport(0, 0, 50, 50); | 47 gl.viewport(0, 0, 50, 50); |
50 | 48 |
51 waitForFinish(); | 49 waitForFinish(); |
52 } | 50 } |
53 | 51 |
54 function waitForFinish() | 52 function waitForFinish() |
55 { | 53 { |
56 if (g_swapsBeforeAck == 0) { | 54 if (g_swapsBeforeAck == 0) { |
57 domAutomationController.setAutomationId(1); | |
58 domAutomationController.send("SUCCESS"); | 55 domAutomationController.send("SUCCESS"); |
59 } else { | 56 } else { |
60 g_swapsBeforeAck--; | 57 g_swapsBeforeAck--; |
61 document.getElementById('container').style.zIndex = g_swapsBeforeAck + 1; | 58 document.getElementById('container').style.zIndex = g_swapsBeforeAck + 1; |
62 drawTriangle(gl); | 59 drawTriangle(gl); |
63 window.requestAnimationFrame(waitForFinish); | 60 window.requestAnimationFrame(waitForFinish); |
64 } | 61 } |
65 } | 62 } |
66 </script> | 63 </script> |
67 </head> | 64 </head> |
68 <body onload="main()"> | 65 <body onload="main()"> |
69 <div style="position:relative; width:300px; height:300px; background-color:black
"> | 66 <div style="position:relative; width:300px; height:300px; background-color:black
"> |
70 </div> | 67 </div> |
71 <div id="container" style="position:absolute; top:0px; left:0px"> | 68 <div id="container" style="position:absolute; top:0px; left:0px"> |
72 <canvas id="c2" width="50" height="50" class="nomargin"></canvas> | 69 <canvas id="c2" width="50" height="50" class="nomargin"></canvas> |
73 <!-- | 70 <!-- |
74 Canvas acceleration requires that the canvas be at least 256x257. | 71 Canvas acceleration requires that the canvas be at least 256x257. |
75 --> | 72 --> |
76 <canvas id="c" width="300" height="300" class="nomargin"></canvas> | 73 <canvas id="c" width="300" height="300" class="nomargin"></canvas> |
77 </div> | 74 </div> |
78 </body> | 75 </body> |
79 </html> | 76 </html> |
OLD | NEW |