Index: ui/gl/init/gl_initializer_x11.cc |
diff --git a/ui/gl/init/gl_initializer_x11.cc b/ui/gl/init/gl_initializer_x11.cc |
index fc8435d3eacec296067896c236bc87c1e2cf9d31..511d17368a283aff90a6a967f75e855eee600c33 100644 |
--- a/ui/gl/init/gl_initializer_x11.cc |
+++ b/ui/gl/init/gl_initializer_x11.cc |
@@ -192,5 +192,40 @@ void ClearGLBindingsPlatform() { |
ClearGLBindingsOSMESA(); |
} |
+bool GetNativeLibraryNamesFromGLImplementationPlatform( |
+ GLImplementation implementation, |
+ std::vector<std::string>* required_libraries) { |
+ DCHECK(required_libraries); |
+ required_libraries->clear(); |
+ |
+ switch (implementation) { |
+ case kGLImplementationDesktopGL: |
+ required_libraries->push_back(kGLLibraryName); |
+ break; |
+ case kGLImplementationEGLGLES2: { |
+ base::FilePath glesv2_path(kGLESv2LibraryName); |
+ base::FilePath egl_path(kEGLLibraryName); |
+ |
+ if (base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
+ switches::kUseGL) == kGLImplementationANGLEName) { |
+ base::FilePath module_path; |
+ if (!PathService::Get(base::DIR_MODULE, &module_path)) |
+ return false; |
+ |
+ glesv2_path = module_path.Append(kGLESv2ANGLELibraryName); |
+ egl_path = module_path.Append(kEGLANGLELibraryName); |
+ } |
+ |
+ required_libraries->push_back(glesv2_path.value()); |
+ required_libraries->push_back(egl_path.value()); |
+ break; |
+ } |
+ default: |
+ return false; |
+ } |
+ |
+ return true; |
+} |
+ |
} // namespace init |
} // namespace gl |