Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1074)

Side by Side Diff: LayoutTests/canvas/state-stack.html

Issue 501353002: Transfer canvas state to the next frame with noticable restrictions. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Source code adjustements + [WIP] layout test problems Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/canvas/state-stack-expected.txt » ('j') | Source/platform/graphics/RecordingImageBufferSurface.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698