| 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 <memory> | 8 #include <memory> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 143 // Returns the GL renderer string. The context must be current. | 143 // Returns the GL renderer string. The context must be current. |
| 144 virtual std::string GetGLRenderer(); | 144 virtual std::string GetGLRenderer(); |
| 145 | 145 |
| 146 // Returns a helper structure to convert YUV textures to RGB textures. | 146 // Returns a helper structure to convert YUV textures to RGB textures. |
| 147 virtual YUVToRGBConverter* GetYUVToRGBConverter(); | 147 virtual YUVToRGBConverter* GetYUVToRGBConverter(); |
| 148 | 148 |
| 149 // Get the CurrentGL object for this context containing the driver, version | 149 // Get the CurrentGL object for this context containing the driver, version |
| 150 // and API. | 150 // and API. |
| 151 CurrentGL* GetCurrentGL(); | 151 CurrentGL* GetCurrentGL(); |
| 152 | 152 |
| 153 // Reinitialize the dynamic bindings of this context. Needed when the driver |
| 154 // may be exposing different extensions compared to when it was initialized. |
| 155 // TODO(geofflang): Try to make this call uncessessary by pre-loading all |
| 156 // extension entry points. |
| 157 void ReinitializeDynamicBindings(); |
| 158 |
| 153 protected: | 159 protected: |
| 154 virtual ~GLContext(); | 160 virtual ~GLContext(); |
| 155 | 161 |
| 156 // Create the GLApi for this context using the provided driver. Creates a | 162 // Create the GLApi for this context using the provided driver. Creates a |
| 157 // RealGLApi by default. | 163 // RealGLApi by default. |
| 158 virtual GLApi* CreateGLApi(DriverGL* driver); | 164 virtual GLApi* CreateGLApi(DriverGL* driver); |
| 159 | 165 |
| 160 // Will release the current context when going out of scope, unless canceled. | 166 // Will release the current context when going out of scope, unless canceled. |
| 161 class ScopedReleaseCurrent { | 167 class ScopedReleaseCurrent { |
| 162 public: | 168 public: |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 233 // scoped_refptr containing the initialized GLContext or nullptr if | 239 // scoped_refptr containing the initialized GLContext or nullptr if |
| 234 // initialization fails. | 240 // initialization fails. |
| 235 GL_EXPORT scoped_refptr<GLContext> InitializeGLContext( | 241 GL_EXPORT scoped_refptr<GLContext> InitializeGLContext( |
| 236 scoped_refptr<GLContext> context, | 242 scoped_refptr<GLContext> context, |
| 237 GLSurface* compatible_surface, | 243 GLSurface* compatible_surface, |
| 238 const GLContextAttribs& attribs); | 244 const GLContextAttribs& attribs); |
| 239 | 245 |
| 240 } // namespace gl | 246 } // namespace gl |
| 241 | 247 |
| 242 #endif // UI_GL_GL_CONTEXT_H_ | 248 #endif // UI_GL_GL_CONTEXT_H_ |
| OLD | NEW |