OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/gl/gl_surface.h" | 5 #include "ui/gl/gl_surface.h" |
6 | 6 |
7 #include <OpenGL/CGLRenderers.h> | 7 #include <OpenGL/CGLRenderers.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 | 10 |
11 #include "base/logging.h" | 11 #include "base/logging.h" |
12 #include "base/macros.h" | 12 #include "base/macros.h" |
13 #include "base/trace_event/trace_event.h" | 13 #include "base/trace_event/trace_event.h" |
14 #include "ui/gl/gl_bindings.h" | 14 #include "ui/gl/gl_bindings.h" |
15 #include "ui/gl/gl_context.h" | 15 #include "ui/gl/gl_context.h" |
16 #include "ui/gl/gl_export.h" | 16 #include "ui/gl/gl_export.h" |
17 #include "ui/gl/gl_implementation.h" | 17 #include "ui/gl/gl_implementation.h" |
18 #include "ui/gl/gl_surface_osmesa.h" | 18 #include "ui/gl/gl_surface_osmesa.h" |
19 #include "ui/gl/gl_surface_stub.h" | 19 #include "ui/gl/gl_surface_stub.h" |
20 #include "ui/gl/gpu_switching_manager.h" | 20 #include "ui/gl/gpu_switching_manager.h" |
21 | 21 |
22 namespace gfx { | 22 namespace gl { |
23 namespace { | 23 namespace { |
24 | 24 |
25 // A "no-op" surface. It is not required that a CGLContextObj have an | 25 // A "no-op" surface. It is not required that a CGLContextObj have an |
26 // associated drawable (pbuffer or fullscreen context) in order to be | 26 // associated drawable (pbuffer or fullscreen context) in order to be |
27 // made current. Everywhere this surface type is used, we allocate an | 27 // made current. Everywhere this surface type is used, we allocate an |
28 // FBO at the user level as the drawable of the associated context. | 28 // FBO at the user level as the drawable of the associated context. |
29 class GL_EXPORT NoOpGLSurface : public GLSurface { | 29 class GL_EXPORT NoOpGLSurface : public GLSurface { |
30 public: | 30 public: |
31 explicit NoOpGLSurface(const gfx::Size& size) : size_(size) {} | 31 explicit NoOpGLSurface(const gfx::Size& size) : size_(size) {} |
32 | 32 |
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 return surface; | 156 return surface; |
157 } | 157 } |
158 case kGLImplementationMockGL: | 158 case kGLImplementationMockGL: |
159 return new GLSurfaceStub; | 159 return new GLSurfaceStub; |
160 default: | 160 default: |
161 NOTREACHED(); | 161 NOTREACHED(); |
162 return NULL; | 162 return NULL; |
163 } | 163 } |
164 } | 164 } |
165 | 165 |
166 } // namespace gfx | 166 } // namespace gl |
OLD | NEW |