| 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 43 * [s], [l] are in percent, 0-100. | 43 * [s], [l] are in percent, 0-100. |
| 44 * [a] is 0-1. | 44 * [a] is 0-1. |
| 45 */ | 45 */ |
| 46 void setStrokeColorHsl(int h, num s, num l, [num a = 1]) { | 46 void setStrokeColorHsl(int h, num s, num l, [num a = 1]) { |
| 47 this.strokeStyle = 'hsla($h, $s%, $l%, $a)'; | 47 this.strokeStyle = 'hsla($h, $s%, $l%, $a)'; |
| 48 } | 48 } |
| 49 | 49 |
| 50 @DomName('CanvasRenderingContext2D.arc') | 50 @DomName('CanvasRenderingContext2D.arc') |
| 51 void arc(num x, num y, num radius, num startAngle, num endAngle, | 51 void arc(num x, num y, num radius, num startAngle, num endAngle, |
| 52 [bool anticlockwise = false]) { | 52 [bool anticlockwise = false]) { |
| 53 // TODO(terry): This should not be needed: dartbug.com/20939. |
| 54 $if DART2JS |
| 55 JS('void', '#.arc(#, #, #, #, #, #)', this, x, y, radius, startAngle, |
| 56 endAngle, anticlockwise); |
| 57 $else |
| 53 _arc(x, y, radius, startAngle, endAngle, anticlockwise); | 58 _arc(x, y, radius, startAngle, endAngle, anticlockwise); |
| 59 $endif |
| 54 } | 60 } |
| 55 | 61 |
| 56 /** | 62 /** |
| 57 * Draws an image from a CanvasImageSource to an area of this canvas. | 63 * Draws an image from a CanvasImageSource to an area of this canvas. |
| 58 * | 64 * |
| 59 * The image will be drawn to an area of this canvas defined by | 65 * The image will be drawn to an area of this canvas defined by |
| 60 * [destRect]. [sourceRect] defines the region of the source image that is | 66 * [destRect]. [sourceRect] defines the region of the source image that is |
| 61 * drawn. | 67 * drawn. |
| 62 * If [sourceRect] is not provided, then | 68 * If [sourceRect] is not provided, then |
| 63 * the entire rectangular image from [source] will be drawn to this context. | 69 * the entire rectangular image from [source] will be drawn to this context. |
| (...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 354 JS('void', '#.fill(#)', this, winding); | 360 JS('void', '#.fill(#)', this, winding); |
| 355 } | 361 } |
| 356 $endif | 362 $endif |
| 357 | 363 |
| 358 /** Deprecated always returns 1.0 */ | 364 /** Deprecated always returns 1.0 */ |
| 359 @DomName('CanvasRenderingContext2D.webkitBackingStorePixelRation') | 365 @DomName('CanvasRenderingContext2D.webkitBackingStorePixelRation') |
| 360 @Experimental() | 366 @Experimental() |
| 361 @deprecated | 367 @deprecated |
| 362 double get backingStorePixelRatio => 1.0; | 368 double get backingStorePixelRatio => 1.0; |
| 363 } | 369 } |
| OLD | NEW |