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

Side by Side Diff: tools/render_pdfs_main.cpp

Issue 321693002: Cleanup: Delete sk_tools::get_basename() in favor of SkOSPath::SkBasename(). (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: rm is_path_seperator() Created 6 years, 6 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 | « tools/picture_utils.cpp ('k') | tools/render_pictures_main.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 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #include "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkDevice.h" 9 #include "SkDevice.h"
10 #include "SkForceLinking.h" 10 #include "SkForceLinking.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 return stream; 142 return stream;
143 } 143 }
144 144
145 /** Reads an skp file, renders it to pdf and writes the output to a pdf file 145 /** Reads an skp file, renders it to pdf and writes the output to a pdf file
146 * @param inputPath The skp file to be read. 146 * @param inputPath The skp file to be read.
147 * @param outputDir Output dir. 147 * @param outputDir Output dir.
148 * @param renderer The object responsible to render the skp object into pdf. 148 * @param renderer The object responsible to render the skp object into pdf.
149 */ 149 */
150 static bool render_pdf(const SkString& inputPath, const SkString& outputDir, 150 static bool render_pdf(const SkString& inputPath, const SkString& outputDir,
151 sk_tools::PdfRenderer& renderer) { 151 sk_tools::PdfRenderer& renderer) {
152 SkString inputFilename; 152 SkString inputFilename = SkOSPath::SkBasename(inputPath.c_str());
153 sk_tools::get_basename(&inputFilename, inputPath);
154 153
155 SkFILEStream inputStream; 154 SkFILEStream inputStream;
156 inputStream.setPath(inputPath.c_str()); 155 inputStream.setPath(inputPath.c_str());
157 if (!inputStream.isValid()) { 156 if (!inputStream.isValid()) {
158 SkDebugf("Could not open file %s\n", inputPath.c_str()); 157 SkDebugf("Could not open file %s\n", inputPath.c_str());
159 return false; 158 return false;
160 } 159 }
161 160
162 SkAutoTUnref<SkPicture> picture(SkPicture::CreateFromStream(&inputStream)); 161 SkAutoTUnref<SkPicture> picture(SkPicture::CreateFromStream(&inputStream));
163 162
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
295 } 294 }
296 #endif 295 #endif
297 return 0; 296 return 0;
298 } 297 }
299 298
300 #if !defined SK_BUILD_FOR_IOS 299 #if !defined SK_BUILD_FOR_IOS
301 int main(int argc, char * const argv[]) { 300 int main(int argc, char * const argv[]) {
302 return tool_main(argc, (char**) argv); 301 return tool_main(argc, (char**) argv);
303 } 302 }
304 #endif 303 #endif
OLDNEW
« no previous file with comments | « tools/picture_utils.cpp ('k') | tools/render_pictures_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698