| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/surface_factory_cast.h" | 5 #include "ui/ozone/platform/cast/surface_factory_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 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 bool SurfaceFactoryCast::LoadEGLGLES2Bindings() { | 314 bool SurfaceFactoryCast::LoadEGLGLES2Bindings() { |
| 315 if (state_ != kInitialized) { | 315 if (state_ != kInitialized) { |
| 316 InitializeHardware(); | 316 InitializeHardware(); |
| 317 if (state_ != kInitialized) { | 317 if (state_ != kInitialized) { |
| 318 return false; | 318 return false; |
| 319 } | 319 } |
| 320 } | 320 } |
| 321 | 321 |
| 322 void* lib_egl = egl_platform_->GetEglLibrary(); | 322 void* lib_egl = egl_platform_->GetEglLibrary(); |
| 323 void* lib_gles2 = egl_platform_->GetGles2Library(); | 323 void* lib_gles2 = egl_platform_->GetGles2Library(); |
| 324 gl::GLGetProcAddressProc gl_proc = egl_platform_->GetGLProcAddressProc(); | 324 gl::GLGetProcAddressProc gl_proc = reinterpret_cast<gl::GLGetProcAddressProc>( |
| 325 egl_platform_->GetGLProcAddressProc()); |
| 325 if (!lib_egl || !lib_gles2 || !gl_proc) { | 326 if (!lib_egl || !lib_gles2 || !gl_proc) { |
| 326 return false; | 327 return false; |
| 327 } | 328 } |
| 328 | 329 |
| 329 gl::SetGLGetProcAddressProc(gl_proc); | 330 gl::SetGLGetProcAddressProc(gl_proc); |
| 330 gl::AddGLNativeLibrary(lib_egl); | 331 gl::AddGLNativeLibrary(lib_egl); |
| 331 gl::AddGLNativeLibrary(lib_gles2); | 332 gl::AddGLNativeLibrary(lib_gles2); |
| 332 return true; | 333 return true; |
| 333 } | 334 } |
| 334 | 335 |
| 335 } // namespace ui | 336 } // namespace ui |
| OLD | NEW |