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

Side by Side Diff: ui/gl/gl_implementation_mac.cc

Issue 11470003: Revert 171544 (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/compositor/test/test_compositor_host_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "base/base_paths.h" 5 #include "base/base_paths.h"
6 #include "base/file_path.h" 6 #include "base/file_path.h"
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/mac/foundation_util.h" 8 #include "base/mac/foundation_util.h"
9 #include "base/native_library.h" 9 #include "base/native_library.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 switch (implementation) { 42 switch (implementation) {
43 case kGLImplementationOSMesaGL: { 43 case kGLImplementationOSMesaGL: {
44 // osmesa.so is located in the build directory. This code path is only 44 // osmesa.so is located in the build directory. This code path is only
45 // valid in a developer build environment. 45 // valid in a developer build environment.
46 FilePath exe_path; 46 FilePath exe_path;
47 if (!PathService::Get(base::FILE_EXE, &exe_path)) { 47 if (!PathService::Get(base::FILE_EXE, &exe_path)) {
48 LOG(ERROR) << "PathService::Get failed."; 48 LOG(ERROR) << "PathService::Get failed.";
49 return false; 49 return false;
50 } 50 }
51 FilePath bundle_path = base::mac::GetAppBundlePath(exe_path); 51 FilePath bundle_path = base::mac::GetAppBundlePath(exe_path);
52 // Some unit test targets depend on osmesa but aren't built as app
53 // bundles. In that case, the .so is next to the executable.
54 if (bundle_path.empty())
55 bundle_path = exe_path;
56 FilePath build_dir_path = bundle_path.DirName(); 52 FilePath build_dir_path = bundle_path.DirName();
57 FilePath osmesa_path = build_dir_path.Append("osmesa.so"); 53 FilePath osmesa_path = build_dir_path.Append("osmesa.so");
58 54
59 // When using OSMesa, just use OSMesaGetProcAddress to find entry points. 55 // When using OSMesa, just use OSMesaGetProcAddress to find entry points.
60 base::NativeLibrary library = base::LoadNativeLibrary(osmesa_path, NULL); 56 base::NativeLibrary library = base::LoadNativeLibrary(osmesa_path, NULL);
61 if (!library) { 57 if (!library) {
62 LOG(ERROR) << "osmesa.so not found at " << osmesa_path.value(); 58 LOG(ERROR) << "osmesa.so not found at " << osmesa_path.value();
63 return false; 59 return false;
64 } 60 }
65 61
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 133
138 void ClearGLBindings() { 134 void ClearGLBindings() {
139 ClearGLBindingsGL(); 135 ClearGLBindingsGL();
140 ClearGLBindingsOSMESA(); 136 ClearGLBindingsOSMESA();
141 SetGLImplementation(kGLImplementationNone); 137 SetGLImplementation(kGLImplementationNone);
142 138
143 UnloadGLNativeLibraries(); 139 UnloadGLNativeLibraries();
144 } 140 }
145 141
146 } // namespace gfx 142 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/compositor/test/test_compositor_host_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698