diff options
author | bsalomon@google.com <bsalomon@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-29 16:40:46 +0000 |
---|---|---|
committer | bsalomon@google.com <bsalomon@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-08-29 16:40:46 +0000 |
commit | 1620073d2d6ab0e8954fe3d6f2bfb84e98a9554f (patch) | |
tree | 859728ab09463eed345fea9519bf8913507fae34 /ui | |
parent | 96e1933fd50fb512c5e678169d0d2c59841a7d1a (diff) | |
download | chromium_src-1620073d2d6ab0e8954fe3d6f2bfb84e98a9554f.zip chromium_src-1620073d2d6ab0e8954fe3d6f2bfb84e98a9554f.tar.gz chromium_src-1620073d2d6ab0e8954fe3d6f2bfb84e98a9554f.tar.bz2 |
Allow each WGC3D subclass to determine the correct GrGLInterface for its GrContext.
Review URL: http://codereview.chromium.org/7753035
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@98645 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gfx/gl/gl_bindings_skia_in_process.cc | 10 | ||||
-rw-r--r-- | ui/gfx/gl/gl_bindings_skia_in_process.h | 4 |
2 files changed, 8 insertions, 6 deletions
diff --git a/ui/gfx/gl/gl_bindings_skia_in_process.cc b/ui/gfx/gl/gl_bindings_skia_in_process.cc index ae4159e..cd31cf5 100644 --- a/ui/gfx/gl/gl_bindings_skia_in_process.cc +++ b/ui/gfx/gl/gl_bindings_skia_in_process.cc @@ -469,14 +469,14 @@ GLvoid StubGLViewport(GLint x, GLint y, GLsizei width, GLsizei height) { namespace gfx { -void BindSkiaToInProcessGL() { +GrGLInterface* GetInProcessSkiaGLBinding() { static SkAutoTUnref<GrGLInterface> host_gl_interface; if (NULL == host_gl_interface.get()) { GrGLBinding binding; switch (gfx::GetGLImplementation()) { case gfx::kGLImplementationNone: NOTREACHED(); - return; + return NULL; case gfx::kGLImplementationDesktopGL: binding = kDesktop_GrGLBinding; break; @@ -488,10 +488,10 @@ void BindSkiaToInProcessGL() { break; case gfx::kGLImplementationMockGL: NOTREACHED(); - return; + return NULL; default: NOTREACHED(); - return; + return NULL; } GrGLInterface* interface = new GrGLInterface; @@ -602,7 +602,7 @@ void BindSkiaToInProcessGL() { interface->fBindFragDataLocationIndexed = StubBindFragDataLocationIndexedARB; } - GrGLSetDefaultGLInterface(host_gl_interface.get()); + return host_gl_interface.get(); } } // namespace gfx diff --git a/ui/gfx/gl/gl_bindings_skia_in_process.h b/ui/gfx/gl/gl_bindings_skia_in_process.h index 7863fe5..9fa90495 100644 --- a/ui/gfx/gl/gl_bindings_skia_in_process.h +++ b/ui/gfx/gl/gl_bindings_skia_in_process.h @@ -8,11 +8,13 @@ #include "ui/gfx/gl/gl_export.h" +struct GrGLInterface; + namespace gfx { // The GPU back-end for skia requires pointers to GL functions. This function // binds skia-gpu to the in-process GL -GL_EXPORT void BindSkiaToInProcessGL(); +GL_EXPORT GrGLInterface* GetInProcessSkiaGLBinding(); } |