| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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/ozone/platform/cast/gl_ozone_egl_cast.h" | 5 #include "ui/ozone/platform/cast/gl_ozone_egl_cast.h" |
| 6 | 6 |
| 7 #include <EGL/egl.h> | 7 #include <EGL/egl.h> |
| 8 #include <dlfcn.h> | 8 #include <dlfcn.h> |
| 9 | 9 |
| 10 #include <utility> | 10 #include <utility> |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 display_type_ = 0; | 196 display_type_ = 0; |
| 197 have_display_type_ = false; | 197 have_display_type_ = false; |
| 198 } | 198 } |
| 199 } | 199 } |
| 200 | 200 |
| 201 void GLOzoneEglCast::ChildDestroyed() { | 201 void GLOzoneEglCast::ChildDestroyed() { |
| 202 if (egl_platform_->MultipleSurfaceUnsupported()) | 202 if (egl_platform_->MultipleSurfaceUnsupported()) |
| 203 DestroyWindow(); | 203 DestroyWindow(); |
| 204 } | 204 } |
| 205 | 205 |
| 206 bool GLOzoneEglCast::LoadGLES2Bindings() { | 206 bool GLOzoneEglCast::LoadGLES2Bindings(gl::GLImplementation implementation) { |
| 207 if (state_ != kInitialized) { | 207 if (state_ != kInitialized) { |
| 208 InitializeHardware(); | 208 InitializeHardware(); |
| 209 if (state_ != kInitialized) { | 209 if (state_ != kInitialized) { |
| 210 return false; | 210 return false; |
| 211 } | 211 } |
| 212 } | 212 } |
| 213 | 213 |
| 214 void* lib_egl = egl_platform_->GetEglLibrary(); | 214 void* lib_egl = egl_platform_->GetEglLibrary(); |
| 215 void* lib_gles2 = egl_platform_->GetGles2Library(); | 215 void* lib_gles2 = egl_platform_->GetGles2Library(); |
| 216 gl::GLGetProcAddressProc gl_proc = reinterpret_cast<gl::GLGetProcAddressProc>( | 216 gl::GLGetProcAddressProc gl_proc = reinterpret_cast<gl::GLGetProcAddressProc>( |
| 217 egl_platform_->GetGLProcAddressProc()); | 217 egl_platform_->GetGLProcAddressProc()); |
| 218 if (!lib_egl || !lib_gles2 || !gl_proc) { | 218 if (!lib_egl || !lib_gles2 || !gl_proc) { |
| 219 return false; | 219 return false; |
| 220 } | 220 } |
| 221 | 221 |
| 222 gl::SetGLGetProcAddressProc(gl_proc); | 222 gl::SetGLGetProcAddressProc(gl_proc); |
| 223 gl::AddGLNativeLibrary(lib_egl); | 223 gl::AddGLNativeLibrary(lib_egl); |
| 224 gl::AddGLNativeLibrary(lib_gles2); | 224 gl::AddGLNativeLibrary(lib_gles2); |
| 225 return true; | 225 return true; |
| 226 } | 226 } |
| 227 | 227 |
| 228 } // namespace ui | 228 } // namespace ui |
| OLD | NEW |