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

Side by Side Diff: ui/gfx/gl/gl_surface_mac.cc

Issue 7021014: GLContext no longer holds a pointer to a GLSurface. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years, 7 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gfx/gl/gl_surface.h" 5 #include "ui/gfx/gl/gl_surface.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "third_party/mesa/MesaLib/include/GL/osmesa.h" 9 #include "third_party/mesa/MesaLib/include/GL/osmesa.h"
10 #include "ui/gfx/gl/gl_bindings.h" 10 #include "ui/gfx/gl/gl_bindings.h"
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 default: 73 default:
74 NOTREACHED(); 74 NOTREACHED();
75 return NULL; 75 return NULL;
76 } 76 }
77 } 77 }
78 #endif 78 #endif
79 79
80 GLSurface* GLSurface::CreateOffscreenGLSurface(const gfx::Size& size) { 80 GLSurface* GLSurface::CreateOffscreenGLSurface(const gfx::Size& size) {
81 switch (GetGLImplementation()) { 81 switch (GetGLImplementation()) {
82 case kGLImplementationOSMesaGL: { 82 case kGLImplementationOSMesaGL: {
83 scoped_ptr<GLSurfaceOSMesa> surface(new GLSurfaceOSMesa(size)); 83 scoped_ptr<GLSurfaceOSMesa> surface(new GLSurfaceOSMesa(OSMESA_RGBA,
84 size));
84 if (!surface->Initialize()) 85 if (!surface->Initialize())
85 return NULL; 86 return NULL;
86 87
87 return surface.release(); 88 return surface.release();
88 } 89 }
89 case kGLImplementationDesktopGL: { 90 case kGLImplementationDesktopGL: {
90 scoped_ptr<PbufferGLSurfaceCGL> surface(new PbufferGLSurfaceCGL(size)); 91 scoped_ptr<PbufferGLSurfaceCGL> surface(new PbufferGLSurfaceCGL(size));
91 if (!surface->Initialize()) 92 if (!surface->Initialize())
92 return NULL; 93 return NULL;
93 94
94 return surface.release(); 95 return surface.release();
95 } 96 }
96 case kGLImplementationMockGL: 97 case kGLImplementationMockGL:
97 return new GLSurfaceStub; 98 return new GLSurfaceStub;
98 default: 99 default:
99 NOTREACHED(); 100 NOTREACHED();
100 return NULL; 101 return NULL;
101 } 102 }
102 } 103 }
103 104
104 } // namespace gfx 105 } // namespace gfx
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698