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

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

Issue 13913002: More precise native type for context2D (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 8 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
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 CanvasImageSource$IMPLEMENTS$N ATIVESPEC { 7 $(ANNOTATIONS)class $CLASSNAME$EXTENDS implements CanvasImageSource$IMPLEMENTS$N ATIVESPEC {
8 $!MEMBERS 8 $!MEMBERS
9 /** An API for drawing on this canvas. */ 9 /** An API for drawing on this canvas. */
10 $if DART2JS
11 CanvasRenderingContext2D get context2D =>
12 JS('Null|CanvasRenderingContext2D', '#.getContext(#)', this, '2d');
13 $else
10 CanvasRenderingContext2D get context2D => getContext('2d'); 14 CanvasRenderingContext2D get context2D => getContext('2d');
15 $endif
11 16
12 @deprecated 17 @deprecated
13 CanvasRenderingContext2D get context2d => this.context2D; 18 CanvasRenderingContext2D get context2d => this.context2D;
14 19
15 @SupportedBrowser(SupportedBrowser.CHROME) 20 @SupportedBrowser(SupportedBrowser.CHROME)
16 @SupportedBrowser(SupportedBrowser.FIREFOX) 21 @SupportedBrowser(SupportedBrowser.FIREFOX)
17 @Experimental 22 @Experimental
18 gl.RenderingContext getContext3d({alpha: true, depth: true, stencil: false, 23 gl.RenderingContext getContext3d({alpha: true, depth: true, stencil: false,
19 antialias: true, premultipliedAlpha: true, preserveDrawingBuffer: false}) { 24 antialias: true, premultipliedAlpha: true, preserveDrawingBuffer: false}) {
20 25
21 var options = { 26 var options = {
22 'alpha': alpha, 27 'alpha': alpha,
23 'depth': depth, 28 'depth': depth,
24 'stencil': stencil, 29 'stencil': stencil,
25 'antialias': antialias, 30 'antialias': antialias,
26 'premultipliedAlpha': premultipliedAlpha, 31 'premultipliedAlpha': premultipliedAlpha,
27 'preserveDrawingBuffer': preserveDrawingBuffer, 32 'preserveDrawingBuffer': preserveDrawingBuffer,
28 }; 33 };
29 var context = getContext('webgl', options); 34 var context = getContext('webgl', options);
30 if (context == null) { 35 if (context == null) {
31 context = getContext('experimental-webgl', options); 36 context = getContext('experimental-webgl', options);
32 } 37 }
33 return context; 38 return context;
34 } 39 }
35 } 40 }
OLDNEW
« no previous file with comments | « sdk/lib/html/dart2js/html_dart2js.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698