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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 the internal frame buffer object name if the surface is backed by | 49 // Returns the internal frame buffer object name if the surface is backed by |
50 // FBO. Otherwise returns 0. | 50 // FBO. Otherwise returns 0. |
51 virtual unsigned int GetBackingFrameBufferObject(); | 51 virtual unsigned int GetBackingFrameBufferObject(); |
52 | 52 |
| 53 // Copy part of the backbuffer to the frontbuffer. |
| 54 virtual bool SupportsPostSubBuffer(); |
| 55 virtual bool PostSubBuffer(int x, int y, int width, int height); |
| 56 |
53 static bool InitializeOneOff(); | 57 static bool InitializeOneOff(); |
54 | 58 |
55 // Called after a context is made current with this surface. Returns false | 59 // Called after a context is made current with this surface. Returns false |
56 // on error. | 60 // on error. |
57 virtual bool OnMakeCurrent(GLContext* context); | 61 virtual bool OnMakeCurrent(GLContext* context); |
58 | 62 |
59 // This gives a hint as to whether this surface is visible. If it is not | 63 // This gives a hint as to whether this surface is visible. If it is not |
60 // visible, the backing store need not be preserved. | 64 // visible, the backing store need not be preserved. |
61 virtual void SetVisible(bool visible); | 65 virtual void SetVisible(bool visible); |
62 | 66 |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 GLSurface* surface() const { return surface_.get(); } | 125 GLSurface* surface() const { return surface_.get(); } |
122 | 126 |
123 private: | 127 private: |
124 scoped_refptr<GLSurface> surface_; | 128 scoped_refptr<GLSurface> surface_; |
125 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); | 129 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); |
126 }; | 130 }; |
127 | 131 |
128 } // namespace gfx | 132 } // namespace gfx |
129 | 133 |
130 #endif // UI_GFX_GL_GL_SURFACE_H_ | 134 #endif // UI_GFX_GL_GL_SURFACE_H_ |
OLD | NEW |