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

Unified Diff: ui/gfx/gl/gl_context_mac.mm

Issue 8486020: compositor_unittests target is unimplmented on Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address Nico's comments (#2) Created 9 years, 1 month 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: 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;
}

Powered by Google App Engine
This is Rietveld 408576698