| OLD | NEW |
| 1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
| 2 <html> | 2 <html> |
| 3 <head> | 3 <head> |
| 4 <script> | 4 <script> |
| 5 // This browser pixel test checks if the 2D canvas is properly displayed | 5 // This browser pixel test checks if the 2D canvas is properly displayed |
| 6 // when the color space is set to linear-rgb. | 6 // when the color space is set to linear-rgb. |
| 7 | 7 |
| 8 var g_swapsBeforeAck = 15; | 8 var g_swapsBeforeAck = 15; |
| 9 | 9 |
| 10 function main() | 10 function main() |
| 11 { | 11 { |
| 12 draw(); | 12 draw(); |
| 13 waitForFinish(); | 13 waitForFinish(); |
| 14 } | 14 } |
| 15 | 15 |
| 16 function draw() | 16 function draw() |
| 17 { | 17 { |
| 18 var ctx = document.getElementById("c").getContext("2d", {colorSpace:'linear-rg
b'}); | 18 var ctx = document.getElementById("c").getContext("2d", {colorSpace:"srgb", pi
xelFormat: "float16"}); |
| 19 ctx.fillStyle = 'red'; | 19 ctx.fillStyle = 'red'; |
| 20 ctx.fillRect(20,20,50,50); | 20 ctx.fillRect(20,20,50,50); |
| 21 ctx.fillStyle = 'green'; | 21 ctx.fillStyle = 'green'; |
| 22 ctx.fillRect(70,20,50,50); | 22 ctx.fillRect(70,20,50,50); |
| 23 ctx.fillStyle = 'blue'; | 23 ctx.fillStyle = 'blue'; |
| 24 ctx.fillRect(20,70,50,50); | 24 ctx.fillRect(20,70,50,50); |
| 25 ctx.fillStyle = 'black'; | 25 ctx.fillStyle = 'black'; |
| 26 ctx.fillRect(70,70,50,50); | 26 ctx.fillRect(70,70,50,50); |
| 27 } | 27 } |
| 28 | 28 |
| 29 function waitForFinish() | 29 function waitForFinish() |
| 30 { | 30 { |
| 31 if (g_swapsBeforeAck == 0) { | 31 if (g_swapsBeforeAck == 0) { |
| 32 domAutomationController.setAutomationId(1); | 32 domAutomationController.setAutomationId(1); |
| 33 domAutomationController.send("SUCCESS"); | 33 domAutomationController.send("SUCCESS"); |
| 34 } else { | 34 } else { |
| 35 g_swapsBeforeAck--; | 35 g_swapsBeforeAck--; |
| 36 document.getElementById('container').style.zIndex = g_swapsBeforeAck + 1; | 36 document.getElementById('container').style.zIndex = g_swapsBeforeAck + 1; |
| 37 window.webkitRequestAnimationFrame(waitForFinish); | 37 window.webkitRequestAnimationFrame(waitForFinish); |
| 38 } | 38 } |
| 39 } | 39 } |
| 40 </script> | 40 </script> |
| 41 </head> | 41 </head> |
| 42 <body onload="main()"> | 42 <body onload="main()"> |
| 43 <div id="container" style="position:absolute; top:0px; left:0px"> | 43 <div id="container" style="position:absolute; top:0px; left:0px"> |
| 44 <canvas id="c" width="140" height="140"></canvas> | 44 <canvas id="c" width="140" height="140"></canvas> |
| 45 </div> | 45 </div> |
| 46 </body> | 46 </body> |
| 47 </html> | 47 </html> |
| OLD | NEW |