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

Unified Diff: src/pdf/SkPDFDevice.cpp

Issue 607413003: Revert of Revert of Fix SkTextBlob offset semantics. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Created 6 years, 3 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 | « src/gpu/SkGpuDevice.cpp ('k') | src/pdf/SkPDFDeviceFlattener.h » ('j') | 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 aa6b521887a04e1a9dbb109315376d1f2ef98863..bd9b1d7f7e79ae93ca1f6d66fda0053a15e7b27d 100644
--- a/src/pdf/SkPDFDevice.cpp
+++ b/src/pdf/SkPDFDevice.cpp
@@ -1144,8 +1144,8 @@
}
void SkPDFDevice::drawPosText(const SkDraw& d, const void* text, size_t len,
- const SkScalar pos[], SkScalar constY,
- int scalarsPerPos, const SkPaint& paint) {
+ const SkScalar pos[], int scalarsPerPos,
+ const SkPoint& offset, const SkPaint& paint) {
NOT_IMPLEMENTED(paint.getMaskFilter() != NULL, false);
if (paint.getMaskFilter() != NULL) {
// Don't pretend we support drawing MaskFilters, it makes for artifacts
@@ -1177,8 +1177,9 @@
continue;
}
fFontGlyphUsage->noteGlyphUsage(font, &encodedValue, 1);
- SkScalar x = pos[i * scalarsPerPos];
- SkScalar y = scalarsPerPos == 1 ? constY : pos[i * scalarsPerPos + 1];
+ SkScalar x = offset.x() + pos[i * scalarsPerPos];
+ SkScalar y = offset.y() + (2 == scalarsPerPos ? pos[i * scalarsPerPos + 1] : 0);
+
align_text(glyphCacheProc, textPaint, glyphIDs + i, 1, &x, &y);
set_text_transform(x, y, textPaint.getTextSkewX(),
&content.entry()->fContent);
« no previous file with comments | « src/gpu/SkGpuDevice.cpp ('k') | src/pdf/SkPDFDeviceFlattener.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698