diff options
author | dhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-21 03:12:17 +0000 |
---|---|---|
committer | dhollowa@chromium.org <dhollowa@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-11-21 03:12:17 +0000 |
commit | 2f47fc457801054fb68055b4649e21af609f81dc (patch) | |
tree | cb31f77630a7465c4001baf2794d25989c20e457 /ui/gfx/gl/gl_surface_mac.cc | |
parent | 21ee224e0862f56ce9d88f2c91950a40cfae6aa0 (diff) | |
download | chromium_src-2f47fc457801054fb68055b4649e21af609f81dc.zip chromium_src-2f47fc457801054fb68055b4649e21af609f81dc.tar.gz chromium_src-2f47fc457801054fb68055b4649e21af609f81dc.tar.bz2 |
compositor_unittests target is unimplmented on Mac
Adds necessary pieces to get the WebKit compositor working with
compositor_unittests target on Mac. Required gyp build flags are:
'use_aura': 1,
'use_webkit_compositor': 1,
'use_skia': 1,
BUG=104390, 104555
TEST=compositor_unittests --gtest_filter=LayerWithRealCompositorTest.* passes and shows correct visual results.
Review URL: http://codereview.chromium.org/8486020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@110875 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/gl/gl_surface_mac.cc')
-rw-r--r-- | ui/gfx/gl/gl_surface_mac.cc | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/ui/gfx/gl/gl_surface_mac.cc b/ui/gfx/gl/gl_surface_mac.cc index 0f6cdd4..ebe3cc3 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( |