diff options
author | edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-07-10 22:37:38 +0000 |
---|---|---|
committer | edisonn@google.com <edisonn@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2013-07-10 22:37:38 +0000 |
commit | cdad30b35ac0c0b2fa0e1105021f880b49b0ac38 (patch) | |
tree | ec5a86bb4ec833ba1055425399dab045fa0c057c /experimental/PdfViewer | |
parent | a8fc2680bb07e39f9c569fde485bfe8e75307309 (diff) |
pdfviewer: fix bug, page -1 means render page 0 with no page extension
Review URL: https://codereview.chromium.org/18660009
git-svn-id: http://skia.googlecode.com/svn/trunk@9985 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'experimental/PdfViewer')
-rw-r--r-- | experimental/PdfViewer/pdf_viewer_main.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/experimental/PdfViewer/pdf_viewer_main.cpp b/experimental/PdfViewer/pdf_viewer_main.cpp index 45bfff3990..cd95d7f0c5 100644 --- a/experimental/PdfViewer/pdf_viewer_main.cpp +++ b/experimental/PdfViewer/pdf_viewer_main.cpp @@ -97,6 +97,7 @@ static void setup_bitmap(SkBitmap* bitmap, int width, int height, SkColor color * @param outputDir Output dir. * @param inputFilename The skp file that was read. * @param renderer The object responsible to write the pdf file. + * @param page -1 means there is only one page (0), and render in a file without page extension */ static bool render_page(const SkString& outputDir, @@ -130,7 +131,7 @@ static bool render_page(const SkString& outputDir, gDumpBitmap = &bitmap; gDumpCanvas = &canvas; - renderer.renderPage(page, &canvas); + renderer.renderPage(page < 0 ? 0 : page, &canvas); SkImageEncoder::EncodeFile(outputPath.c_str(), bitmap, SkImageEncoder::kPNG_Type, 100); |