From f62a5abd6205c7a84a19f8b00b45b0792b767f57 Mon Sep 17 00:00:00 2001 From: "apatrick@chromium.org" Date: Mon, 23 May 2011 20:34:15 +0000 Subject: GLContext no longer holds a pointer to a GLSurface. This is part of an ongoing effort to treat GL contexts and GL surfaces as independent entities. TEST=run WebGL on mac, windows and linux, trybots BUG=none Review URL: http://codereview.chromium.org/7021014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86332 0039d316-1c4b-4281-b951-d872f2087c98 --- ui/gfx/gl/gl_context_linux.cc | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) (limited to 'ui/gfx/gl/gl_context_linux.cc') diff --git a/ui/gfx/gl/gl_context_linux.cc b/ui/gfx/gl/gl_context_linux.cc index 3db60f3..b68ed183 100644 --- a/ui/gfx/gl/gl_context_linux.cc +++ b/ui/gfx/gl/gl_context_linux.cc @@ -20,34 +20,26 @@ namespace gfx { -GLContext* GLContext::CreateGLContext(GLSurface* compatible_surface, - GLContext* shared_context) { - scoped_ptr surface(compatible_surface); - +GLContext* GLContext::CreateGLContext(GLContext* shared_context, + GLSurface* compatible_surface) { switch (GetGLImplementation()) { case kGLImplementationOSMesaGL: { - scoped_ptr context( - new GLContextOSMesa(static_cast( - surface.release()))); - if (!context->Initialize(OSMESA_RGBA, shared_context)) + scoped_ptr context(new GLContextOSMesa); + if (!context->Initialize(shared_context, compatible_surface)) return NULL; return context.release(); } case kGLImplementationEGLGLES2: { - scoped_ptr context( - new GLContextEGL( - static_cast(surface.release()))); - if (!context->Initialize(shared_context)) + scoped_ptr context(new GLContextEGL); + if (!context->Initialize(shared_context, compatible_surface)) return NULL; return context.release(); } case kGLImplementationDesktopGL: { - scoped_ptr context( - new GLContextGLX( - static_cast(surface.release()))); - if (!context->Initialize(shared_context)) + scoped_ptr context(new GLContextGLX); + if (!context->Initialize(shared_context, compatible_surface)) return NULL; return context.release(); -- cgit v1.1