diff options
author | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-11 19:41:58 +0000 |
---|---|---|
committer | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-11 19:41:58 +0000 |
commit | 333c5c9ca65425d1796d9d13abda37ecbce2c9fb (patch) | |
tree | 85b92482a6ed18f7be48b153352436be89eb5b3e /ui/gfx/gl/gl_surface_mac.cc | |
parent | 374d9094395c15cd3b337de5c36587312fcc8a1e (diff) | |
download | chromium_src-333c5c9ca65425d1796d9d13abda37ecbce2c9fb.zip chromium_src-333c5c9ca65425d1796d9d13abda37ecbce2c9fb.tar.gz chromium_src-333c5c9ca65425d1796d9d13abda37ecbce2c9fb.tar.bz2 |
Revert 85013 - Split GLContext::Create*GLContext into GLSurface::Create*GLSurface plus a surface type independent GLContext::CreateGLContext.
TEST=webgl on windows and mac, trybots
BUG=none
Review URL: http://codereview.chromium.org/6997003
TBR=apatrick@chromium.org
Review URL: http://codereview.chromium.org/7015003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@85016 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 | 103 |
1 files changed, 0 insertions, 103 deletions
diff --git a/ui/gfx/gl/gl_surface_mac.cc b/ui/gfx/gl/gl_surface_mac.cc deleted file mode 100644 index 2fe1f0e..0000000 --- a/ui/gfx/gl/gl_surface_mac.cc +++ /dev/null @@ -1,103 +0,0 @@ -// Copyright (c) 2011 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ui/gfx/gl/gl_surface.h" - -#include "base/logging.h" -#include "base/memory/scoped_ptr.h" -#include "third_party/mesa/MesaLib/include/GL/osmesa.h" -#include "ui/gfx/gl/gl_bindings.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_stub.h" - -namespace gfx { - -bool GLSurface::InitializeOneOff() { - static bool initialized = false; - if (initialized) - return true; - - static const GLImplementation kAllowedGLImplementations[] = { - kGLImplementationDesktopGL, - kGLImplementationOSMesaGL - }; - - if (!InitializeRequestedGLBindings( - kAllowedGLImplementations, - kAllowedGLImplementations + arraysize(kAllowedGLImplementations), - kGLImplementationDesktopGL)) { - LOG(ERROR) << "InitializeRequestedGLBindings failed."; - return false; - } - - switch (GetGLImplementation()) { - case kGLImplementationDesktopGL: - if (!GLSurfaceCGL::InitializeOneOff()) { - LOG(ERROR) << "GLSurfaceCGL::InitializeOneOff failed."; - return false; - } - break; - default: - break; - } - - initialized = true; - return true; -} - -// TODO(apatrick): support ViewGLSurface on mac. -#if 0 -GLSurface* GLSurface::CreateViewGLSurface(gfx::PluginWindowHandle window) { - switch (GetGLImplementation()) { - case kGLImplementationOSMesaGL: { - scoped_ptr<NativeViewGLSurfaceOSMesa> surface( - new NativeViewGLSurfaceOSMesa(window)); - if (!surface->Initialize()) - return NULL; - - return surface.release(); - } - case kGLImplementationDesktopGL: { - scoped_ptr<NativeViewGLSurfaceCGL> surface(new NativeViewGLSurfaceCGL( - window)); - if (!surface->Initialize()) - return NULL; - - return surface.release(); - } - case kGLImplementationMockGL: - return new GLSurfaceStub; - default: - NOTREACHED(); - return NULL; - } -} -#endif - -GLSurface* GLSurface::CreateOffscreenGLSurface(const gfx::Size& size) { - switch (GetGLImplementation()) { - case kGLImplementationOSMesaGL: { - scoped_ptr<GLSurfaceOSMesa> surface(new GLSurfaceOSMesa()); - surface->Resize(size); - - return surface.release(); - } - case kGLImplementationDesktopGL: { - scoped_ptr<PbufferGLSurfaceCGL> surface(new PbufferGLSurfaceCGL(size)); - if (!surface->Initialize()) - return NULL; - - return surface.release(); - } - case kGLImplementationMockGL: - return new GLSurfaceStub; - default: - NOTREACHED(); - return NULL; - } -} - -} // namespace gfx |