 Chromium Code Reviews
 Chromium Code Reviews Issue 501353002:
  Transfer canvas state to the next frame with noticable restrictions.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master
    
  
    Issue 501353002:
  Transfer canvas state to the next frame with noticable restrictions.  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/blink.git@master| OLD | NEW | 
|---|---|
| (Empty) | |
| 1 <!DOCTYPE html> | |
| 2 <title>Canvas.drawImage with narrow destination.</title> | |
| 
zino
2014/09/03 10:50:17
nit: This should be in <head></head>.
 
Sergey
2014/09/11 12:58:52
Layout test re-written.
 | |
| 3 <html> | |
| 4 <body> | |
| 5 <canvas id="myCanvas" width="100" height="100"></canvas> | |
| 6 <script> | |
| 7 var canvas = document.getElementById('myCanvas'); | |
| 8 var context = canvas.getContext('2d'); | |
| 9 var width = 100, height = 100; | |
| 10 var x1 = 0, y1 = 0, w = width, h = height; | |
| 11 | |
| 12 function draw() { | |
| 13 context.restore(); | |
| 14 context.clearRect(0, 0, width, height); | |
| 15 context.beginPath(); | |
| 16 context.rect(x1, y1, w, h); | |
| 17 context.fillStyle = 'blue'; | |
| 18 context.fill(); | |
| 19 x1+=5; | |
| 20 y1+=5; | |
| 21 w-=10; | |
| 22 h-=10; | |
| 23 | |
| 24 context.save(); | |
| 25 context.beginPath(); | |
| 26 context.rect(200, 200, 400, 400); | |
| 27 context.clip(); | |
| 28 | |
| 29 if (w > 0) { | |
| 30 setTimeout(draw, 1); | |
| 31 } else { | |
| 32 finishTest('PASS'); | |
| 33 } | |
| 34 } | |
| 35 | |
| 36 context.beginPath(); | |
| 37 context.rect(0, 0, 800, 800); | |
| 38 context.fillStyle = 'blue'; | |
| 39 context.fill(); | |
| 40 context.save(); | |
| 41 draw(); | |
| 42 function finishTest(output) { | |
| 43 document.write(output); | |
| 44 if (window.testRunner) { | |
| 45 testRunner.dumpAsText(); | |
| 46 testRunner.notifyDone(); | |
| 47 } | |
| 48 } | |
| 49 </script> | |
| 50 </body> | |
| 51 </html> | |
| OLD | NEW |