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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
68 virtual unsigned int GetBackingFrameBufferObject(); | 68 virtual unsigned int GetBackingFrameBufferObject(); |
69 | 69 |
70 // Copy part of the backbuffer to the frontbuffer. | 70 // Copy part of the backbuffer to the frontbuffer. |
71 virtual bool PostSubBuffer(int x, int y, int width, int height); | 71 virtual bool PostSubBuffer(int x, int y, int width, int height); |
72 | 72 |
73 // Initialize GL bindings. | 73 // Initialize GL bindings. |
74 static bool InitializeOneOff(); | 74 static bool InitializeOneOff(); |
75 | 75 |
76 // Unit tests should call these instead of InitializeOneOff() to set up | 76 // Unit tests should call these instead of InitializeOneOff() to set up |
77 // GL bindings appropriate for tests. | 77 // GL bindings appropriate for tests. |
78 // TODO(danakj): Once all callers pass true, remove the argument. | 78 static void InitializeOneOffForTests(); |
79 static void InitializeOneOffForTests(bool disable_drawing = false); | |
80 static void InitializeOneOffWithMockBindingsForTests(); | 79 static void InitializeOneOffWithMockBindingsForTests(); |
81 static void InitializeDynamicMockBindingsForTests(GLContext* context); | 80 static void InitializeDynamicMockBindingsForTests(GLContext* context); |
82 | 81 |
83 // Called after a context is made current with this surface. Returns false | 82 // Called after a context is made current with this surface. Returns false |
84 // on error. | 83 // on error. |
85 virtual bool OnMakeCurrent(GLContext* context); | 84 virtual bool OnMakeCurrent(GLContext* context); |
86 | 85 |
87 // Used for explicit buffer management. | 86 // Used for explicit buffer management. |
88 virtual bool SetBackbufferAllocation(bool allocated); | 87 virtual bool SetBackbufferAllocation(bool allocated); |
89 virtual void SetFrontbufferAllocation(bool allocated); | 88 virtual void SetFrontbufferAllocation(bool allocated); |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
168 | 167 |
169 private: | 168 private: |
170 scoped_refptr<GLSurface> surface_; | 169 scoped_refptr<GLSurface> surface_; |
171 | 170 |
172 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); | 171 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); |
173 }; | 172 }; |
174 | 173 |
175 } // namespace gfx | 174 } // namespace gfx |
176 | 175 |
177 #endif // UI_GL_GL_SURFACE_H_ | 176 #endif // UI_GL_GL_SURFACE_H_ |
OLD | NEW |