diff options
author | 2014-08-29 08:03:56 -0700 | |
---|---|---|
committer | 2014-08-29 08:03:56 -0700 | |
commit | a8d7f0b13cd4c6d773fcf055fe17db75d260fa05 (patch) | |
tree | 37e85b212ccd5761b9a736282e75ebf838840798 /tools/render_pdfs_main.cpp | |
parent | 77d724c07878b21602e96e095f6a446c429a079a (diff) |
Try out scalar picture sizes
This paves the way for removing the 'fTile' parameter from SkPictureShader (although that should be a different CL). If we like this we could also move to providing an entire cull SkRect.
R=reed@google.com, mtklein@google.com, fmalita@google.com, fmalita@chromium.org
Author: robertphillips@google.com
Review URL: https://codereview.chromium.org/513983002
Diffstat (limited to 'tools/render_pdfs_main.cpp')
-rw-r--r-- | tools/render_pdfs_main.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/tools/render_pdfs_main.cpp b/tools/render_pdfs_main.cpp index 8e791d9608..dd5f6421fb 100644 --- a/tools/render_pdfs_main.cpp +++ b/tools/render_pdfs_main.cpp @@ -166,9 +166,8 @@ static bool pdf_to_stream(SkPicture* picture, SkPicture::EncodeBitmap encoder) { SkAutoTUnref<SkDocument> pdfDocument( SkDocument::CreatePDF(output, NULL, encoder)); - SkCanvas* canvas = pdfDocument->beginPage( - SkIntToScalar(picture->width()), - SkIntToScalar(picture->height())); + SkCanvas* canvas = pdfDocument->beginPage(picture->cullRect().width(), + picture->cullRect().height()); canvas->drawPicture(picture); canvas->flush(); return pdfDocument->close(); @@ -255,8 +254,10 @@ int tool_main_core(int argc, char** argv) { ++failures; continue; } - SkDebugf("[%-4i %6i] %-*s", picture->width(), picture->height(), - maximumPathLength, basename.c_str()); + SkDebugf("[%f,%f,%f,%f] %-*s", + picture->cullRect().fLeft, picture->cullRect().fTop, + picture->cullRect().fRight, picture->cullRect().fBottom, + maximumPathLength, basename.c_str()); SkAutoTDelete<SkWStream> stream(open_stream(outputDir, files[i])); if (!stream.get()) { |