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

Unified Diff: runtime/embedders/openglui/common/extension.cc

Issue 12212074: Support for non-DOM canvases/contexts (backed by bitaps). (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years, 10 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: runtime/embedders/openglui/common/extension.cc
===================================================================
--- runtime/embedders/openglui/common/extension.cc (revision 18200)
+++ runtime/embedders/openglui/common/extension.cc (working copy)
@@ -923,19 +923,8 @@
// 2D Canvas.
-// TODO(gram): this should be dynamic.
-#define MAX_CONTEXTS 16
-CanvasContext* contexts[MAX_CONTEXTS] = { 0 };
-
CanvasContext* display_context;
-CanvasContext* Context2D(int handle) {
- if (handle < 0 || handle >= MAX_CONTEXTS) {
- return NULL;
- }
- return contexts[handle];
-}
-
void C2DCreateNativeContext(Dart_NativeArguments arguments) {
LOGI("In C2DCreateNativeContext");
Dart_EnterScope();
@@ -944,14 +933,10 @@
int width = GetArgAsInt(arguments, 1);
int height = GetArgAsInt(arguments, 2);
- // ASSERT(handle >= 0 && handle < MAX_CONTEXTS &&
- // contexts[handle] == NULL)
- CanvasContext* rtn = new CanvasContext(width, height);
- rtn->Create();
+ CanvasContext* rtn = new CanvasContext(handle, width, height);
if (display_context == NULL) {
display_context = rtn;
}
- contexts[handle] = rtn;
Dart_ExitScope();
LOGI("Out C2DCreateNativeContext");
}

Powered by Google App Engine
This is Rietveld 408576698