| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 virtual bool SupportsPostSubBuffer(); | 89 virtual bool SupportsPostSubBuffer(); |
| 90 | 90 |
| 91 // Returns whether or not the surface supports CommitOverlayPlanes. | 91 // Returns whether or not the surface supports CommitOverlayPlanes. |
| 92 virtual bool SupportsCommitOverlayPlanes(); | 92 virtual bool SupportsCommitOverlayPlanes(); |
| 93 | 93 |
| 94 // Returns whether SwapBuffersAsync() is supported. | 94 // Returns whether SwapBuffersAsync() is supported. |
| 95 virtual bool SupportsAsyncSwap(); | 95 virtual bool SupportsAsyncSwap(); |
| 96 | 96 |
| 97 // Returns the internal frame buffer object name if the surface is backed by | 97 // Returns the internal frame buffer object name if the surface is backed by |
| 98 // FBO. Otherwise returns 0. | 98 // FBO. Otherwise returns 0. |
| 99 virtual unsigned int GetBackingFrameBufferObject(); | 99 virtual unsigned int GetBackingFramebufferObject(); |
| 100 | 100 |
| 101 typedef base::Callback<void(gfx::SwapResult)> SwapCompletionCallback; | 101 typedef base::Callback<void(gfx::SwapResult)> SwapCompletionCallback; |
| 102 // Swaps front and back buffers. This has no effect for off-screen | 102 // Swaps front and back buffers. This has no effect for off-screen |
| 103 // contexts. On some platforms, we want to send SwapBufferAck only after the | 103 // contexts. On some platforms, we want to send SwapBufferAck only after the |
| 104 // surface is displayed on screen. The callback can be used to delay sending | 104 // surface is displayed on screen. The callback can be used to delay sending |
| 105 // SwapBufferAck till that data is available. The callback should be run on | 105 // SwapBufferAck till that data is available. The callback should be run on |
| 106 // the calling thread (i.e. same thread SwapBuffersAsync is called) | 106 // the calling thread (i.e. same thread SwapBuffersAsync is called) |
| 107 virtual void SwapBuffersAsync(const SwapCompletionCallback& callback); | 107 virtual void SwapBuffersAsync(const SwapCompletionCallback& callback); |
| 108 | 108 |
| 109 // Copy part of the backbuffer to the frontbuffer. | 109 // Copy part of the backbuffer to the frontbuffer. |
| (...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 int height, | 239 int height, |
| 240 const SwapCompletionCallback& callback) override; | 240 const SwapCompletionCallback& callback) override; |
| 241 gfx::SwapResult CommitOverlayPlanes() override; | 241 gfx::SwapResult CommitOverlayPlanes() override; |
| 242 void CommitOverlayPlanesAsync( | 242 void CommitOverlayPlanesAsync( |
| 243 const SwapCompletionCallback& callback) override; | 243 const SwapCompletionCallback& callback) override; |
| 244 bool SupportsPostSubBuffer() override; | 244 bool SupportsPostSubBuffer() override; |
| 245 bool SupportsCommitOverlayPlanes() override; | 245 bool SupportsCommitOverlayPlanes() override; |
| 246 bool SupportsAsyncSwap() override; | 246 bool SupportsAsyncSwap() override; |
| 247 gfx::Size GetSize() override; | 247 gfx::Size GetSize() override; |
| 248 void* GetHandle() override; | 248 void* GetHandle() override; |
| 249 unsigned int GetBackingFrameBufferObject() override; | 249 unsigned int GetBackingFramebufferObject() override; |
| 250 bool OnMakeCurrent(GLContext* context) override; | 250 bool OnMakeCurrent(GLContext* context) override; |
| 251 bool SetBackbufferAllocation(bool allocated) override; | 251 bool SetBackbufferAllocation(bool allocated) override; |
| 252 void SetFrontbufferAllocation(bool allocated) override; | 252 void SetFrontbufferAllocation(bool allocated) override; |
| 253 void* GetShareHandle() override; | 253 void* GetShareHandle() override; |
| 254 void* GetDisplay() override; | 254 void* GetDisplay() override; |
| 255 void* GetConfig() override; | 255 void* GetConfig() override; |
| 256 GLSurface::Format GetFormat() override; | 256 GLSurface::Format GetFormat() override; |
| 257 gfx::VSyncProvider* GetVSyncProvider() override; | 257 gfx::VSyncProvider* GetVSyncProvider() override; |
| 258 bool ScheduleOverlayPlane(int z_order, | 258 bool ScheduleOverlayPlane(int z_order, |
| 259 gfx::OverlayTransform transform, | 259 gfx::OverlayTransform transform, |
| (...skipping 17 matching lines...) Expand all Loading... |
| 277 | 277 |
| 278 // Wraps GLSurface in scoped_refptr and tries to initializes it. Returns a | 278 // Wraps GLSurface in scoped_refptr and tries to initializes it. Returns a |
| 279 // scoped_refptr containing the initialized GLSurface or nullptr if | 279 // scoped_refptr containing the initialized GLSurface or nullptr if |
| 280 // initialization fails. | 280 // initialization fails. |
| 281 GL_EXPORT scoped_refptr<GLSurface> InitializeGLSurface( | 281 GL_EXPORT scoped_refptr<GLSurface> InitializeGLSurface( |
| 282 scoped_refptr<GLSurface> surface); | 282 scoped_refptr<GLSurface> surface); |
| 283 | 283 |
| 284 } // namespace gl | 284 } // namespace gl |
| 285 | 285 |
| 286 #endif // UI_GL_GL_SURFACE_H_ | 286 #endif // UI_GL_GL_SURFACE_H_ |
| OLD | NEW |