| 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_H_ | 5 #ifndef UI_GFX_GL_GL_SURFACE_H_ |
| 6 #define UI_GFX_GL_GL_SURFACE_H_ | 6 #define UI_GFX_GL_GL_SURFACE_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/memory/ref_counted.h" | 9 #include "base/memory/ref_counted.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 115 friend class base::RefCounted<GLSurface>; | 115 friend class base::RefCounted<GLSurface>; |
| 116 friend class GLContext; | 116 friend class GLContext; |
| 117 DISALLOW_COPY_AND_ASSIGN(GLSurface); | 117 DISALLOW_COPY_AND_ASSIGN(GLSurface); |
| 118 }; | 118 }; |
| 119 | 119 |
| 120 // Implementation of GLSurface that forwards all calls through to another | 120 // Implementation of GLSurface that forwards all calls through to another |
| 121 // GLSurface. | 121 // GLSurface. |
| 122 class GL_EXPORT GLSurfaceAdapter : public GLSurface { | 122 class GL_EXPORT GLSurfaceAdapter : public GLSurface { |
| 123 public: | 123 public: |
| 124 explicit GLSurfaceAdapter(GLSurface* surface); | 124 explicit GLSurfaceAdapter(GLSurface* surface); |
| 125 virtual ~GLSurfaceAdapter(); | |
| 126 | 125 |
| 127 virtual bool Initialize() OVERRIDE; | 126 virtual bool Initialize() OVERRIDE; |
| 128 virtual void Destroy() OVERRIDE; | 127 virtual void Destroy() OVERRIDE; |
| 129 virtual bool Resize(const gfx::Size& size) OVERRIDE; | 128 virtual bool Resize(const gfx::Size& size) OVERRIDE; |
| 130 virtual bool IsOffscreen() OVERRIDE; | 129 virtual bool IsOffscreen() OVERRIDE; |
| 131 virtual bool SwapBuffers() OVERRIDE; | 130 virtual bool SwapBuffers() OVERRIDE; |
| 132 virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE; | 131 virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE; |
| 133 virtual std::string GetExtensions() OVERRIDE; | 132 virtual std::string GetExtensions() OVERRIDE; |
| 134 virtual gfx::Size GetSize() OVERRIDE; | 133 virtual gfx::Size GetSize() OVERRIDE; |
| 135 virtual void* GetHandle() OVERRIDE; | 134 virtual void* GetHandle() OVERRIDE; |
| 136 virtual unsigned int GetBackingFrameBufferObject() OVERRIDE; | 135 virtual unsigned int GetBackingFrameBufferObject() OVERRIDE; |
| 137 virtual bool OnMakeCurrent(GLContext* context) OVERRIDE; | 136 virtual bool OnMakeCurrent(GLContext* context) OVERRIDE; |
| 138 virtual void SetBufferAllocation(BufferAllocationState state) OVERRIDE; | 137 virtual void SetBufferAllocation(BufferAllocationState state) OVERRIDE; |
| 139 virtual void* GetShareHandle() OVERRIDE; | 138 virtual void* GetShareHandle() OVERRIDE; |
| 140 virtual void* GetDisplay() OVERRIDE; | 139 virtual void* GetDisplay() OVERRIDE; |
| 141 virtual void* GetConfig() OVERRIDE; | 140 virtual void* GetConfig() OVERRIDE; |
| 142 virtual unsigned GetFormat() OVERRIDE; | 141 virtual unsigned GetFormat() OVERRIDE; |
| 143 | 142 |
| 144 GLSurface* surface() const { return surface_.get(); } | 143 GLSurface* surface() const { return surface_.get(); } |
| 145 | 144 |
| 145 protected: |
| 146 virtual ~GLSurfaceAdapter(); |
| 147 |
| 146 private: | 148 private: |
| 147 scoped_refptr<GLSurface> surface_; | 149 scoped_refptr<GLSurface> surface_; |
| 148 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); | 150 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); |
| 149 }; | 151 }; |
| 150 | 152 |
| 151 } // namespace gfx | 153 } // namespace gfx |
| 152 | 154 |
| 153 #endif // UI_GFX_GL_GL_SURFACE_H_ | 155 #endif // UI_GFX_GL_GL_SURFACE_H_ |
| OLD | NEW |