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

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

Issue 11412289: Basic pixel tests for cc (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: moves png comparison code to cc/test, does actual comparison 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
« cc/test/pixel_test_utils.cc ('K') | « ui/compositor/layer_unittest.cc ('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 build as app
danakj 2012/12/03 19:14:10 nit: s/build/built/
53 // bundles. In that case, the .so is next to the executable.
54 if (bundle_path.empty())
55 bundle_path = exe_path;
52 FilePath build_dir_path = bundle_path.DirName(); 56 FilePath build_dir_path = bundle_path.DirName();
53 FilePath osmesa_path = build_dir_path.Append("osmesa.so"); 57 FilePath osmesa_path = build_dir_path.Append("osmesa.so");
54 58
55 // When using OSMesa, just use OSMesaGetProcAddress to find entry points. 59 // When using OSMesa, just use OSMesaGetProcAddress to find entry points.
56 base::NativeLibrary library = base::LoadNativeLibrary(osmesa_path, NULL); 60 base::NativeLibrary library = base::LoadNativeLibrary(osmesa_path, NULL);
57 if (!library) { 61 if (!library) {
58 LOG(ERROR) << "osmesa.so not found at " << osmesa_path.value(); 62 LOG(ERROR) << "osmesa.so not found at " << osmesa_path.value();
59 return false; 63 return false;
60 } 64 }
61 65
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 137
134 void ClearGLBindings() { 138 void ClearGLBindings() {
135 ClearGLBindingsGL(); 139 ClearGLBindingsGL();
136 ClearGLBindingsOSMESA(); 140 ClearGLBindingsOSMESA();
137 SetGLImplementation(kGLImplementationNone); 141 SetGLImplementation(kGLImplementationNone);
138 142
139 UnloadGLNativeLibraries(); 143 UnloadGLNativeLibraries();
140 } 144 }
141 145
142 } // namespace gfx 146 } // namespace gfx
OLDNEW
« cc/test/pixel_test_utils.cc ('K') | « ui/compositor/layer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698