OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <meta charset="utf-8"> | 4 <meta charset="utf-8"> |
5 <title>GPU Feature Testing: Accelerated Compositing</title> | 5 <title>GPU Feature Testing: Accelerated Compositing</title> |
6 <style> | 6 <style> |
7 body { | 7 body { |
8 -webkit-transform: translateZ(0); | 8 -webkit-transform: translateZ(0); |
9 } | 9 } |
10 </style> | 10 </style> |
11 <script> | 11 <script> |
12 var frameCount = 0; | 12 var frameCount = 0; |
| 13 // 3 is not enough for threaded compositing, using 6 to avoid racing. |
| 14 var totalRafs = 6; |
13 | 15 |
14 function runTest() { | 16 function runTest() { |
15 window.webkitRequestAnimationFrame(draw); | 17 window.webkitRequestAnimationFrame(draw); |
16 } | 18 } |
17 function draw() { | 19 function draw() { |
18 frameCount++; | 20 frameCount++; |
19 var table = document.getElementById("table"); | 21 var table = document.getElementById("table"); |
20 table.style.backgroundColor = (frameCount & 1) ? 'red' : 'black'; | 22 table.style.backgroundColor = (frameCount & 1) ? 'red' : 'black'; |
21 if (frameCount == 3) { | 23 if (frameCount == totalRafs) { |
22 domAutomationController.setAutomationId(1); | 24 domAutomationController.setAutomationId(1); |
23 domAutomationController.send("FINISHED"); | 25 domAutomationController.send("FINISHED"); |
24 } else { | 26 } else { |
25 window.webkitRequestAnimationFrame(draw); | 27 window.webkitRequestAnimationFrame(draw); |
26 } | 28 } |
27 } | 29 } |
28 </script> | 30 </script> |
29 </head> | 31 </head> |
30 <body onload="runTest()"> | 32 <body onload="runTest()"> |
31 This page should trigger accelerated-compositing, i.e., gpu process should | 33 This page should trigger accelerated-compositing, i.e., gpu process should |
32 launch, if accelerated-compositing is allowed. | 34 launch, if accelerated-compositing is allowed. |
33 <table id="table" width="10" height="10"><tr/></table> | 35 <table id="table" width="10" height="10"><tr/></table> |
34 </body> | 36 </body> |
35 </html> | 37 </html> |
OLD | NEW |