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