| Index: tools/dom/templates/html/impl/impl_CanvasRenderingContext2D.darttemplate
|
| diff --git a/tools/dom/templates/html/impl/impl_CanvasRenderingContext2D.darttemplate b/tools/dom/templates/html/impl/impl_CanvasRenderingContext2D.darttemplate
|
| index 74c7d33beab4aaa2ded3bf70ae1d736f0cadc523..a2df9a36ef9bdaee0dbb813e3bd4f38a83d3c43e 100644
|
| --- a/tools/dom/templates/html/impl/impl_CanvasRenderingContext2D.darttemplate
|
| +++ b/tools/dom/templates/html/impl/impl_CanvasRenderingContext2D.darttemplate
|
| @@ -14,11 +14,7 @@ $!MEMBERS
|
| @DomName('CanvasRenderingContext2D.createImageDataFromImageData')
|
| @DocsEditable()
|
| ImageData createImageDataFromImageData(ImageData imagedata) =>
|
| -$if DART2JS
|
| JS('ImageData', '#.createImageData(#)', this, imagedata);
|
| -$else
|
| - this.createImageData(imagedata);
|
| -$endif
|
|
|
| /**
|
| * Sets the color used inside shapes.
|
| @@ -60,21 +56,13 @@ $endif
|
| void arc(num x, num y, num radius, num startAngle, num endAngle,
|
| [bool anticlockwise = false]) {
|
| // TODO(terry): This should not be needed: dartbug.com/20939.
|
| -$if DART2JS
|
| JS('void', '#.arc(#, #, #, #, #, #)', this, x, y, radius, startAngle,
|
| endAngle, anticlockwise);
|
| -$else
|
| - _arc(x, y, radius, startAngle, endAngle, anticlockwise);
|
| -$endif
|
| }
|
|
|
| @DomName('CanvasRenderingContext2D.createPatternFromImage')
|
| CanvasPattern createPatternFromImage(ImageElement image, String repetitionType) =>
|
| -$if DART2JS
|
| JS('CanvasPattern', '#.createPattern(#, #)', this, image, repetitionType);
|
| -$else
|
| - createPattern(image, repetitionType);
|
| -$endif
|
|
|
| /**
|
| * Draws an image from a CanvasImageSource to an area of this canvas.
|
| @@ -119,7 +107,6 @@ $endif
|
| @DomName('CanvasRenderingContext2D.drawImage')
|
| void drawImageToRect(CanvasImageSource source, Rectangle destRect,
|
| {Rectangle sourceRect}) {
|
| -$if DART2JS
|
| if (sourceRect == null) {
|
| drawImageScaled(source,
|
| destRect.left,
|
| @@ -137,25 +124,6 @@ $if DART2JS
|
| destRect.width,
|
| destRect.height);
|
| }
|
| -$else
|
| - if (sourceRect == null) {
|
| - _drawImage(source,
|
| - destRect.left,
|
| - destRect.top,
|
| - destRect.width,
|
| - destRect.height);
|
| - } else {
|
| - _drawImage(source,
|
| - sourceRect.left,
|
| - sourceRect.top,
|
| - sourceRect.width,
|
| - sourceRect.height,
|
| - destRect.left,
|
| - destRect.top,
|
| - destRect.width,
|
| - destRect.height);
|
| - }
|
| -$endif
|
| }
|
|
|
| /**
|
| @@ -188,14 +156,8 @@ $endif
|
| * from the WHATWG.
|
| */
|
| @DomName('CanvasRenderingContext2D.drawImage')
|
| -$if DART2JS
|
| @JSName('drawImage')
|
| void drawImage(CanvasImageSource source, num destX, num destY) native;
|
| -$else
|
| - void drawImage(CanvasImageSource source, num destX, num destY) {
|
| - _drawImage(source, destX, destY);
|
| - }
|
| -$endif
|
|
|
| /**
|
| * Draws an image from a CanvasImageSource to an area of this canvas.
|
| @@ -224,16 +186,9 @@ $endif
|
| * from the WHATWG.
|
| */
|
| @DomName('CanvasRenderingContext2D.drawImage')
|
| -$if DART2JS
|
| @JSName('drawImage')
|
| void drawImageScaled(CanvasImageSource source,
|
| num destX, num destY, num destWidth, num destHeight) native;
|
| -$else
|
| - void drawImageScaled(CanvasImageSource source,
|
| - num destX, num destY, num destWidth, num destHeight) {
|
| - _drawImage(source, destX, destY, destWidth, destHeight);
|
| - }
|
| -$endif
|
|
|
| /**
|
| * Draws an image from a CanvasImageSource to an area of this canvas.
|
| @@ -265,21 +220,11 @@ $endif
|
| * from the WHATWG.
|
| */
|
| @DomName('CanvasRenderingContext2D.drawImage')
|
| -$if DART2JS
|
| @JSName('drawImage')
|
| void drawImageScaledFromSource(CanvasImageSource source,
|
| num sourceX, num sourceY, num sourceWidth, num sourceHeight,
|
| num destX, num destY, num destWidth, num destHeight) native;
|
| -$else
|
| - void drawImageScaledFromSource(CanvasImageSource source,
|
| - num sourceX, num sourceY, num sourceWidth, num sourceHeight,
|
| - num destX, num destY, num destWidth, num destHeight) {
|
| - _drawImage(source, sourceX, sourceY, sourceWidth, sourceHeight,
|
| - destX, destY, destWidth, destHeight);
|
| - }
|
| -$endif
|
|
|
| -$if DART2JS
|
| @SupportedBrowser(SupportedBrowser.CHROME)
|
| @SupportedBrowser(SupportedBrowser.SAFARI)
|
| @SupportedBrowser(SupportedBrowser.IE, '11')
|
| @@ -302,10 +247,6 @@ $if DART2JS
|
| 'typeof #.lineDashOffset != "undefined" ? #.lineDashOffset = # : '
|
| '#.webkitLineDashOffset = #', this, this, value, this, value);
|
| }
|
| -$else
|
| - // TODO(amouravski): Add Dartium native methods for drawImage once we figure
|
| - // out how to not break native bindings.
|
| -$endif
|
|
|
| @SupportedBrowser(SupportedBrowser.CHROME)
|
| @SupportedBrowser(SupportedBrowser.SAFARI)
|
| @@ -315,22 +256,13 @@ $endif
|
| List<num> getLineDash() {
|
| // TODO(14316): Firefox has this functionality with mozDash, but it's a bit
|
| // different.
|
| -$if DART2JS
|
| if (JS('bool', '!!#.getLineDash', this)) {
|
| return JS('List<num>', '#.getLineDash()', this);
|
| } else if (JS('bool', '!!#.webkitLineDash', this)) {
|
| return JS('List<num>', '#.webkitLineDash', this);
|
| }
|
| -$else
|
| - var result = _getLineDash();
|
| - if (result == null) {
|
| - result = [];
|
| - }
|
| - return result;
|
| -$endif
|
| }
|
|
|
| -$if DART2JS
|
| @SupportedBrowser(SupportedBrowser.CHROME)
|
| @SupportedBrowser(SupportedBrowser.SAFARI)
|
| @SupportedBrowser(SupportedBrowser.IE, '11')
|
| @@ -345,9 +277,7 @@ $if DART2JS
|
| JS('void', '#.webkitLineDash = #', this, dash);
|
| }
|
| }
|
| -$endif
|
|
|
| -$if DART2JS
|
|
|
| /**
|
| * Draws text to the canvas.
|
| @@ -376,7 +306,6 @@ $if DART2JS
|
| void fill([String winding = 'nonzero']) {
|
| JS('void', '#.fill(#)', this, winding);
|
| }
|
| -$endif
|
|
|
| /** Deprecated always returns 1.0 */
|
| @DomName('CanvasRenderingContext2D.webkitBackingStorePixelRation')
|
|
|