| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 virtual void SetSwapInterval(int interval) = 0; | 54 virtual void SetSwapInterval(int interval) = 0; |
| 55 | 55 |
| 56 // Returns space separated list of extensions. The context must be current. | 56 // Returns space separated list of extensions. The context must be current. |
| 57 virtual std::string GetExtensions(); | 57 virtual std::string GetExtensions(); |
| 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 |
| 65 // transitioning can cause corruption and hangs (OS X only). |
| 66 virtual void SetSafeToForceGpuSwitch(); |
| 67 |
| 64 // Returns whether the current context supports the named extension. The | 68 // Returns whether the current context supports the named extension. The |
| 65 // context must be current. | 69 // context must be current. |
| 66 bool HasExtension(const char* name); | 70 bool HasExtension(const char* name); |
| 67 | 71 |
| 68 GLShareGroup* share_group(); | 72 GLShareGroup* share_group(); |
| 69 | 73 |
| 70 // Create a GL context that is compatible with the given surface. | 74 // Create a GL context that is compatible with the given surface. |
| 71 // |share_group|, if non-NULL, is a group of contexts which the | 75 // |share_group|, if non-NULL, is a group of contexts which the |
| 72 // internally created OpenGL context shares textures and other resources. | 76 // internally created OpenGL context shares textures and other resources. |
| 73 static scoped_refptr<GLContext> CreateGLContext( | 77 static scoped_refptr<GLContext> CreateGLContext( |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 | 112 |
| 109 scoped_refptr<GLShareGroup> share_group_; | 113 scoped_refptr<GLShareGroup> share_group_; |
| 110 scoped_ptr<VirtualGLApi> virtual_gl_api_; | 114 scoped_ptr<VirtualGLApi> virtual_gl_api_; |
| 111 | 115 |
| 112 DISALLOW_COPY_AND_ASSIGN(GLContext); | 116 DISALLOW_COPY_AND_ASSIGN(GLContext); |
| 113 }; | 117 }; |
| 114 | 118 |
| 115 } // namespace gfx | 119 } // namespace gfx |
| 116 | 120 |
| 117 #endif // UI_GL_GL_CONTEXT_H_ | 121 #endif // UI_GL_GL_CONTEXT_H_ |
| OLD | NEW |