From 819a0905b29ad7be5599ed2b7285e8a12f3e228f Mon Sep 17 00:00:00 2001 From: Zeno Albisser Date: Thu, 11 Sep 2014 07:48:34 -0700 Subject: gfx::LoadLibrary has been replaced in Chromium by base::LoadNativeLibrary. Adding a local LoadLibrary function to wrap the new call to base::LoadNativeLibrary and do the error handling. Change-Id: Iaab23d3731508fbbf2dadb27d34c53fd65095830 Reviewed-by: Andras Becsi --- src/core/surface_factory_qt.cpp | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/core/surface_factory_qt.cpp b/src/core/surface_factory_qt.cpp index 85b9eb799..23fafb3c9 100644 --- a/src/core/surface_factory_qt.cpp +++ b/src/core/surface_factory_qt.cpp @@ -55,6 +55,16 @@ #define QT_LIBDIR_GLES2 QT_LIBDIR_EGL #endif +base::NativeLibrary LoadLibrary(const base::FilePath& filename) { + base::NativeLibraryLoadError error; + base::NativeLibrary library = base::LoadNativeLibrary(filename, &error); + if (!library) { + LOG(ERROR) << "Failed to load " << filename.MaybeAsASCII() << ": " << error.ToString(); + return NULL; + } + return library; +} + bool SurfaceFactoryQt::LoadEGLGLES2Bindings(AddGLLibraryCallback add_gl_library, SetGLGetProcAddressProcCallback set_gl_get_proc_address) { #if defined(OS_ANDROID) @@ -65,19 +75,15 @@ bool SurfaceFactoryQt::LoadEGLGLES2Bindings(AddGLLibraryCallback add_gl_library, #else base::FilePath libEGLPath = toFilePath(QT_LIBDIR_EGL); libEGLPath = libEGLPath.Append("libEGL.so"); - base::NativeLibrary eglLibrary = gfx::LoadLibrary(libEGLPath); - if (!eglLibrary) { - LOG(ERROR) << "Failed to load EGL: " << libEGLPath.LossyDisplayName(); + base::NativeLibrary eglLibrary = LoadLibrary(libEGLPath); + if (!eglLibrary) return false; - } base::FilePath libGLES2Path = toFilePath(QT_LIBDIR_GLES2); libGLES2Path = libGLES2Path.Append("libGLESv2.so"); - base::NativeLibrary gles2Library = gfx::LoadLibrary(libGLES2Path); - if (!gles2Library) { - LOG(ERROR) << "failed to load GLESv2: " << libGLES2Path.LossyDisplayName(); + base::NativeLibrary gles2Library = LoadLibrary(libGLES2Path); + if (!gles2Library) return false; - } gfx::GLGetProcAddressProc get_proc_address = reinterpret_cast(base::GetFunctionPointerFromNativeLibrary(eglLibrary, "eglGetProcAddress")); if (!get_proc_address) { -- cgit v1.2.3