Index: ui/gfx/gl/gl_context_mac.mm |
diff --git a/ui/gfx/gl/gl_context_mac.cc b/ui/gfx/gl/gl_context_mac.mm |
similarity index 86% |
rename from ui/gfx/gl/gl_context_mac.cc |
rename to ui/gfx/gl/gl_context_mac.mm |
index 0c870e21726672dff608fe795a4d5fea110b7b4a..9bd7aef5b1612c5076fa22a193e0b31238d75cc2 100644 |
--- a/ui/gfx/gl/gl_context_mac.cc |
+++ b/ui/gfx/gl/gl_context_mac.mm |
@@ -13,8 +13,11 @@ |
#include "ui/gfx/gl/gl_context_osmesa.h" |
#include "ui/gfx/gl/gl_context_stub.h" |
#include "ui/gfx/gl/gl_implementation.h" |
-#include "ui/gfx/gl/gl_surface_cgl.h" |
-#include "ui/gfx/gl/gl_surface_osmesa.h" |
+#include "ui/gfx/gl/gl_surface.h" |
+ |
+#if defined(USE_WEBKIT_COMPOSITOR) |
+#include "ui/gfx/gl/gl_context_nsview.h" |
+#endif |
namespace { |
@@ -38,9 +41,18 @@ scoped_refptr<GLContext> GLContext::CreateGLContext( |
GpuPreference gpu_preference) { |
switch (GetGLImplementation()) { |
case kGLImplementationDesktopGL: { |
- scoped_refptr<GLContext> context(new GLContextCGL(share_group)); |
- if (!context->Initialize(compatible_surface, gpu_preference)) |
- return NULL; |
+ scoped_refptr<GLContext> context; |
+ if (compatible_surface->IsOffscreen()) { |
+ context = new GLContextCGL(share_group); |
+ if (!context->Initialize(compatible_surface, gpu_preference)) |
+ return NULL; |
+ } else { |
+#if defined(USE_WEBKIT_COMPOSITOR) |
piman
2011/11/16 20:55:59
I don't think USE_WEBKIT_COMPOSITOR ought to have
dhollowa
2011/11/16 23:28:59
Due to the different definition of the PluginWindo
|
+ context = new GLContextNSView(share_group); |
+ if (!context->Initialize(compatible_surface, gpu_preference)) |
+ return NULL; |
+#endif |
+ } |
return context; |
} |