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

Unified Diff: tools/dom/templates/html/impl/impl_HTMLCanvasElement.darttemplate

Issue 12077039: Adding supported checks for WebGL (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
« tools/dom/idl/dart/dart.idl ('K') | « tools/dom/scripts/systemhtml.py ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/dom/templates/html/impl/impl_HTMLCanvasElement.darttemplate
diff --git a/tools/dom/templates/html/impl/impl_HTMLCanvasElement.darttemplate b/tools/dom/templates/html/impl/impl_HTMLCanvasElement.darttemplate
index 50c46d195684fceceb8e5b0c1c0123aa959e1f4d..d25abfb09553fa4785aca41373051b1405e4ff87 100644
--- a/tools/dom/templates/html/impl/impl_HTMLCanvasElement.darttemplate
+++ b/tools/dom/templates/html/impl/impl_HTMLCanvasElement.darttemplate
@@ -6,9 +6,26 @@ part of html;
$(ANNOTATIONS)class $CLASSNAME$EXTENDS$IMPLEMENTS$NATIVESPEC {
$!MEMBERS
-
-$if DART2JS
- CanvasRenderingContext getContext(String contextId) native;
-$endif
CanvasRenderingContext2D get context2d => getContext('2d');
+
+ @SupportedBrowser(SupportedBrowser.CHROME)
+ @SupportedBrowser(SupportedBrowser.FIREFOX)
+ @Experimental
+ WebGLRenderingContext getContext3d({alpha: true, depth: true, stencil: false,
+ antialias: true, premultipliedAlpha: true, preserveDrawingBuffer: false}) {
+
+ var options = {
+ 'alpha': alpha,
+ 'depth': depth,
+ 'stencil': stencil,
+ 'antialias': antialias,
+ 'premultipliedAlpha': premultipliedAlpha,
+ 'preserveDrawingBuffer': preserveDrawingBuffer,
+ };
+ var context = getContext('webgl', options);
+ if (context == null) {
+ context = getContext('experimental-webgl', options);
+ }
+ return context;
+ }
}
« tools/dom/idl/dart/dart.idl ('K') | « tools/dom/scripts/systemhtml.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698