Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <html> | |
| 3 <head> | |
| 4 <style type="text/css"> | |
| 5 .container { | |
| 6 width: 60px; | |
| 7 height: 60px; | |
| 8 } | |
| 9 #canvas-simple { | |
| 10 /* No box decorations or background image. */ | |
| 11 /* Solid color background only. */ | |
| 12 background-color: green; | |
| 13 } | |
| 14 </style> | |
| 15 <script> | |
| 16 function drawCanvas(canvasID) { | |
| 17 var canvas = document.getElementById(canvasID); | |
| 18 var context = canvas.getContext("2d"); | |
| 19 context.clearRect(0, 0, canvas.width, canvas.height); | |
|
enne (OOO)
2013/07/22 21:57:48
Could you draw something in this canvas too, even
alokp
2013/07/22 23:40:20
DONE. Did the same for WebGL.
| |
| 20 }; | |
| 21 | |
| 22 function doTest() { | |
| 23 // Simple background can be direct-composited with content-layer. | |
| 24 // The container GraphicsLayer does not paint anything. | |
| 25 drawCanvas('canvas-simple'); | |
| 26 }; | |
| 27 window.addEventListener('load', doTest, false); | |
| 28 </script> | |
| 29 </head> | |
| 30 | |
| 31 <body> | |
| 32 <div class="container"> | |
| 33 <canvas id="canvas-simple" width="50" height="50"></canvas> | |
| 34 </div> | |
| 35 </body> | |
| 36 </html> | |
| OLD | NEW |