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

Unified Diff: src/core/SkDraw.cpp

Issue 605533002: Fix SkTextBlob offset semantics. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: default run positioning fix 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/core/SkDevice.cpp ('k') | src/core/SkTextMapStateProc.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkDraw.cpp
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index e905f4b9f561b6ff31d19589feee333aa9d8af7f..929088df17d25f206cab35fbc7b5ac240fba7411 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -1655,9 +1655,8 @@ void SkDraw::drawText(const char text[], size_t byteLength,
//////////////////////////////////////////////////////////////////////////////
void SkDraw::drawPosText_asPaths(const char text[], size_t byteLength,
- const SkScalar pos[], SkScalar constY,
- int scalarsPerPosition,
- const SkPaint& origPaint) const {
+ const SkScalar pos[], int scalarsPerPosition,
+ const SkPoint& offset, const SkPaint& origPaint) const {
// setup our std paint, in hopes of getting hits in the cache
SkPaint paint(origPaint);
SkScalar matrixScale = paint.setupForAsPaths();
@@ -1675,7 +1674,7 @@ void SkDraw::drawPosText_asPaths(const char text[], size_t byteLength,
const char* stop = text + byteLength;
SkTextAlignProcScalar alignProc(paint.getTextAlign());
- SkTextMapStateProc tmsProc(SkMatrix::I(), constY, scalarsPerPosition);
+ SkTextMapStateProc tmsProc(SkMatrix::I(), offset, scalarsPerPosition);
// Now restore the original settings, so we "draw" with whatever style/stroking.
paint.setStyle(origPaint.getStyle());
@@ -1705,8 +1704,8 @@ void SkDraw::drawPosText_asPaths(const char text[], size_t byteLength,
}
void SkDraw::drawPosText(const char text[], size_t byteLength,
- const SkScalar pos[], SkScalar constY,
- int scalarsPerPosition, const SkPaint& paint) const {
+ const SkScalar pos[], int scalarsPerPosition,
+ const SkPoint& offset, const SkPaint& paint) const {
SkASSERT(byteLength == 0 || text != NULL);
SkASSERT(1 == scalarsPerPosition || 2 == scalarsPerPosition);
@@ -1718,8 +1717,7 @@ void SkDraw::drawPosText(const char text[], size_t byteLength,
}
if (ShouldDrawTextAsPaths(paint, *fMatrix)) {
- this->drawPosText_asPaths(text, byteLength, pos, constY,
- scalarsPerPosition, paint);
+ this->drawPosText_asPaths(text, byteLength, pos, scalarsPerPosition, offset, paint);
return;
}
@@ -1743,7 +1741,7 @@ void SkDraw::drawPosText(const char text[], size_t byteLength,
SkTextAlignProc alignProc(paint.getTextAlign());
SkDraw1Glyph d1g;
SkDraw1Glyph::Proc proc = d1g.init(this, blitter, cache, paint);
- SkTextMapStateProc tmsProc(*fMatrix, constY, scalarsPerPosition);
+ SkTextMapStateProc tmsProc(*fMatrix, offset, scalarsPerPosition);
if (cache->isSubpixel()) {
// maybe we should skip the rounding if linearText is set
« no previous file with comments | « src/core/SkDevice.cpp ('k') | src/core/SkTextMapStateProc.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698