Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(55)

Unified Diff: ui/gfx/gl/gl_implementation_mac.cc

Issue 7019041: Fix up PathProvider on the Mac for FILE_MODULE. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Search for osmesa in build dir, and get rid of copies. Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/gfx/gl/gl_implementation_mac.cc
diff --git a/ui/gfx/gl/gl_implementation_mac.cc b/ui/gfx/gl/gl_implementation_mac.cc
index a8b3ddd7f61c53629f7939048666e1e648828218..a9537b8971c164888627c2727f5823fa5440eccc 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;
}

Powered by Google App Engine
This is Rietveld 408576698