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

Unified Diff: Source/WebCore/bindings/dart/custom/DartHTMLCanvasElementCustom.cpp

Issue 9231022: WebGL support. (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: Review Created 8 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
Index: Source/WebCore/bindings/dart/custom/DartHTMLCanvasElementCustom.cpp
diff --git a/Source/WebCore/bindings/dart/custom/DartHTMLCanvasElementCustom.cpp b/Source/WebCore/bindings/dart/custom/DartHTMLCanvasElementCustom.cpp
index b66992010fe7c6ffe950396f28a94f84c7204081..7752d07441b40a5c10913e69751dcae8790dddfc 100644
--- a/Source/WebCore/bindings/dart/custom/DartHTMLCanvasElementCustom.cpp
+++ b/Source/WebCore/bindings/dart/custom/DartHTMLCanvasElementCustom.cpp
@@ -30,6 +30,7 @@
#include "config.h"
#include "DartHTMLCanvasElement.h"
+#include "CanvasContextAttributes.h"
#include "CanvasRenderingContext.h"
#include "CanvasRenderingContext2D.h"
#include "DartDOMWrapper.h"
@@ -40,10 +41,10 @@
#include "HTMLCanvasElement.h"
#if ENABLE(WEBGL)
#include "DartUtilities.h"
+#include "WebGLContextAttributes.h"
#include "WebGLRenderingContext.h"
#endif
-
namespace WebCore {
namespace DartHTMLCanvasElementInternal {
@@ -90,8 +91,17 @@ void getContextCallback(Dart_NativeArguments args)
goto fail;
}
- // FIXME: implement support for CanvasContextAttributes.
- CanvasRenderingContext* result = receiver->getContext(contextId, 0);
+ RefPtr<CanvasContextAttributes> attrs;
+#if ENABLE(WEBGL)
+ const String& contextIdStr = contextId;
+ if (contextIdStr == "experimental-webgl" || contextIdStr == "webkit-3d") {
+ attrs = WebGLContextAttributes::create();
+ // FIXME: IDL doesn't mention second argument, but JS
+ // passes map with parameters describing desired context
+ // features.
+ }
+#endif
+ CanvasRenderingContext* result = receiver->getContext(contextId, attrs.get());
if (!result)
return;
if (result->is2d())

Powered by Google App Engine
This is Rietveld 408576698