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/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
63 bool HasExtension(const char* name); | 63 bool HasExtension(const char* name); |
64 | 64 |
65 // Returns the internal frame buffer object name if the surface is backed by | 65 // Returns the internal frame buffer object name if the surface is backed by |
66 // FBO. Otherwise returns 0. | 66 // FBO. Otherwise returns 0. |
67 virtual unsigned int GetBackingFrameBufferObject(); | 67 virtual unsigned int GetBackingFrameBufferObject(); |
68 | 68 |
69 // Copy part of the backbuffer to the frontbuffer. | 69 // Copy part of the backbuffer to the frontbuffer. |
70 virtual bool PostSubBuffer(int x, int y, int width, int height); | 70 virtual bool PostSubBuffer(int x, int y, int width, int height); |
71 | 71 |
72 static bool InitializeOneOff(); | 72 static bool InitializeOneOff(); |
| 73 static void InitializeOneOffForTests(); |
| 74 static void InitializeOneOffWithMockBindingsForTests(); |
| 75 static void InitializeDynamicMockBindingsForTests(GLContext* context); |
73 | 76 |
74 // Called after a context is made current with this surface. Returns false | 77 // Called after a context is made current with this surface. Returns false |
75 // on error. | 78 // on error. |
76 virtual bool OnMakeCurrent(GLContext* context); | 79 virtual bool OnMakeCurrent(GLContext* context); |
77 | 80 |
78 // Used for explicit buffer management. | 81 // Used for explicit buffer management. |
79 virtual bool SetBackbufferAllocation(bool allocated); | 82 virtual bool SetBackbufferAllocation(bool allocated); |
80 virtual void SetFrontbufferAllocation(bool allocated); | 83 virtual void SetFrontbufferAllocation(bool allocated); |
81 | 84 |
82 // Get a handle used to share the surface with another process. Returns null | 85 // Get a handle used to share the surface with another process. Returns null |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
155 | 158 |
156 private: | 159 private: |
157 scoped_refptr<GLSurface> surface_; | 160 scoped_refptr<GLSurface> surface_; |
158 | 161 |
159 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); | 162 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); |
160 }; | 163 }; |
161 | 164 |
162 } // namespace gfx | 165 } // namespace gfx |
163 | 166 |
164 #endif // UI_GL_GL_SURFACE_H_ | 167 #endif // UI_GL_GL_SURFACE_H_ |
OLD | NEW |