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 static bool initialized = false; | 209 bool initialized = InitializeDynamicGLBindings(GetGLImplementation(), this); |
210 if (initialized) | |
211 return initialized; | |
212 initialized = InitializeDynamicGLBindings(GetGLImplementation(), this); | |
213 if (!initialized) | 210 if (!initialized) |
214 LOG(ERROR) << "Could not initialize dynamic bindings."; | 211 LOG(ERROR) << "Could not initialize dynamic bindings."; |
215 return initialized; | 212 return initialized; |
216 } | 213 } |
217 | 214 |
218 void GLContext::SetupForVirtualization() { | 215 void GLContext::SetupForVirtualization() { |
219 if (!virtual_gl_api_) { | 216 if (!virtual_gl_api_) { |
220 virtual_gl_api_.reset(new VirtualGLApi()); | 217 virtual_gl_api_.reset(new VirtualGLApi()); |
221 virtual_gl_api_->Initialize(&g_driver_gl, this); | 218 virtual_gl_api_->Initialize(&g_driver_gl, this); |
222 } | 219 } |
(...skipping 27 matching lines...) Expand all Loading... |
250 } | 247 } |
251 | 248 |
252 GLContextReal::~GLContextReal() {} | 249 GLContextReal::~GLContextReal() {} |
253 | 250 |
254 void GLContextReal::SetCurrent(GLSurface* surface) { | 251 void GLContextReal::SetCurrent(GLSurface* surface) { |
255 GLContext::SetCurrent(surface); | 252 GLContext::SetCurrent(surface); |
256 current_real_context_.Pointer()->Set(surface ? this : nullptr); | 253 current_real_context_.Pointer()->Set(surface ? this : nullptr); |
257 } | 254 } |
258 | 255 |
259 } // namespace gfx | 256 } // namespace gfx |
OLD | NEW |