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

Side by Side Diff: experimental/PdfViewer/pdf_viewer_main.cpp

Issue 18093005: pdfviewer: some code cleanup in renderer (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « experimental/PdfViewer/SkPdfRenderer.cpp ('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 #include "SkCanvas.h" 1 #include "SkCanvas.h"
2 #include "SkCommandLineFlags.h" 2 #include "SkCommandLineFlags.h"
3 #include "SkDevice.h" 3 #include "SkDevice.h"
4 #include "SkGraphics.h" 4 #include "SkGraphics.h"
5 #include "SkImageDecoder.h" 5 #include "SkImageDecoder.h"
6 #include "SkImageEncoder.h" 6 #include "SkImageEncoder.h"
7 #include "SkOSFile.h" 7 #include "SkOSFile.h"
8 #include "SkPicture.h" 8 #include "SkPicture.h"
9 #include "SkStream.h" 9 #include "SkStream.h"
10 #include "SkTypeface.h" 10 #include "SkTypeface.h"
11 #include "SkTArray.h" 11 #include "SkTArray.h"
12 #include "picture_utils.h" 12 #include "picture_utils.h"
13 13
14 #include "SkPdfRenderer.h" 14 #include "SkPdfRenderer.h"
15 15
16 DEFINE_string2(readPath, r, "", "pdf files or directories of pdf files to proces s."); 16 DEFINE_string2(readPath, r, "", "pdf files or directories of pdf files to proces s.");
17 DEFINE_string2(writePath, w, "", "Directory to write the rendered pages."); 17 DEFINE_string2(writePath, w, "", "Directory to write the rendered pages.");
18 DEFINE_bool2(noExtensionForOnePagePdf, n, false, "No page extension if only one page."); 18 DEFINE_bool2(noExtensionForOnePagePdf, n, false, "No page extension if only one page.");
19 DEFINE_bool2(showMemoryUsage, m, false, "Show Memory usage."); 19 DEFINE_bool2(showMemoryUsage, m, false, "Show Memory usage.");
20 DEFINE_string2(pages, p, "all", "What pages to render and how:\n" 20 DEFINE_string2(pages, p, "all", "What pages to render and how:\n"
21 "\tall - all pages\n" 21 "\tall - all pages\n"
22 "\treverse - all pages, in reverse order\n" 22 "\treverse - all pages, in reverse order\n"
23 "\tfirst - first page\n" 23 "\tfirst - first page\n"
24 "\tlast - last page\n" 24 "\tlast - last page\n"
25 "\tnumber - a specific page number\n" 25 "\tnumber - a specific page number\n"
26 ); 26 );
27 DEFINE_double(DPI, 72, "DPI to be used for rendering (scale).");
28 // TODO(edisonn): add config for device target(gpu, raster, pdf), + ability not to render at all
29 // TODO(edisonn): add ability to do the op N times, bench (either load N times, render n times or load + render n times)
27 30
28 31
29 /** 32 /**
30 * Given list of directories and files to use as input, expects to find .pdf 33 * Given list of directories and files to use as input, expects to find .pdf
31 * files and it will convert them to .png files writing them in the same directo ry 34 * files and it will convert them to .png files writing them in the same directo ry
32 * one file for each page. 35 * one file for each page.
33 * 36 *
34 * Returns zero exit code if all .pdf files were converted successfully, 37 * Returns zero exit code if all .pdf files were converted successfully,
35 * otherwise returns error code 1. 38 * otherwise returns error code 1.
36 */ 39 */
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
252 } 255 }
253 256
254 return 0; 257 return 0;
255 } 258 }
256 259
257 #if !defined SK_BUILD_FOR_IOS 260 #if !defined SK_BUILD_FOR_IOS
258 int main(int argc, char * const argv[]) { 261 int main(int argc, char * const argv[]) {
259 return tool_main(argc, (char**) argv); 262 return tool_main(argc, (char**) argv);
260 } 263 }
261 #endif 264 #endif
OLDNEW
« no previous file with comments | « experimental/PdfViewer/SkPdfRenderer.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698