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

Unified Diff: experimental/PdfViewer/pdf_viewer_main.cpp

Issue 22465006: pdfviewer: pass the page number, report failure if at least one render fails, and check that xref s… (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 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 side-by-side diff with in-line comments
Download patch
Index: experimental/PdfViewer/pdf_viewer_main.cpp
===================================================================
--- experimental/PdfViewer/pdf_viewer_main.cpp (revision 10543)
+++ experimental/PdfViewer/pdf_viewer_main.cpp (working copy)
@@ -216,15 +216,8 @@
SkString inputFilename;
get_basename(&inputFilename, inputPath);
- SkFILEStream inputStream;
- inputStream.setPath(inputPath.c_str());
- if (!inputStream.isValid()) {
- SkDebugf("Could not open file %s\n", inputPath.c_str());
- return false;
- }
+ bool success = true;
- bool success = false;
-
success = renderer.load(inputPath);
if (FLAGS_showMemoryUsage) {
SkDebugf("Memory usage after load: %u\n", (unsigned int)renderer.bytesUsed());
@@ -233,7 +226,7 @@
// TODO(edisonn): bench timers
if (FLAGS_benchLoad > 0) {
for (int i = 0 ; i < FLAGS_benchLoad; i++) {
- success = renderer.load(inputPath);
+ success = renderer.load(inputPath) && success;
if (FLAGS_showMemoryUsage) {
SkDebugf("Memory usage after load %i number : %u\n", i, (unsigned int)renderer.bytesUsed());
}
@@ -262,12 +255,16 @@
success = render_page(outputDir, inputFilename, renderer, FLAGS_noExtensionForOnePagePdf && renderer.pages() == 1 ? -1 : renderer.pages() - 1) && success;
} else {
int pn = atoi(FLAGS_pages[0]);
- success = render_page(outputDir, inputFilename, renderer, FLAGS_noExtensionForOnePagePdf && renderer.pages() == 1 ? -1 : renderer.pages() - 1) && pn;
+ success = render_page(outputDir, inputFilename, renderer, FLAGS_noExtensionForOnePagePdf && renderer.pages() == 1 ? -1 : pn) && success;
}
}
}
}
+ if (!success) {
+ SkDebugf("Failures for file %s\n", inputPath.c_str());
+ }
+
return success;
}
« no previous file with comments | « experimental/PdfViewer/SkPdfRenderer.cpp ('k') | experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698