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

Side by Side Diff: dm/DM.cpp

Issue 428443002: Cleanup: Rename SkOSPath functions. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix Created 6 years, 4 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 unified diff | Download patch
« no previous file with comments | « bench/benchmain.cpp ('k') | dm/DMWriteTask.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Main binary for DM. 1 // Main binary for DM.
2 // For a high-level overview, please see dm/README. 2 // For a high-level overview, please see dm/README.
3 3
4 #include "CrashHandler.h" 4 #include "CrashHandler.h"
5 #include "SkCommonFlags.h" 5 #include "SkCommonFlags.h"
6 #include "SkForceLinking.h" 6 #include "SkForceLinking.h"
7 #include "SkGraphics.h" 7 #include "SkGraphics.h"
8 #include "SkPicture.h" 8 #include "SkPicture.h"
9 #include "SkString.h" 9 #include "SkString.h"
10 #include "Test.h" 10 #include "Test.h"
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after
121 121
122 static void find_skps(SkTArray<SkString>* skps) { 122 static void find_skps(SkTArray<SkString>* skps) {
123 if (FLAGS_skps.isEmpty()) { 123 if (FLAGS_skps.isEmpty()) {
124 return; 124 return;
125 } 125 }
126 126
127 SkOSFile::Iter it(FLAGS_skps[0], ".skp"); 127 SkOSFile::Iter it(FLAGS_skps[0], ".skp");
128 SkString filename; 128 SkString filename;
129 while (it.next(&filename)) { 129 while (it.next(&filename)) {
130 if (!SkCommandLineFlags::ShouldSkip(FLAGS_match, filename.c_str())) { 130 if (!SkCommandLineFlags::ShouldSkip(FLAGS_match, filename.c_str())) {
131 skps->push_back( 131 skps->push_back(SkOSPath::Join(FLAGS_skps[0], filename.c_str()));
132 SkOSPath::SkPathJoin(FLAGS_skps[0], filename.c_str()));
133 } 132 }
134 } 133 }
135 } 134 }
136 135
137 static void kick_off_skps(const SkTArray<SkString>& skps, 136 static void kick_off_skps(const SkTArray<SkString>& skps,
138 DM::Reporter* reporter, DM::TaskRunner* tasks) { 137 DM::Reporter* reporter, DM::TaskRunner* tasks) {
139 for (int i = 0; i < skps.count(); ++i) { 138 for (int i = 0; i < skps.count(); ++i) {
140 SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(skps[i].c_str())); 139 SkAutoTUnref<SkStream> stream(SkStream::NewFromFile(skps[i].c_str()));
141 if (stream.get() == NULL) { 140 if (stream.get() == NULL) {
142 SkDebugf("Could not read %s.\n", skps[i].c_str()); 141 SkDebugf("Could not read %s.\n", skps[i].c_str());
143 exit(1); 142 exit(1);
144 } 143 }
145 SkAutoTUnref<SkPicture> pic(SkPicture::CreateFromStream(stream.get())); 144 SkAutoTUnref<SkPicture> pic(SkPicture::CreateFromStream(stream.get()));
146 if (pic.get() == NULL) { 145 if (pic.get() == NULL) {
147 SkDebugf("Could not read %s as an SkPicture.\n", skps[i].c_str()); 146 SkDebugf("Could not read %s as an SkPicture.\n", skps[i].c_str());
148 exit(1); 147 exit(1);
149 } 148 }
150 149
151 SkString filename = SkOSPath::SkBasename(skps[i].c_str()); 150 SkString filename = SkOSPath::Basename(skps[i].c_str());
152 tasks->add(SkNEW_ARGS(DM::SKPTask, (reporter, tasks, pic, filename))); 151 tasks->add(SkNEW_ARGS(DM::SKPTask, (reporter, tasks, pic, filename)));
153 tasks->add(SkNEW_ARGS(DM::PDFTask, (reporter, tasks, pic, filename, 152 tasks->add(SkNEW_ARGS(DM::PDFTask, (reporter, tasks, pic, filename,
154 RASTERIZE_PDF_PROC))); 153 RASTERIZE_PDF_PROC)));
155 } 154 }
156 } 155 }
157 156
158 static void report_failures(const SkTArray<SkString>& failures) { 157 static void report_failures(const SkTArray<SkString>& failures) {
159 if (failures.count() == 0) { 158 if (failures.count() == 0) {
160 return; 159 return;
161 } 160 }
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 report_failures(failures); 244 report_failures(failures);
246 return failures.count() > 0; 245 return failures.count() > 0;
247 } 246 }
248 247
249 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL) 248 #if !defined(SK_BUILD_FOR_IOS) && !defined(SK_BUILD_FOR_NACL)
250 int main(int argc, char** argv) { 249 int main(int argc, char** argv) {
251 SkCommandLineFlags::Parse(argc, argv); 250 SkCommandLineFlags::Parse(argc, argv);
252 return dm_main(); 251 return dm_main();
253 } 252 }
254 #endif 253 #endif
OLDNEW
« no previous file with comments | « bench/benchmain.cpp ('k') | dm/DMWriteTask.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698