| 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 #include "ui/gl/gl_context.h" | 5 #include "ui/gl/gl_context.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/cancelable_callback.h" | 10 #include "base/cancelable_callback.h" |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 current_gl_->Driver = driver_gl_.get(); | 131 current_gl_->Driver = driver_gl_.get(); |
| 132 current_gl_->Api = final_api; | 132 current_gl_->Api = final_api; |
| 133 current_gl_->Version = version_info_.get(); | 133 current_gl_->Version = version_info_.get(); |
| 134 | 134 |
| 135 static_bindings_initialized_ = true; | 135 static_bindings_initialized_ = true; |
| 136 } | 136 } |
| 137 | 137 |
| 138 return current_gl_.get(); | 138 return current_gl_.get(); |
| 139 } | 139 } |
| 140 | 140 |
| 141 void GLContext::ReinitializeDynamicBindings() { |
| 142 DCHECK(IsCurrent(nullptr)); |
| 143 dynamic_bindings_initialized_ = false; |
| 144 InitializeDynamicBindings(); |
| 145 } |
| 146 |
| 141 bool GLContext::HasExtension(const char* name) { | 147 bool GLContext::HasExtension(const char* name) { |
| 142 std::string extensions = GetExtensions(); | 148 std::string extensions = GetExtensions(); |
| 143 extensions += " "; | 149 extensions += " "; |
| 144 | 150 |
| 145 std::string delimited_name(name); | 151 std::string delimited_name(name); |
| 146 delimited_name += " "; | 152 delimited_name += " "; |
| 147 | 153 |
| 148 return extensions.find(delimited_name) != std::string::npos; | 154 return extensions.find(delimited_name) != std::string::npos; |
| 149 } | 155 } |
| 150 | 156 |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 | 339 |
| 334 scoped_refptr<GLContext> InitializeGLContext(scoped_refptr<GLContext> context, | 340 scoped_refptr<GLContext> InitializeGLContext(scoped_refptr<GLContext> context, |
| 335 GLSurface* compatible_surface, | 341 GLSurface* compatible_surface, |
| 336 const GLContextAttribs& attribs) { | 342 const GLContextAttribs& attribs) { |
| 337 if (!context->Initialize(compatible_surface, attribs)) | 343 if (!context->Initialize(compatible_surface, attribs)) |
| 338 return nullptr; | 344 return nullptr; |
| 339 return context; | 345 return context; |
| 340 } | 346 } |
| 341 | 347 |
| 342 } // namespace gl | 348 } // namespace gl |
| OLD | NEW |