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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/canvas/canvas-drawImage-svg.html

Issue 2723093004: Adds SVGImageElement as a CanvasImageSource (Closed)
Patch Set: Moved from circle to rect, to avoid aliasing Created 3 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 <style>
3 svg {
4 display: none;
5 }
6 canvas {
7 border: 1px solid black;
8 }
9 </style>
10
11 <svg id="s1" width="200px" height="20px">
12 <image id="img1" href="resources/pattern.png" x="0" y="0" width="20px" height= "20px" />
13 <image id="img2" href="resources/pattern.png" x="20" y="0" width="40px" height ="40px" />
14 <image id="img3" href="resources/pattern.png" x="40" y="0" width="40px" height ="40px" />
15 <image id="img4" href="invalid" x="60" y="0" width="20px" height="20px" />
16 <image id="img5" href="resources/pattern.png" x="80" y="0" width="20px" height ="20px" />
17 <image id="img6" href="resources/rect.svg" x="100" y="0" width="20px" height=" 20px" />
18 <image id="img7" href="resources/empty.svg" x="120" y="0" width="20px" height= "20px" />
19 <image id="img8" href="resources/zeroSize.svg" x="140" y="0" width="20px" heig ht="20px" />
20 </svg>
21
22 <canvas id="c1" width="20" height="20"></canvas>
23 <canvas id="c2" width="20" height="20"></canvas>
24 <canvas id="c3" width="20" height="20"></canvas>
25 <canvas id="c4" width="20" height="20"></canvas>
26 <canvas id="c5" width="20" height="20"></canvas>
27 <canvas id="c6" width="20" height="20"></canvas>
28 <canvas id="c7" width="20" height="20"></canvas>
29 <canvas id="c8" width="20" height="20"></canvas>
30
31 <script>
32 var draw = function(target, img, x, y) {
33 document.getElementById(img).addEventListener("load", function() {
34 document.getElementById(target).getContext("2d").drawImage(
35 document.getElementById(img), x || 0, y || 0);
36 });
37 };
38
39 draw("c1", "img1");
40 draw("c2", "img2", 10, 10);
41 draw("c3", "img3");
42 draw("c4", "img4");
43 document.getElementById("c5").getContext("2d").drawImage(
44 document.getElementById("img5"), 0, 0);
45 draw("c6", "img6");
46 draw("c7", "img7");
47 draw("c8", "img8");
48
49 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698