Index: ui/gl/gl_implementation_x11.cc |
diff --git a/ui/gl/gl_implementation_x11.cc b/ui/gl/gl_implementation_x11.cc |
index afaa319fdf80c9f370fc6751472a8ffd1a666c4f..01ee655ff11b1b5922c7af9801e3d07b74df9546 100644 |
--- a/ui/gl/gl_implementation_x11.cc |
+++ b/ui/gl/gl_implementation_x11.cc |
@@ -4,18 +4,15 @@ |
#include <vector> |
-#include "base/base_paths.h" |
#include "base/command_line.h" |
-#include "base/files/file_path.h" |
#include "base/logging.h" |
-#include "base/native_library.h" |
-#include "base/path_service.h" |
#include "base/threading/thread_restrictions.h" |
#include "ui/gl/gl_bindings.h" |
#include "ui/gl/gl_egl_api_implementation.h" |
#include "ui/gl/gl_gl_api_implementation.h" |
#include "ui/gl/gl_glx_api_implementation.h" |
#include "ui/gl/gl_implementation.h" |
+#include "ui/gl/gl_implementation_linux.h" |
#include "ui/gl/gl_osmesa_api_implementation.h" |
#include "ui/gl/gl_switches.h" |
@@ -33,22 +30,6 @@ void GL_BINDING_CALL MarshalDepthRangeToDepthRangef(GLclampd z_near, |
glDepthRangef(static_cast<GLclampf>(z_near), static_cast<GLclampf>(z_far)); |
} |
-// Load a library, printing an error message on failure. |
-base::NativeLibrary LoadLibrary(const base::FilePath& filename) { |
- std::string error; |
- base::NativeLibrary library = base::LoadNativeLibrary(filename, |
- &error); |
- if (!library) { |
- DVLOG(1) << "Failed to load " << filename.MaybeAsASCII() << ": " << error; |
- return NULL; |
- } |
- return library; |
-} |
- |
-base::NativeLibrary LoadLibrary(const char* filename) { |
- return LoadLibrary(base::FilePath(filename)); |
-} |
- |
} // namespace |
void GetAllowedGLImplementations(std::vector<GLImplementation>* impls) { |
@@ -71,36 +52,8 @@ bool InitializeGLBindings(GLImplementation implementation) { |
base::ThreadRestrictions::ScopedAllowIO allow_io; |
switch (implementation) { |
- case kGLImplementationOSMesaGL: { |
- base::FilePath module_path; |
- if (!PathService::Get(base::DIR_MODULE, &module_path)) { |
- LOG(ERROR) << "PathService::Get failed."; |
- return false; |
- } |
- |
- base::NativeLibrary library = LoadLibrary( |
- module_path.Append("libosmesa.so")); |
- if (!library) |
- return false; |
- |
- GLGetProcAddressProc get_proc_address = |
- reinterpret_cast<GLGetProcAddressProc>( |
- base::GetFunctionPointerFromNativeLibrary( |
- library, "OSMesaGetProcAddress")); |
- if (!get_proc_address) { |
- LOG(ERROR) << "OSMesaGetProcAddress not found."; |
- base::UnloadNativeLibrary(library); |
- return false; |
- } |
- |
- SetGLGetProcAddressProc(get_proc_address); |
- AddGLNativeLibrary(library); |
- SetGLImplementation(kGLImplementationOSMesaGL); |
- |
- InitializeGLBindingsGL(); |
- InitializeGLBindingsOSMESA(); |
- break; |
- } |
+ case kGLImplementationOSMesaGL: |
+ return InitializeGLBindingsOSMesaGL(); |
case kGLImplementationDesktopGL: { |
base::NativeLibrary library = NULL; |
const CommandLine* command_line = CommandLine::ForCurrentProcess(); |