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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 // Get the underlying platform specific surface "handle". | 66 // Get the underlying platform specific surface "handle". |
67 virtual void* GetHandle() = 0; | 67 virtual void* GetHandle() = 0; |
68 | 68 |
69 // Returns whether or not the surface supports PostSubBuffer. | 69 // Returns whether or not the surface supports PostSubBuffer. |
70 virtual bool SupportsPostSubBuffer(); | 70 virtual bool SupportsPostSubBuffer(); |
71 | 71 |
72 // Returns the internal frame buffer object name if the surface is backed by | 72 // Returns the internal frame buffer object name if the surface is backed by |
73 // FBO. Otherwise returns 0. | 73 // FBO. Otherwise returns 0. |
74 virtual unsigned int GetBackingFrameBufferObject(); | 74 virtual unsigned int GetBackingFrameBufferObject(); |
75 | 75 |
76 typedef base::Callback<void()> SwapCompletionCallback; | 76 typedef base::Callback<void(int)> SwapCompletionCallback; |
77 // Swaps front and back buffers. This has no effect for off-screen | 77 // Swaps front and back buffers. This has no effect for off-screen |
78 // contexts. On some platforms, we want to send SwapBufferAck only after the | 78 // contexts. On some platforms, we want to send SwapBufferAck only after the |
79 // surface is displayed on screen. The callback can be used to delay sending | 79 // surface is displayed on screen. The callback can be used to delay sending |
80 // SwapBufferAck till that data is available. The callback should be run on | 80 // SwapBufferAck till that data is available. The callback should be run on |
81 // the calling thread (i.e. same thread SwapBuffersAsync is called) | 81 // the calling thread (i.e. same thread SwapBuffersAsync is called) |
82 virtual bool SwapBuffersAsync(const SwapCompletionCallback& callback); | 82 virtual bool SwapBuffersAsync(const SwapCompletionCallback& callback); |
83 | 83 |
84 // Copy part of the backbuffer to the frontbuffer. | 84 // Copy part of the backbuffer to the frontbuffer. |
85 virtual bool PostSubBuffer(int x, int y, int width, int height); | 85 virtual bool PostSubBuffer(int x, int y, int width, int height); |
86 | 86 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
238 | 238 |
239 private: | 239 private: |
240 scoped_refptr<GLSurface> surface_; | 240 scoped_refptr<GLSurface> surface_; |
241 | 241 |
242 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); | 242 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); |
243 }; | 243 }; |
244 | 244 |
245 } // namespace gfx | 245 } // namespace gfx |
246 | 246 |
247 #endif // UI_GL_GL_SURFACE_H_ | 247 #endif // UI_GL_GL_SURFACE_H_ |
OLD | NEW |