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

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

Issue 20538002: pdfviewer: limit the characters we support in ToUnicode, to 0xffff (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
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"
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 } 239 }
240 } 240 }
241 } 241 }
242 242
243 if (success) { 243 if (success) {
244 if (!renderer.pages()) 244 if (!renderer.pages())
245 { 245 {
246 SkDebugf("ERROR: Empty PDF Document %s\n", inputPath.c_str()); 246 SkDebugf("ERROR: Empty PDF Document %s\n", inputPath.c_str());
247 return false; 247 return false;
248 } else { 248 } else {
249 printf("renders = %i\n", FLAGS_benchRender);
250 for (int i = 0; i < FLAGS_benchRender + 1; i++) { 249 for (int i = 0; i < FLAGS_benchRender + 1; i++) {
251 // TODO(edisonn) if (i == 1) start timer 250 // TODO(edisonn) if (i == 1) start timer
252 if (strcmp(FLAGS_pages[0], "all") == 0) { 251 if (strcmp(FLAGS_pages[0], "all") == 0) {
253 for (int pn = 0; pn < renderer.pages(); ++pn) { 252 for (int pn = 0; pn < renderer.pages(); ++pn) {
254 success = render_page(outputDir, inputFilename, renderer , FLAGS_noExtensionForOnePagePdf && renderer.pages() == 1 ? -1 : pn) && success; 253 success = render_page(outputDir, inputFilename, renderer , FLAGS_noExtensionForOnePagePdf && renderer.pages() == 1 ? -1 : pn) && success;
255 } 254 }
256 } else if (strcmp(FLAGS_pages[0], "reverse") == 0) { 255 } else if (strcmp(FLAGS_pages[0], "reverse") == 0) {
257 for (int pn = renderer.pages() - 1; pn >= 0; --pn) { 256 for (int pn = renderer.pages() - 1; pn >= 0; --pn) {
258 success = render_page(outputDir, inputFilename, renderer , FLAGS_noExtensionForOnePagePdf && renderer.pages() == 1 ? -1 : pn) && success; 257 success = render_page(outputDir, inputFilename, renderer , FLAGS_noExtensionForOnePagePdf && renderer.pages() == 1 ? -1 : pn) && success;
259 } 258 }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
333 } 332 }
334 333
335 return 0; 334 return 0;
336 } 335 }
337 336
338 #if !defined SK_BUILD_FOR_IOS 337 #if !defined SK_BUILD_FOR_IOS
339 int main(int argc, char * const argv[]) { 338 int main(int argc, char * const argv[]) {
340 return tool_main(argc, (char**) argv); 339 return tool_main(argc, (char**) argv);
341 } 340 }
342 #endif 341 #endif
OLDNEW
« no previous file with comments | « experimental/PdfViewer/SkPdfFont.cpp ('k') | experimental/PdfViewer/pdfparser/native/SkPdfNativeTokenizer.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698