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

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

Issue 19793011: (upload draf code for backup) pdfviewer: improve memory, son't allocate extra buffers, and put the … (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 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
192 } 192 }
193 } 193 }
194 } 194 }
195 195
196 if (success) { 196 if (success) {
197 if (!renderer.pages()) 197 if (!renderer.pages())
198 { 198 {
199 SkDebugf("ERROR: Empty PDF Document %s\n", inputPath.c_str()); 199 SkDebugf("ERROR: Empty PDF Document %s\n", inputPath.c_str());
200 return false; 200 return false;
201 } else { 201 } else {
202 printf("renders = %i\n", FLAGS_benchRender);
202 for (int i = 0; i < FLAGS_benchRender + 1; i++) { 203 for (int i = 0; i < FLAGS_benchRender + 1; i++) {
203 // TODO(edisonn) if (i == 1) start timer 204 // TODO(edisonn) if (i == 1) start timer
204 if (strcmp(FLAGS_pages[0], "all") == 0) { 205 if (strcmp(FLAGS_pages[0], "all") == 0) {
205 for (int pn = 0; pn < renderer.pages(); ++pn) { 206 for (int pn = 0; pn < renderer.pages(); ++pn) {
206 success = render_page(outputDir, inputFilename, renderer , FLAGS_noExtensionForOnePagePdf && renderer.pages() == 1 ? -1 : pn) && success; 207 success = render_page(outputDir, inputFilename, renderer , FLAGS_noExtensionForOnePagePdf && renderer.pages() == 1 ? -1 : pn) && success;
207 } 208 }
208 } else if (strcmp(FLAGS_pages[0], "reverse") == 0) { 209 } else if (strcmp(FLAGS_pages[0], "reverse") == 0) {
209 for (int pn = renderer.pages() - 1; pn >= 0; --pn) { 210 for (int pn = renderer.pages() - 1; pn >= 0; --pn) {
210 success = render_page(outputDir, inputFilename, renderer , FLAGS_noExtensionForOnePagePdf && renderer.pages() == 1 ? -1 : pn) && success; 211 success = render_page(outputDir, inputFilename, renderer , FLAGS_noExtensionForOnePagePdf && renderer.pages() == 1 ? -1 : pn) && success;
211 } 212 }
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 } 286 }
286 287
287 return 0; 288 return 0;
288 } 289 }
289 290
290 #if !defined SK_BUILD_FOR_IOS 291 #if !defined SK_BUILD_FOR_IOS
291 int main(int argc, char * const argv[]) { 292 int main(int argc, char * const argv[]) {
292 return tool_main(argc, (char**) argv); 293 return tool_main(argc, (char**) argv);
293 } 294 }
294 #endif 295 #endif
OLDNEW
« no previous file with comments | « experimental/PdfViewer/SkPdfRenderer.cpp ('k') | experimental/PdfViewer/pdfparser/native/SkNativeParsedPDF.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698