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_CONTEXT_H_ | 5 #ifndef UI_GL_GL_CONTEXT_H_ |
6 #define UI_GL_GL_CONTEXT_H_ | 6 #define UI_GL_GL_CONTEXT_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
58 | 58 |
59 // Returns in bytes the total amount of GPU memory for the GPU which this | 59 // Returns in bytes the total amount of GPU memory for the GPU which this |
60 // context is currently rendering on. Returns false if no extension exists | 60 // context is currently rendering on. Returns false if no extension exists |
61 // to get the exact amount of GPU memory. | 61 // to get the exact amount of GPU memory. |
62 virtual bool GetTotalGpuMemory(size_t* bytes); | 62 virtual bool GetTotalGpuMemory(size_t* bytes); |
63 | 63 |
64 // Indicate that it is safe to force this context to switch GPUs, since | 64 // Indicate that it is safe to force this context to switch GPUs, since |
65 // transitioning can cause corruption and hangs (OS X only). | 65 // transitioning can cause corruption and hangs (OS X only). |
66 virtual void SetSafeToForceGpuSwitch(); | 66 virtual void SetSafeToForceGpuSwitch(); |
67 | 67 |
| 68 // Indicate that the real context switches should recreate the surface |
| 69 // (For an Android work-around only). |
| 70 virtual void SetRecreateSurfaceOnMakeCurrent(); |
| 71 |
68 // Returns whether the current context supports the named extension. The | 72 // Returns whether the current context supports the named extension. The |
69 // context must be current. | 73 // context must be current. |
70 bool HasExtension(const char* name); | 74 bool HasExtension(const char* name); |
71 | 75 |
72 GLShareGroup* share_group(); | 76 GLShareGroup* share_group(); |
73 | 77 |
74 // Create a GL context that is compatible with the given surface. | 78 // Create a GL context that is compatible with the given surface. |
75 // |share_group|, if non-NULL, is a group of contexts which the | 79 // |share_group|, if non-NULL, is a group of contexts which the |
76 // internally created OpenGL context shares textures and other resources. | 80 // internally created OpenGL context shares textures and other resources. |
77 static scoped_refptr<GLContext> CreateGLContext( | 81 static scoped_refptr<GLContext> CreateGLContext( |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 | 116 |
113 scoped_refptr<GLShareGroup> share_group_; | 117 scoped_refptr<GLShareGroup> share_group_; |
114 scoped_ptr<VirtualGLApi> virtual_gl_api_; | 118 scoped_ptr<VirtualGLApi> virtual_gl_api_; |
115 | 119 |
116 DISALLOW_COPY_AND_ASSIGN(GLContext); | 120 DISALLOW_COPY_AND_ASSIGN(GLContext); |
117 }; | 121 }; |
118 | 122 |
119 } // namespace gfx | 123 } // namespace gfx |
120 | 124 |
121 #endif // UI_GL_GL_CONTEXT_H_ | 125 #endif // UI_GL_GL_CONTEXT_H_ |
OLD | NEW |