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

Side by Side Diff: third_party/WebKit/LayoutTests/svg/canvas/canvas-default-object-sizing-expected.html

Issue 2459433003: Turn on Analytic AA in Chrome (Attempt 2) (Closed)
Patch Set: Empty patchset Created 4 years, 1 month 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>Sizing SVG image when drawn to canvas</title>
3 <script>
4 function createCanvas(drawFunc)
5 {
6 var canvas = document.createElement('canvas');
7 canvas.width = 100;
8 canvas.height = 100;
9 document.documentElement.appendChild(canvas);
10
11 drawFunc(canvas.getContext('2d'));
12 }
13
14 function drawCircle(ctx, x, y, r, sx, sy)
15 {
16 ctx.fillStyle = "blue";
17
18 ctx.scale(sx || 1, sy || 1);
19 ctx.beginPath();
20 ctx.arc(x, y, r, 0, 2*Math.PI);
21 ctx.fill();
22 }
23
24 createCanvas(function (ctx) { drawCircle(ctx, 50, 50, 50); });
25 createCanvas(function (ctx) { drawCircle(ctx, 50, 25, 25); });
26 createCanvas(function (ctx) { drawCircle(ctx, 25, 50, 25); });
27 createCanvas(function (ctx) { drawCircle(ctx, 50, 25, 25, 1, 2); });
28 createCanvas(function (ctx) { drawCircle(ctx, 25, 50, 25, 2, 1); });
29 createCanvas(function (ctx) { drawCircle(ctx, 25, 50, 25); });
30 createCanvas(function (ctx) { drawCircle(ctx, 50, 25, 25); });
31 createCanvas(function (ctx) { drawCircle(ctx, 50, 25, 25); });
32 createCanvas(function (ctx) { drawCircle(ctx, 50, 50, 50); });
33 createCanvas(function (ctx) { drawCircle(ctx, 50, 50, 50); });
34 createCanvas(function (ctx) { drawCircle(ctx, 50, 25, 25); drawCircle(ctx, 50, 7 5, 25); });
35 createCanvas(function (ctx) { drawCircle(ctx, 50, 50, 50); });
36
37 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698