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

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

Issue 1018953003: Add SkEncodedFormat, used by SkCodec. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Use a common enum for SkImageEncoder and SkImageDecoder and SkCodec Created 5 years, 9 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
OLDNEW
1 /* 1 /*
2 * Copyright 2013 Google Inc. 2 * Copyright 2013 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 "SkBitmapDevice.h" 8 #include "SkBitmapDevice.h"
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkCommandLineFlags.h" 10 #include "SkCommandLineFlags.h"
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
155 #ifdef PDF_TRACE_DIFF_IN_PNG 155 #ifdef PDF_TRACE_DIFF_IN_PNG
156 gDumpBitmap = &bitmap; 156 gDumpBitmap = &bitmap;
157 gDumpCanvas = &canvas; 157 gDumpCanvas = &canvas;
158 #endif 158 #endif
159 renderer.renderPage(page < 0 ? 0 : page, &canvas, rect); 159 renderer.renderPage(page < 0 ? 0 : page, &canvas, rect);
160 160
161 SkString outputPath; 161 SkString outputPath;
162 if (!make_output_filepath(&outputPath, outputDir, inputFilename, page)) { 162 if (!make_output_filepath(&outputPath, outputDir, inputFilename, page)) {
163 return false; 163 return false;
164 } 164 }
165 SkImageEncoder::EncodeFile(outputPath.c_str(), bitmap, SkImageEncoder::k PNG_Type, 100); 165 SkImageEncoder::EncodeFile(outputPath.c_str(), bitmap, kPNG_SkEncodedFor mat, 100);
166 166
167 if (FLAGS_showMemoryUsage) { 167 if (FLAGS_showMemoryUsage) {
168 SkDebugf("Memory usage after page %i rendered: %u\n", 168 SkDebugf("Memory usage after page %i rendered: %u\n",
169 page < 0 ? 0 : page, (unsigned int)renderer.bytesUsed()); 169 page < 0 ? 0 : page, (unsigned int)renderer.bytesUsed());
170 } 170 }
171 } 171 }
172 return true; 172 return true;
173 } 173 }
174 174
175 /** Reads an skp file, renders it to pdf and writes the output to a pdf file 175 /** Reads an skp file, renders it to pdf and writes the output to a pdf file
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 } 299 }
300 300
301 return 0; 301 return 0;
302 } 302 }
303 303
304 #if !defined SK_BUILD_FOR_IOS 304 #if !defined SK_BUILD_FOR_IOS
305 int main(int argc, char * const argv[]) { 305 int main(int argc, char * const argv[]) {
306 return tool_main(argc, (char**) argv); 306 return tool_main(argc, (char**) argv);
307 } 307 }
308 #endif 308 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698