diff options
author | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-26 16:19:01 +0000 |
---|---|---|
committer | dmaclach@chromium.org <dmaclach@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-05-26 16:19:01 +0000 |
commit | 699c26c98e5397d59db332c794915b87089eaceb (patch) | |
tree | 57d4e2039198dd79ed21fa7669b2f5aaa250ab0a /ui/gfx/gl/gl_implementation_mac.cc | |
parent | a29616b6fbed50cb21cbf9f50a765da8d84f03ec (diff) | |
download | chromium_src-699c26c98e5397d59db332c794915b87089eaceb.zip chromium_src-699c26c98e5397d59db332c794915b87089eaceb.tar.gz chromium_src-699c26c98e5397d59db332c794915b87089eaceb.tar.bz2 |
Fix up PathProvider on the Mac for FILE_MODULE.
PathProvider on the Mac always returned the FILE_EXE for FILE_MODULE,
which isn't necessarily correct.
BUG=NONE
TEST=BUILD
Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=86631
Review URL: http://codereview.chromium.org/7019041
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86833 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx/gl/gl_implementation_mac.cc')
-rw-r--r-- | ui/gfx/gl/gl_implementation_mac.cc | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/ui/gfx/gl/gl_implementation_mac.cc b/ui/gfx/gl/gl_implementation_mac.cc index a8b3ddd..a9537b89 100644 --- a/ui/gfx/gl/gl_implementation_mac.cc +++ b/ui/gfx/gl/gl_implementation_mac.cc @@ -5,6 +5,7 @@ #include "base/base_paths.h" #include "base/file_path.h" #include "base/logging.h" +#include "base/mac/foundation_util.h" #include "base/native_library.h" #include "base/path_service.h" #include "ui/gfx/gl/gl_bindings.h" @@ -25,17 +26,21 @@ bool InitializeGLBindings(GLImplementation implementation) { switch (implementation) { case kGLImplementationOSMesaGL: { - FilePath module_path; - if (!PathService::Get(base::DIR_MODULE, &module_path)) { + // osmesa.so is located in the build directory. This code path is only + // valid in a developer build environment. + FilePath exe_path; + if (!PathService::Get(base::FILE_EXE, &exe_path)) { LOG(ERROR) << "PathService::Get failed."; return false; } + FilePath bundle_path = base::mac::GetAppBundlePath(exe_path); + FilePath build_dir_path = bundle_path.DirName(); + FilePath osmesa_path = build_dir_path.Append("osmesa.so"); // When using OSMesa, just use OSMesaGetProcAddress to find entry points. - base::NativeLibrary library = base::LoadNativeLibrary( - module_path.Append("osmesa.so"), NULL); + base::NativeLibrary library = base::LoadNativeLibrary(osmesa_path, NULL); if (!library) { - VLOG(1) << "osmesa.so not found"; + LOG(ERROR) << "osmesa.so not found at " << osmesa_path.value(); return false; } |