| OLD | NEW |
| 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 abstract class CanvasRenderingContext { | 7 abstract class CanvasRenderingContext { |
| 8 CanvasElement get canvas; | 8 CanvasElement get canvas; |
| 9 } | 9 } |
| 10 | 10 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 [bool anticlockwise = false]) { | 52 [bool anticlockwise = false]) { |
| 53 // TODO(terry): This should not be needed: dartbug.com/20939. | 53 // TODO(terry): This should not be needed: dartbug.com/20939. |
| 54 $if DART2JS | 54 $if DART2JS |
| 55 JS('void', '#.arc(#, #, #, #, #, #)', this, x, y, radius, startAngle, | 55 JS('void', '#.arc(#, #, #, #, #, #)', this, x, y, radius, startAngle, |
| 56 endAngle, anticlockwise); | 56 endAngle, anticlockwise); |
| 57 $else | 57 $else |
| 58 _arc(x, y, radius, startAngle, endAngle, anticlockwise); | 58 _arc(x, y, radius, startAngle, endAngle, anticlockwise); |
| 59 $endif | 59 $endif |
| 60 } | 60 } |
| 61 | 61 |
| 62 @DomName('CanvasRenderingContext2D.createPatternFromImage') |
| 63 CanvasPattern createPatternFromImage(ImageElement image, String repetitionType
) => |
| 64 $if DART2JS |
| 65 JS('CanvasPattern', '#.createPattern(#, #)', this, image, repetitionType); |
| 66 $else |
| 67 createPattern(image, repetitionType); |
| 68 $endif |
| 69 |
| 62 /** | 70 /** |
| 63 * Draws an image from a CanvasImageSource to an area of this canvas. | 71 * Draws an image from a CanvasImageSource to an area of this canvas. |
| 64 * | 72 * |
| 65 * The image will be drawn to an area of this canvas defined by | 73 * The image will be drawn to an area of this canvas defined by |
| 66 * [destRect]. [sourceRect] defines the region of the source image that is | 74 * [destRect]. [sourceRect] defines the region of the source image that is |
| 67 * drawn. | 75 * drawn. |
| 68 * If [sourceRect] is not provided, then | 76 * If [sourceRect] is not provided, then |
| 69 * the entire rectangular image from [source] will be drawn to this context. | 77 * the entire rectangular image from [source] will be drawn to this context. |
| 70 * | 78 * |
| 71 * If the image is larger than canvas | 79 * If the image is larger than canvas |
| (...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 360 JS('void', '#.fill(#)', this, winding); | 368 JS('void', '#.fill(#)', this, winding); |
| 361 } | 369 } |
| 362 $endif | 370 $endif |
| 363 | 371 |
| 364 /** Deprecated always returns 1.0 */ | 372 /** Deprecated always returns 1.0 */ |
| 365 @DomName('CanvasRenderingContext2D.webkitBackingStorePixelRation') | 373 @DomName('CanvasRenderingContext2D.webkitBackingStorePixelRation') |
| 366 @Experimental() | 374 @Experimental() |
| 367 @deprecated | 375 @deprecated |
| 368 double get backingStorePixelRatio => 1.0; | 376 double get backingStorePixelRatio => 1.0; |
| 369 } | 377 } |
| OLD | NEW |