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

Unified Diff: ui/gfx/gl/gl_surface_mac.cc

Issue 8486020: compositor_unittests target is unimplmented on Mac (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address kbr's comments (#14) 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_surface_mac.cc
diff --git a/ui/gfx/gl/gl_surface_mac.cc b/ui/gfx/gl/gl_surface_mac.cc
index 0f6cdd48bb0523a4209ec2cc325c6a83dc3be7de..ebe3cc3811bc861fbe14f7aae69335b0d313c86d 100644
--- a/ui/gfx/gl/gl_surface_mac.cc
+++ b/ui/gfx/gl/gl_surface_mac.cc
@@ -13,6 +13,10 @@
#include "ui/gfx/gl/gl_surface_osmesa.h"
#include "ui/gfx/gl/gl_surface_stub.h"
+#if defined(USE_AURA)
+#include "ui/gfx/gl/gl_surface_nsview.h"
+#endif
+
namespace gfx {
bool GLSurface::InitializeOneOffInternal() {
@@ -32,7 +36,27 @@ bool GLSurface::InitializeOneOffInternal() {
scoped_refptr<GLSurface> GLSurface::CreateViewGLSurface(
bool software,
gfx::PluginWindowHandle window) {
- return CreateOffscreenGLSurface(software, gfx::Size(1, 1));
+#if defined(USE_AURA)
+ if (software)
+ return NULL;
+
+ switch (GetGLImplementation()) {
+ case kGLImplementationDesktopGL: {
+ scoped_refptr<GLSurface> surface(new GLSurfaceNSView(window));
+ if (!surface->Initialize())
+ return NULL;
+
+ return surface;
+ }
+ case kGLImplementationMockGL:
+ return new GLSurfaceStub;
+ default:
+ NOTREACHED();
+ return NULL;
+ }
+#else
+ return CreateOffscreenGLSurface(software, gfx::Size(1,1));
+#endif
}
scoped_refptr<GLSurface> GLSurface::CreateOffscreenGLSurface(

Powered by Google App Engine
This is Rietveld 408576698