| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/init/gl_factory.h" | 5 #include "ui/gl/init/gl_factory.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/trace_event/trace_event.h" | 8 #include "base/trace_event/trace_event.h" |
| 9 #include "ui/gl/gl_bindings.h" | 9 #include "ui/gl/gl_bindings.h" |
| 10 #include "ui/gl/gl_context.h" | 10 #include "ui/gl/gl_context.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 GLNonOwnedContext::GLNonOwnedContext(GLShareGroup* share_group) | 53 GLNonOwnedContext::GLNonOwnedContext(GLShareGroup* share_group) |
| 54 : GLContextReal(share_group), display_(nullptr) {} | 54 : GLContextReal(share_group), display_(nullptr) {} |
| 55 | 55 |
| 56 bool GLNonOwnedContext::Initialize(GLSurface* compatible_surface, | 56 bool GLNonOwnedContext::Initialize(GLSurface* compatible_surface, |
| 57 GpuPreference gpu_preference) { | 57 GpuPreference gpu_preference) { |
| 58 display_ = eglGetDisplay(EGL_DEFAULT_DISPLAY); | 58 display_ = eglGetDisplay(EGL_DEFAULT_DISPLAY); |
| 59 return true; | 59 return true; |
| 60 } | 60 } |
| 61 | 61 |
| 62 bool GLNonOwnedContext::MakeCurrent(GLSurface* surface) { | 62 bool GLNonOwnedContext::MakeCurrent(GLSurface* surface) { |
| 63 SetRealGLApi(); |
| 63 SetCurrent(surface); | 64 SetCurrent(surface); |
| 64 SetRealGLApi(); | 65 InitializeDynamicBindings(); |
| 65 return true; | 66 return true; |
| 66 } | 67 } |
| 67 | 68 |
| 68 std::string GLNonOwnedContext::GetExtensions() { | 69 std::string GLNonOwnedContext::GetExtensions() { |
| 69 const char* extensions = eglQueryString(display_, EGL_EXTENSIONS); | 70 const char* extensions = eglQueryString(display_, EGL_EXTENSIONS); |
| 70 if (!extensions) | 71 if (!extensions) |
| 71 return GLContext::GetExtensions(); | 72 return GLContext::GetExtensions(); |
| 72 | 73 |
| 73 return GLContext::GetExtensions() + " " + extensions; | 74 return GLContext::GetExtensions() + " " + extensions; |
| 74 } | 75 } |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 150 case kGLImplementationMockGL: | 151 case kGLImplementationMockGL: |
| 151 return new GLSurfaceStub; | 152 return new GLSurfaceStub; |
| 152 default: | 153 default: |
| 153 NOTREACHED(); | 154 NOTREACHED(); |
| 154 return nullptr; | 155 return nullptr; |
| 155 } | 156 } |
| 156 } | 157 } |
| 157 | 158 |
| 158 } // namespace init | 159 } // namespace init |
| 159 } // namespace gl | 160 } // namespace gl |
| OLD | NEW |