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

Unified Diff: tools/render_pdfs_main.cpp

Issue 513983002: Try out scalar picture sizes (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Update to ToT again Created 6 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
« no previous file with comments | « tools/pinspect.cpp ('k') | tools/render_pictures_main.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/render_pdfs_main.cpp
diff --git a/tools/render_pdfs_main.cpp b/tools/render_pdfs_main.cpp
index 8e791d9608dd9b0e1009e9e16aa8ab0cc419f971..dd5f6421fb93af9f784a9cac07360b3b3d3826f0 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()) {
« no previous file with comments | « tools/pinspect.cpp ('k') | tools/render_pictures_main.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698