| 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_H_ | 5 #ifndef UI_GL_GL_SURFACE_H_ |
| 6 #define UI_GL_GL_SURFACE_H_ | 6 #define UI_GL_GL_SURFACE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 // EGL surface associated to be recreated without destroying the associated | 32 // EGL surface associated to be recreated without destroying the associated |
| 33 // context. The implementation of this function for other GLSurface derived | 33 // context. The implementation of this function for other GLSurface derived |
| 34 // classes is in a pending changelist. | 34 // classes is in a pending changelist. |
| 35 virtual bool Initialize(); | 35 virtual bool Initialize(); |
| 36 | 36 |
| 37 // Destroys the surface. | 37 // Destroys the surface. |
| 38 virtual void Destroy() = 0; | 38 virtual void Destroy() = 0; |
| 39 | 39 |
| 40 virtual bool Resize(const gfx::Size& size); | 40 virtual bool Resize(const gfx::Size& size); |
| 41 | 41 |
| 42 // Recreate the surface without changing the size. |
| 43 virtual bool Recreate(); |
| 44 |
| 42 // Unschedule the GpuScheduler and return true to abort the processing of | 45 // Unschedule the GpuScheduler and return true to abort the processing of |
| 43 // a GL draw call to this surface and defer it until the GpuScheduler is | 46 // a GL draw call to this surface and defer it until the GpuScheduler is |
| 44 // rescheduled. | 47 // rescheduled. |
| 45 virtual bool DeferDraws(); | 48 virtual bool DeferDraws(); |
| 46 | 49 |
| 47 // Returns true if this surface is offscreen. | 50 // Returns true if this surface is offscreen. |
| 48 virtual bool IsOffscreen() = 0; | 51 virtual bool IsOffscreen() = 0; |
| 49 | 52 |
| 50 // Swaps front and back buffers. This has no effect for off-screen | 53 // Swaps front and back buffers. This has no effect for off-screen |
| 51 // contexts. | 54 // contexts. |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 133 |
| 131 // Implementation of GLSurface that forwards all calls through to another | 134 // Implementation of GLSurface that forwards all calls through to another |
| 132 // GLSurface. | 135 // GLSurface. |
| 133 class GL_EXPORT GLSurfaceAdapter : public GLSurface { | 136 class GL_EXPORT GLSurfaceAdapter : public GLSurface { |
| 134 public: | 137 public: |
| 135 explicit GLSurfaceAdapter(GLSurface* surface); | 138 explicit GLSurfaceAdapter(GLSurface* surface); |
| 136 | 139 |
| 137 virtual bool Initialize() OVERRIDE; | 140 virtual bool Initialize() OVERRIDE; |
| 138 virtual void Destroy() OVERRIDE; | 141 virtual void Destroy() OVERRIDE; |
| 139 virtual bool Resize(const gfx::Size& size) OVERRIDE; | 142 virtual bool Resize(const gfx::Size& size) OVERRIDE; |
| 143 virtual bool Recreate() OVERRIDE; |
| 140 virtual bool DeferDraws() OVERRIDE; | 144 virtual bool DeferDraws() OVERRIDE; |
| 141 virtual bool IsOffscreen() OVERRIDE; | 145 virtual bool IsOffscreen() OVERRIDE; |
| 142 virtual bool SwapBuffers() OVERRIDE; | 146 virtual bool SwapBuffers() OVERRIDE; |
| 143 virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE; | 147 virtual bool PostSubBuffer(int x, int y, int width, int height) OVERRIDE; |
| 144 virtual std::string GetExtensions() OVERRIDE; | 148 virtual std::string GetExtensions() OVERRIDE; |
| 145 virtual gfx::Size GetSize() OVERRIDE; | 149 virtual gfx::Size GetSize() OVERRIDE; |
| 146 virtual void* GetHandle() OVERRIDE; | 150 virtual void* GetHandle() OVERRIDE; |
| 147 virtual unsigned int GetBackingFrameBufferObject() OVERRIDE; | 151 virtual unsigned int GetBackingFrameBufferObject() OVERRIDE; |
| 148 virtual bool OnMakeCurrent(GLContext* context) OVERRIDE; | 152 virtual bool OnMakeCurrent(GLContext* context) OVERRIDE; |
| 149 virtual bool SetBackbufferAllocation(bool allocated) OVERRIDE; | 153 virtual bool SetBackbufferAllocation(bool allocated) OVERRIDE; |
| (...skipping 11 matching lines...) Expand all Loading... |
| 161 | 165 |
| 162 private: | 166 private: |
| 163 scoped_refptr<GLSurface> surface_; | 167 scoped_refptr<GLSurface> surface_; |
| 164 | 168 |
| 165 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); | 169 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); |
| 166 }; | 170 }; |
| 167 | 171 |
| 168 } // namespace gfx | 172 } // namespace gfx |
| 169 | 173 |
| 170 #endif // UI_GL_GL_SURFACE_H_ | 174 #endif // UI_GL_GL_SURFACE_H_ |
| OLD | NEW |