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/callback.h" | 10 #include "base/callback.h" |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 virtual gfx::SwapResult CommitOverlayPlanes(); | 122 virtual gfx::SwapResult CommitOverlayPlanes(); |
123 | 123 |
124 // Show overlay planes but don't swap the front and back buffers. On some | 124 // Show overlay planes but don't swap the front and back buffers. On some |
125 // platforms, we want to send SwapBufferAck only after the overlays are | 125 // platforms, we want to send SwapBufferAck only after the overlays are |
126 // displayed on screen. The callback can be used to delay sending | 126 // displayed on screen. The callback can be used to delay sending |
127 // SwapBufferAck till that data is available. The callback should be run on | 127 // SwapBufferAck till that data is available. The callback should be run on |
128 // the calling thread (i.e. same thread CommitOverlayPlanesAsync is called). | 128 // the calling thread (i.e. same thread CommitOverlayPlanesAsync is called). |
129 virtual void CommitOverlayPlanesAsync(const SwapCompletionCallback& callback); | 129 virtual void CommitOverlayPlanesAsync(const SwapCompletionCallback& callback); |
130 | 130 |
131 // Initialize GL bindings. | 131 // Initialize GL bindings. |
| 132 // DEPRECATED(kylechar): Use gl::init::InitializeGLOneOff from gl_factory.h. |
132 static bool InitializeOneOff(); | 133 static bool InitializeOneOff(); |
133 | 134 |
134 // Called after a context is made current with this surface. Returns false | 135 // Called after a context is made current with this surface. Returns false |
135 // on error. | 136 // on error. |
136 virtual bool OnMakeCurrent(GLContext* context); | 137 virtual bool OnMakeCurrent(GLContext* context); |
137 | 138 |
138 // Used for explicit buffer management. | 139 // Used for explicit buffer management. |
139 virtual bool SetBackbufferAllocation(bool allocated); | 140 virtual bool SetBackbufferAllocation(bool allocated); |
140 virtual void SetFrontbufferAllocation(bool allocated); | 141 virtual void SetFrontbufferAllocation(bool allocated); |
141 | 142 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 | 191 |
191 virtual bool IsSurfaceless() const; | 192 virtual bool IsSurfaceless() const; |
192 | 193 |
193 virtual bool FlipsVertically() const; | 194 virtual bool FlipsVertically() const; |
194 | 195 |
195 // Returns true if SwapBuffers or PostSubBuffers causes a flip, such that | 196 // Returns true if SwapBuffers or PostSubBuffers causes a flip, such that |
196 // the next buffer may be 2 frames old. | 197 // the next buffer may be 2 frames old. |
197 virtual bool BuffersFlipped() const; | 198 virtual bool BuffersFlipped() const; |
198 | 199 |
199 // Create a GL surface that renders directly to a view. | 200 // Create a GL surface that renders directly to a view. |
| 201 // DEPRECATED(kylechar): Use gl::init::CreateViewGLSurface from gl_factory.h. |
200 static scoped_refptr<GLSurface> CreateViewGLSurface( | 202 static scoped_refptr<GLSurface> CreateViewGLSurface( |
201 gfx::AcceleratedWidget window); | 203 gfx::AcceleratedWidget window); |
202 | 204 |
203 #if defined(USE_OZONE) | 205 #if defined(USE_OZONE) |
204 // Create a GL surface that renders directly into a window with surfaceless | 206 // Create a GL surface that renders directly into a window with surfaceless |
205 // semantics - there is no default framebuffer and the primary surface must | 207 // semantics - there is no default framebuffer and the primary surface must |
206 // be presented as an overlay. If surfaceless mode is not supported or | 208 // be presented as an overlay. If surfaceless mode is not supported or |
207 // enabled it will return a null pointer. | 209 // enabled it will return a null pointer. |
| 210 // DEPRECATED(kylechar): Use gl::init::CreateSurfacelessViewGLSurface from |
| 211 // gl_factory.h. |
208 static scoped_refptr<GLSurface> CreateSurfacelessViewGLSurface( | 212 static scoped_refptr<GLSurface> CreateSurfacelessViewGLSurface( |
209 gfx::AcceleratedWidget window); | 213 gfx::AcceleratedWidget window); |
210 #endif // defined(USE_OZONE) | 214 #endif // defined(USE_OZONE) |
211 | 215 |
212 // Create a GL surface used for offscreen rendering. | 216 // Create a GL surface used for offscreen rendering. |
| 217 // DEPRECATED(kylechar): Use gl::init::CreateOffscreenGLSurface from |
| 218 // gl_factory.h. |
213 static scoped_refptr<GLSurface> CreateOffscreenGLSurface( | 219 static scoped_refptr<GLSurface> CreateOffscreenGLSurface( |
214 const gfx::Size& size); | 220 const gfx::Size& size); |
215 | 221 |
216 static GLSurface* GetCurrent(); | 222 static GLSurface* GetCurrent(); |
217 | 223 |
218 // Called when the swap interval for the associated context changes. | 224 // Called when the swap interval for the associated context changes. |
219 virtual void OnSetSwapInterval(int interval); | 225 virtual void OnSetSwapInterval(int interval); |
220 | 226 |
221 protected: | 227 protected: |
222 virtual ~GLSurface(); | 228 virtual ~GLSurface(); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
292 | 298 |
293 private: | 299 private: |
294 scoped_refptr<GLSurface> surface_; | 300 scoped_refptr<GLSurface> surface_; |
295 | 301 |
296 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); | 302 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); |
297 }; | 303 }; |
298 | 304 |
299 } // namespace gfx | 305 } // namespace gfx |
300 | 306 |
301 #endif // UI_GL_GL_SURFACE_H_ | 307 #endif // UI_GL_GL_SURFACE_H_ |
OLD | NEW |