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

Unified Diff: experimental/PdfViewer/SkPdfParser.cpp

Issue 18117005: more work on pdf fonts, more to come (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 6 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
Index: experimental/PdfViewer/SkPdfParser.cpp
===================================================================
--- experimental/PdfViewer/SkPdfParser.cpp (revision 9787)
+++ experimental/PdfViewer/SkPdfParser.cpp (working copy)
@@ -34,6 +34,8 @@
// TODO(edisonn): security - validate all the user input, all pdf!
+// TODO(edisonn): put drawtext in #ifdefs, so comparations will ignore minor changes in text positioning and font
+// this way, we look more at other features and layout in diffs
#include "SkPdfHeaders_autogen.h"
#include "SkPdfPodofoMapper_autogen.h"
@@ -386,7 +388,7 @@
SkTraceMatrix(matrix, "mirrored");
#endif
- skfont->drawText(decoded, &paint, pdfContext, canvas, &pdfContext->fGraphicsState.fMatrixTm);
+ skfont->drawText(decoded, &paint, pdfContext, canvas);
canvas->restore();
return kPartial_PdfResult;
@@ -2334,7 +2336,14 @@
doc.drawPage(pn, &canvas);
SkString out;
- out.appendf("%s-%i.png", inputFileName.c_str(), pn);
+ if (doc.pages() > 1) {
+ out.appendf("%s-%i.png", inputFileName.c_str(), pn);
+ } else {
+ out = inputFileName;
+ // .pdf -> .png
+ out[out.size() - 2] = 'n';
+ out[out.size() - 1] = 'g';
+ }
SkImageEncoder::EncodeFile(out.c_str(), bitmap, SkImageEncoder::kPNG_Type, 100);
}
return true;
« no previous file with comments | « experimental/PdfViewer/SkPdfFont.cpp ('k') | experimental/PdfViewer/autogen/SkPdfALinkAnnotationDictionary_autogen.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698