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

Side by Side Diff: tools/dom/templates/html/impl/impl_CanvasRenderingContext2D.darttemplate

Issue 12775010: Added the CanvasImageSource interface, which all types that a canvas can draw (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 part of $LIBRARYNAME; 5 part of $LIBRARYNAME;
6 6
7 $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC { 7 $(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
8 $!MEMBERS 8 $!MEMBERS
9 9
10 /** 10 /**
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 void setStrokeColorHsl(int h, num s, num l, [num a = 1]) { 42 void setStrokeColorHsl(int h, num s, num l, [num a = 1]) {
43 this.strokeStyle = 'hsla($h, $s%, $l%, $a)'; 43 this.strokeStyle = 'hsla($h, $s%, $l%, $a)';
44 } 44 }
45 45
46 @DomName('CanvasRenderingContext2D.arc') 46 @DomName('CanvasRenderingContext2D.arc')
47 void arc(num x, num y, num radius, num startAngle, num endAngle, 47 void arc(num x, num y, num radius, num startAngle, num endAngle,
48 [bool anticlockwise = false]) { 48 [bool anticlockwise = false]) {
49 $dom_arc(x, y, radius, startAngle, endAngle, anticlockwise); 49 $dom_arc(x, y, radius, startAngle, endAngle, anticlockwise);
50 } 50 }
51 51
52 @DomName('CanvasRenderingContext2D.drawImage')
53 void drawImage(CanvasImageSource source, num x, num y) {
54 $dom_drawImage(source, x, y);
55 }
56
57 @DomName('CanvasRenderingContext2D.drawImage')
58 void drawImageAndScale(CanvasImageSource source, num x, num y, num width, num
blois 2013/03/14 16:24:10 drawImageAtSize? Would also use destinationX, dest
Andrei Mouravski 2013/03/15 00:08:52 Done.
59 height) {
60 $dom_drawImage(source, x, y, width, height);
61 }
62
63 @DomName('CanvasRenderingContext2D.drawImage')
64 void drawImageAndTransform(CanvasImageSource source, num sourceX, num sourceY,
blois 2013/03/14 16:24:10 Might be nice to use rects here (srcRect, destRect
Andrei Mouravski 2013/03/15 00:08:52 Done.
65 num sourceWidth, num sourceHeight, num destinationX, num destinationY,
66 num destinationWidth, num destinationHeight) {
67 $dom_drawImage(source, sourceX, sourceY, sourceWidth, sourceHeight,
68 destinationX, destinationY, destinationWidth, destinationHeight);
69 }
70
52 71
53 $if DART2JS 72 $if DART2JS
54 @DomName('CanvasRenderingContext2D.lineDashOffset') 73 @DomName('CanvasRenderingContext2D.lineDashOffset')
55 num get lineDashOffset => JS('num', 74 num get lineDashOffset => JS('num',
56 '#.lineDashOffset || #.webkitLineDashOffset', this, this); 75 '#.lineDashOffset || #.webkitLineDashOffset', this, this);
57 76
58 @DomName('CanvasRenderingContext2D.lineDashOffset') 77 @DomName('CanvasRenderingContext2D.lineDashOffset')
59 void set lineDashOffset(num value) => JS('void', 78 void set lineDashOffset(num value) => JS('void',
60 'typeof #.lineDashOffset != "undefined" ? #.lineDashOffset = # : ' 79 'typeof #.lineDashOffset != "undefined" ? #.lineDashOffset = # : '
61 '#.webkitLineDashOffset = #', this, this, value, this, value); 80 '#.webkitLineDashOffset = #', this, this, value, this, value);
62 $endif 81 $endif
63 } 82 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698