| 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 static void InitializeOneOffForTests(); | 78 // TODO(danakj): Once all callers pass true, remove the argument. |
| 79 static void InitializeOneOffForTests(bool disable_drawing = false); |
| 79 static void InitializeOneOffWithMockBindingsForTests(); | 80 static void InitializeOneOffWithMockBindingsForTests(); |
| 80 static void InitializeDynamicMockBindingsForTests(GLContext* context); | 81 static void InitializeDynamicMockBindingsForTests(GLContext* context); |
| 81 | 82 |
| 82 // Called after a context is made current with this surface. Returns false | 83 // Called after a context is made current with this surface. Returns false |
| 83 // on error. | 84 // on error. |
| 84 virtual bool OnMakeCurrent(GLContext* context); | 85 virtual bool OnMakeCurrent(GLContext* context); |
| 85 | 86 |
| 86 // Used for explicit buffer management. | 87 // Used for explicit buffer management. |
| 87 virtual bool SetBackbufferAllocation(bool allocated); | 88 virtual bool SetBackbufferAllocation(bool allocated); |
| 88 virtual void SetFrontbufferAllocation(bool allocated); | 89 virtual void SetFrontbufferAllocation(bool allocated); |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 168 |
| 168 private: | 169 private: |
| 169 scoped_refptr<GLSurface> surface_; | 170 scoped_refptr<GLSurface> surface_; |
| 170 | 171 |
| 171 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); | 172 DISALLOW_COPY_AND_ASSIGN(GLSurfaceAdapter); |
| 172 }; | 173 }; |
| 173 | 174 |
| 174 } // namespace gfx | 175 } // namespace gfx |
| 175 | 176 |
| 176 #endif // UI_GL_GL_SURFACE_H_ | 177 #endif // UI_GL_GL_SURFACE_H_ |
| OLD | NEW |