| 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 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 83 | 83 |
| 84 // Returns in bytes the total amount of GPU memory for the GPU which this | 84 // Returns in bytes the total amount of GPU memory for the GPU which this |
| 85 // context is currently rendering on. Returns false if no extension exists | 85 // context is currently rendering on. Returns false if no extension exists |
| 86 // to get the exact amount of GPU memory. | 86 // to get the exact amount of GPU memory. |
| 87 virtual bool GetTotalGpuMemory(size_t* bytes); | 87 virtual bool GetTotalGpuMemory(size_t* bytes); |
| 88 | 88 |
| 89 // Indicate that it is safe to force this context to switch GPUs, since | 89 // Indicate that it is safe to force this context to switch GPUs, since |
| 90 // transitioning can cause corruption and hangs (OS X only). | 90 // transitioning can cause corruption and hangs (OS X only). |
| 91 virtual void SetSafeToForceGpuSwitch(); | 91 virtual void SetSafeToForceGpuSwitch(); |
| 92 | 92 |
| 93 // Attempt to force the context to move to the GPU of its sharegroup. Return |
| 94 // false only in the event of an unexpected error on the context. |
| 95 virtual bool ForceGpuSwitchIfNeeded(); |
| 96 |
| 93 // Indicate that the real context switches should unbind the FBO first | 97 // Indicate that the real context switches should unbind the FBO first |
| 94 // (For an Android work-around only). | 98 // (For an Android work-around only). |
| 95 virtual void SetUnbindFboOnMakeCurrent(); | 99 virtual void SetUnbindFboOnMakeCurrent(); |
| 96 | 100 |
| 97 // Returns whether the current context supports the named extension. The | 101 // Returns whether the current context supports the named extension. The |
| 98 // context must be current. | 102 // context must be current. |
| 99 bool HasExtension(const char* name); | 103 bool HasExtension(const char* name); |
| 100 | 104 |
| 101 // Returns version info of the underlying GL context. The context must be | 105 // Returns version info of the underlying GL context. The context must be |
| 102 // current. | 106 // current. |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 190 | 194 |
| 191 void SetCurrent(GLSurface* surface) override; | 195 void SetCurrent(GLSurface* surface) override; |
| 192 | 196 |
| 193 private: | 197 private: |
| 194 DISALLOW_COPY_AND_ASSIGN(GLContextReal); | 198 DISALLOW_COPY_AND_ASSIGN(GLContextReal); |
| 195 }; | 199 }; |
| 196 | 200 |
| 197 } // namespace gfx | 201 } // namespace gfx |
| 198 | 202 |
| 199 #endif // UI_GL_GL_CONTEXT_H_ | 203 #endif // UI_GL_GL_CONTEXT_H_ |
| OLD | NEW |