OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 28 matching lines...) Expand all Loading... |
39 // Swaps front and back buffers. This has no effect for off-screen | 39 // Swaps front and back buffers. This has no effect for off-screen |
40 // contexts. | 40 // contexts. |
41 virtual bool SwapBuffers() = 0; | 41 virtual bool SwapBuffers() = 0; |
42 | 42 |
43 // Get the size of the surface. | 43 // Get the size of the surface. |
44 virtual gfx::Size GetSize() = 0; | 44 virtual gfx::Size GetSize() = 0; |
45 | 45 |
46 // Get the underlying platform specific surface "handle". | 46 // Get the underlying platform specific surface "handle". |
47 virtual void* GetHandle() = 0; | 47 virtual void* GetHandle() = 0; |
48 | 48 |
| 49 // Returns space separated list of surface specific extensions. |
| 50 // The surface must be current. |
| 51 virtual std::string GetExtensions(); |
| 52 |
49 // Returns the internal frame buffer object name if the surface is backed by | 53 // Returns the internal frame buffer object name if the surface is backed by |
50 // FBO. Otherwise returns 0. | 54 // FBO. Otherwise returns 0. |
51 virtual unsigned int GetBackingFrameBufferObject(); | 55 virtual unsigned int GetBackingFrameBufferObject(); |
52 | 56 |
53 // Copy part of the backbuffer to the frontbuffer. | 57 // Copy part of the backbuffer to the frontbuffer. |
54 virtual bool SupportsPostSubBuffer(); | |
55 virtual bool PostSubBuffer(int x, int y, int width, int height); | 58 virtual bool PostSubBuffer(int x, int y, int width, int height); |
56 | 59 |
57 static bool InitializeOneOff(); | 60 static bool InitializeOneOff(); |
58 | 61 |
59 // Called after a context is made current with this surface. Returns false | 62 // Called after a context is made current with this surface. Returns false |
60 // on error. | 63 // on error. |
61 virtual bool OnMakeCurrent(GLContext* context); | 64 virtual bool OnMakeCurrent(GLContext* context); |
62 | 65 |
63 // This gives a hint as to whether this surface is visible. If it is not | 66 // This gives a hint as to whether this surface is visible. If it is not |
64 // visible, the backing store need not be preserved. | 67 // visible, the backing store need not be preserved. |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 GLSurface* surface() const { return surface_.get(); } | 128 GLSurface* surface() const { return surface_.get(); } |
126 | 129 |
127 private: | 130 private: |
128 scoped_refptr<GLSurface> surface_; | 131 scoped_refptr<GLSurface> surface_; |
129 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); | 132 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); |
130 }; | 133 }; |
131 | 134 |
132 } // namespace gfx | 135 } // namespace gfx |
133 | 136 |
134 #endif // UI_GFX_GL_GL_SURFACE_H_ | 137 #endif // UI_GFX_GL_GL_SURFACE_H_ |
OLD | NEW |