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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 GLContextReal::~GLContextReal() { | 223 GLContextReal::~GLContextReal() { |
224 if (GetRealCurrent() == this) | 224 if (GetRealCurrent() == this) |
225 current_real_context_.Pointer()->Set(nullptr); | 225 current_real_context_.Pointer()->Set(nullptr); |
226 } | 226 } |
227 | 227 |
228 void GLContextReal::SetCurrent(GLSurface* surface) { | 228 void GLContextReal::SetCurrent(GLSurface* surface) { |
229 GLContext::SetCurrent(surface); | 229 GLContext::SetCurrent(surface); |
230 current_real_context_.Pointer()->Set(surface ? this : nullptr); | 230 current_real_context_.Pointer()->Set(surface ? this : nullptr); |
231 } | 231 } |
232 | 232 |
| 233 scoped_refptr<GLContext> InitializeGLContext(scoped_refptr<GLContext> context, |
| 234 GLSurface* compatible_surface, |
| 235 GpuPreference gpu_preference) { |
| 236 if (!context->Initialize(compatible_surface, gpu_preference)) |
| 237 return nullptr; |
| 238 return context; |
| 239 } |
| 240 |
233 } // namespace gl | 241 } // namespace gl |
OLD | NEW |