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 <string> | 5 #include <string> |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/cancelable_callback.h" | 8 #include "base/cancelable_callback.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 force_swap_interval_zero_ = force; | 199 force_swap_interval_zero_ = force; |
200 OnSetSwapInterval(force_swap_interval_zero_ ? 0 : swap_interval_); | 200 OnSetSwapInterval(force_swap_interval_zero_ ? 0 : swap_interval_); |
201 } | 201 } |
202 | 202 |
203 bool GLContext::WasAllocatedUsingRobustnessExtension() { | 203 bool GLContext::WasAllocatedUsingRobustnessExtension() { |
204 return false; | 204 return false; |
205 } | 205 } |
206 | 206 |
207 bool GLContext::InitializeDynamicBindings() { | 207 bool GLContext::InitializeDynamicBindings() { |
208 DCHECK(IsCurrent(nullptr)); | 208 DCHECK(IsCurrent(nullptr)); |
209 bool initialized = InitializeDynamicGLBindings(GetGLImplementation(), this); | 209 static bool initialized = false; |
| 210 if (initialized) |
| 211 return initialized; |
| 212 initialized = InitializeDynamicGLBindings(GetGLImplementation(), this); |
210 if (!initialized) | 213 if (!initialized) |
211 LOG(ERROR) << "Could not initialize dynamic bindings."; | 214 LOG(ERROR) << "Could not initialize dynamic bindings."; |
212 return initialized; | 215 return initialized; |
213 } | 216 } |
214 | 217 |
215 void GLContext::SetupForVirtualization() { | 218 void GLContext::SetupForVirtualization() { |
216 if (!virtual_gl_api_) { | 219 if (!virtual_gl_api_) { |
217 virtual_gl_api_.reset(new VirtualGLApi()); | 220 virtual_gl_api_.reset(new VirtualGLApi()); |
218 virtual_gl_api_->Initialize(&g_driver_gl, this); | 221 virtual_gl_api_->Initialize(&g_driver_gl, this); |
219 } | 222 } |
(...skipping 27 matching lines...) Expand all Loading... |
247 } | 250 } |
248 | 251 |
249 GLContextReal::~GLContextReal() {} | 252 GLContextReal::~GLContextReal() {} |
250 | 253 |
251 void GLContextReal::SetCurrent(GLSurface* surface) { | 254 void GLContextReal::SetCurrent(GLSurface* surface) { |
252 GLContext::SetCurrent(surface); | 255 GLContext::SetCurrent(surface); |
253 current_real_context_.Pointer()->Set(surface ? this : nullptr); | 256 current_real_context_.Pointer()->Set(surface ? this : nullptr); |
254 } | 257 } |
255 | 258 |
256 } // namespace gfx | 259 } // namespace gfx |
OLD | NEW |