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

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

Issue 1704493002: Use Image::updateConcreteSize() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add-image-updateconcretesize
Patch Set: Move test here from dependency CL. Created 4 years, 9 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>Sizing SVG image when drawn to canvas</title>
3 <script>
4 function createCircle(x, y, r, sx, sy)
5 {
6 var canvas = document.createElement('canvas');
7 canvas.width = 100;
8 canvas.height = 100;
9 document.documentElement.appendChild(canvas);
10
11 var ctx = canvas.getContext('2d');
12 ctx.fillStyle = "blue";
13
14 ctx.translate(50, 50);
15 ctx.scale(sx || 1, sy || 1);
16 ctx.beginPath();
17 ctx.arc(x, y, r, 0, 2*Math.PI);
18 ctx.fill();
19 }
20 createCircle(0, 0, 50);
21 createCircle(0, -25, 25);
22 createCircle(-25, 0, 25);
23 createCircle(0, 0, 25, 1, 2);
24 createCircle(0, 0, 25, 2, 1);
25 createCircle(-25, 0, 25);
26 createCircle(0, -25, 25);
27 createCircle(0, -25, 25);
28 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698