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 #ifndef UI_GL_GL_SURFACE_CGL_H_ | 5 #ifndef UI_GL_GL_SURFACE_CGL_H_ |
6 #define UI_GL_GL_SURFACE_CGL_H_ | 6 #define UI_GL_GL_SURFACE_CGL_H_ |
7 | 7 |
8 #include "ui/gfx/size.h" | 8 #include "ui/gfx/size.h" |
9 #include "ui/gl/gl_surface.h" | 9 #include "ui/gl/gl_surface.h" |
10 | 10 |
11 namespace gfx { | 11 namespace gfx { |
12 | 12 |
13 // Base class for CGL surfaces. | 13 // Base class for CGL surfaces. |
14 class GLSurfaceCGL : public GLSurface { | 14 class GLSurfaceCGL { |
15 public: | 15 public: |
16 GLSurfaceCGL(); | |
17 | |
18 static bool InitializeOneOff(); | 16 static bool InitializeOneOff(); |
19 static void* GetPixelFormat(); | 17 static void* GetPixelFormat(); |
20 | 18 |
21 protected: | |
22 virtual ~GLSurfaceCGL(); | |
23 | |
24 private: | 19 private: |
| 20 GLSurfaceCGL() {} |
25 DISALLOW_COPY_AND_ASSIGN(GLSurfaceCGL); | 21 DISALLOW_COPY_AND_ASSIGN(GLSurfaceCGL); |
26 }; | 22 }; |
27 | 23 |
28 // A "no-op" surface. It is not required that a CGLContextObj have an | 24 // A "no-op" surface. It is not required that a CGLContextObj have an |
29 // associated drawable (pbuffer or fullscreen context) in order to be | 25 // associated drawable (pbuffer or fullscreen context) in order to be |
30 // made current. Everywhere this surface type is used, we allocate an | 26 // made current. Everywhere this surface type is used, we allocate an |
31 // FBO at the user level as the drawable of the associated context. | 27 // FBO at the user level as the drawable of the associated context. |
32 class GL_EXPORT NoOpGLSurfaceCGL : public GLSurfaceCGL { | 28 class GL_EXPORT NoOpGLSurfaceCGL : public GLSurface { |
33 public: | 29 public: |
34 explicit NoOpGLSurfaceCGL(const gfx::Size& size); | 30 explicit NoOpGLSurfaceCGL(const gfx::Size& size); |
35 | 31 |
36 // Implement GLSurface. | 32 // Implement GLSurface. |
37 virtual bool Initialize() OVERRIDE; | 33 virtual bool Initialize() OVERRIDE; |
38 virtual void Destroy() OVERRIDE; | 34 virtual void Destroy() OVERRIDE; |
39 virtual bool IsOffscreen() OVERRIDE; | 35 virtual bool IsOffscreen() OVERRIDE; |
40 virtual bool SwapBuffers() OVERRIDE; | 36 virtual bool SwapBuffers() OVERRIDE; |
41 virtual gfx::Size GetSize() OVERRIDE; | 37 virtual gfx::Size GetSize() OVERRIDE; |
42 virtual void* GetHandle() OVERRIDE; | 38 virtual void* GetHandle() OVERRIDE; |
43 virtual void* GetDisplay() OVERRIDE; | 39 virtual void* GetDisplay() OVERRIDE; |
44 | 40 |
45 protected: | 41 protected: |
46 virtual ~NoOpGLSurfaceCGL(); | 42 virtual ~NoOpGLSurfaceCGL(); |
47 | 43 |
48 private: | 44 private: |
49 gfx::Size size_; | 45 gfx::Size size_; |
50 | 46 |
51 DISALLOW_COPY_AND_ASSIGN(NoOpGLSurfaceCGL); | 47 DISALLOW_COPY_AND_ASSIGN(NoOpGLSurfaceCGL); |
52 }; | 48 }; |
53 | 49 |
54 } // namespace gfx | 50 } // namespace gfx |
55 | 51 |
56 #endif // UI_GL_GL_SURFACE_CGL_H_ | 52 #endif // UI_GL_GL_SURFACE_CGL_H_ |
OLD | NEW |