| 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 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS implements
CanvasImageSource$IMPLEMENTS { | 7 $(ANNOTATIONS)$(NATIVESPEC)$(CLASS_MODIFIERS)class $CLASSNAME$EXTENDS implements
CanvasImageSource$IMPLEMENTS { |
| 8 $!MEMBERS | 8 $!MEMBERS |
| 9 /** An API for drawing on this canvas. */ | 9 /** An API for drawing on this canvas. */ |
| 10 $if DART2JS | 10 $if DART2JS |
| 11 CanvasRenderingContext2D get context2D => | 11 CanvasRenderingContext2D get context2D => |
| 12 JS('Null|CanvasRenderingContext2D', '#.getContext(#)', this, '2d'); | 12 JS('Null|CanvasRenderingContext2D', '#.getContext(#)', this, '2d'); |
| 13 $else | 13 $else |
| 14 CanvasRenderingContext2D get context2D => getContext('2d'); | 14 CanvasRenderingContext2D get context2D => getContext('2d'); |
| 15 $endif | 15 $endif |
| 16 | 16 |
| 17 /** | 17 /** |
| 18 * Returns a new Web GL context for this canvas. | 18 * Returns a new Web GL context for this canvas. |
| 19 * | 19 * |
| 20 * ## Other resources | 20 * ## Other resources |
| 21 * | 21 * |
| 22 * * [WebGL fundamentals] | 22 * * [WebGL fundamentals](http://www.html5rocks.com/en/tutorials/webgl/webgl_f
undamentals/) |
| 23 * (http://www.html5rocks.com/en/tutorials/webgl/webgl_fundamentals/) from | 23 * from HTML5Rocks. |
| 24 * HTML5Rocks. | 24 * * [WebGL homepage](http://get.webgl.org/). |
| 25 * * [WebGL homepage] (http://get.webgl.org/). | |
| 26 */ | 25 */ |
| 27 @SupportedBrowser(SupportedBrowser.CHROME) | 26 @SupportedBrowser(SupportedBrowser.CHROME) |
| 28 @SupportedBrowser(SupportedBrowser.FIREFOX) | 27 @SupportedBrowser(SupportedBrowser.FIREFOX) |
| 29 @Experimental() | 28 @Experimental() |
| 30 gl.RenderingContext getContext3d({alpha: true, depth: true, stencil: false, | 29 gl.RenderingContext getContext3d({alpha: true, depth: true, stencil: false, |
| 31 antialias: true, premultipliedAlpha: true, preserveDrawingBuffer: false}) { | 30 antialias: true, premultipliedAlpha: true, preserveDrawingBuffer: false}) { |
| 32 | 31 |
| 33 var options = { | 32 var options = { |
| 34 'alpha': alpha, | 33 'alpha': alpha, |
| 35 'depth': depth, | 34 'depth': depth, |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 * | 81 * |
| 83 * * [Data URI Scheme](http://en.wikipedia.org/wiki/Data_URI_scheme) from Wiki
pedia. | 82 * * [Data URI Scheme](http://en.wikipedia.org/wiki/Data_URI_scheme) from Wiki
pedia. |
| 84 * | 83 * |
| 85 * * [HTMLCanvasElement](https://developer.mozilla.org/en-US/docs/DOM/HTMLCanv
asElement) from MDN. | 84 * * [HTMLCanvasElement](https://developer.mozilla.org/en-US/docs/DOM/HTMLCanv
asElement) from MDN. |
| 86 * | 85 * |
| 87 * * [toDataUrl](http://dev.w3.org/html5/spec/the-canvas-element.html#dom-canv
as-todataurl) from W3C. | 86 * * [toDataUrl](http://dev.w3.org/html5/spec/the-canvas-element.html#dom-canv
as-todataurl) from W3C. |
| 88 */ | 87 */ |
| 89 String toDataUrl([String type = 'image/png', num quality]) => | 88 String toDataUrl([String type = 'image/png', num quality]) => |
| 90 _toDataUrl(type, quality); | 89 _toDataUrl(type, quality); |
| 91 } | 90 } |
| OLD | NEW |