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

Unified Diff: src/pdf/SkPDFDevice.cpp

Issue 2268313002: SkPDF: SK_PDF_NEVER_RELY_ON_ADVANCE (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 2016-08-23 (Tuesday) 09:10:31 EDT Created 4 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pdf/SkPDFDevice.cpp
diff --git a/src/pdf/SkPDFDevice.cpp b/src/pdf/SkPDFDevice.cpp
index 73d41b1c36ac0e33bbf2a14259db5a230020f2fe..815b49db471bd17cb3a6491d2d7ab57ddae89ccb 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -37,6 +37,10 @@
#define DPI_FOR_RASTER_SCALE_ONE 72
+#if !defined(SK_PDF_NEVER_RELY_ON_ADVANCE) && defined(SK_BUILD_FOR_WIN)
+#define SK_PDF_NEVER_RELY_ON_ADVANCE
+#endif
+
// Utility functions
// If the paint will definitely draw opaquely, replace kSrc_Mode with
@@ -995,7 +999,11 @@ public:
if (!fDefaultPositioning) {
SkScalar xPosition = x - fCurrentMatrixX;
SkScalar yPosition = y - fCurrentMatrixY;
- if (xPosition != fXAdvance || yPosition != 0) {
+ bool alwaysPosition = false;
+ #ifdef SK_PDF_NEVER_RELY_ON_ADVANCE
+ alwaysPosition = true;
+ #endif
+ if (alwaysPosition || xPosition != fXAdvance || yPosition != 0) {
this->flush();
SkPDFUtils::AppendScalar(xPosition, fContent);
fContent->writeText(" ");
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698