aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkDraw.cpp
diff options
context:
space:
mode:
authorGravatar robertphillips <robertphillips@google.com>2014-09-29 04:48:52 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2014-09-29 04:48:52 -0700
commitd46b8d2bab7cfba8458432248e1568ac377429e9 (patch)
tree3707a270fa43d90f2f8864d98cba576fb5bc1a48 /src/core/SkDraw.cpp
parentcce6bbf494d571e1cd4045697475f0fb2916c2d2 (diff)
Revert of Fix SkTextBlob offset semantics. (patchset #2 id:20001 of https://codereview.chromium.org/605533002/)
Reason for revert: Breaking the Chrome builds with the error: [14:54:14.317833] ../../skia/ext/pixel_ref_utils.cc:221:16: error: 'drawPosText' marked 'override' but does not override any member functions [14:54:14.318022] virtual void drawPosText(const SkDraw& draw, [14:54:14.318082] ^ Original issue's description: > Fix SkTextBlob offset semantics. > > Implement proper x/y drawTextBlob() handling by plumbing a > drawPosText() offset parameter (to act as an additional glyph pos > translation) throughout the device layer. > > The new offset superceeds the existing constY, with a minor semantic > tweak: whereas previous implementations were ignoring constY in 2D > positioning mode (scalarsPerGlyph == 2), now the offset is always > observed, in all positioning modes. We can do this because existing > drawPosText() clients always pass constY == 0 for full positioning mode. > > R=reed@google.com, jvanverth@google.com, robertphillips@google.com > > Committed: https://skia.googlesource.com/skia/+/c13bc571d3e61a43b87eb97f0719abd304cafaf2 R=jvanverth@google.com, reed@google.com, bsalomon@google.com, fmalita@chromium.org TBR=bsalomon@google.com, fmalita@chromium.org, jvanverth@google.com, reed@google.com NOTREECHECKS=true NOTRY=true Author: robertphillips@google.com Review URL: https://codereview.chromium.org/609223003
Diffstat (limited to 'src/core/SkDraw.cpp')
-rw-r--r--src/core/SkDraw.cpp16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index 929088df17..e905f4b9f5 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -1655,8 +1655,9 @@ void SkDraw::drawText(const char text[], size_t byteLength,
//////////////////////////////////////////////////////////////////////////////
void SkDraw::drawPosText_asPaths(const char text[], size_t byteLength,
- const SkScalar pos[], int scalarsPerPosition,
- const SkPoint& offset, const SkPaint& origPaint) const {
+ const SkScalar pos[], SkScalar constY,
+ int scalarsPerPosition,
+ const SkPaint& origPaint) const {
// setup our std paint, in hopes of getting hits in the cache
SkPaint paint(origPaint);
SkScalar matrixScale = paint.setupForAsPaths();
@@ -1674,7 +1675,7 @@ void SkDraw::drawPosText_asPaths(const char text[], size_t byteLength,
const char* stop = text + byteLength;
SkTextAlignProcScalar alignProc(paint.getTextAlign());
- SkTextMapStateProc tmsProc(SkMatrix::I(), offset, scalarsPerPosition);
+ SkTextMapStateProc tmsProc(SkMatrix::I(), constY, scalarsPerPosition);
// Now restore the original settings, so we "draw" with whatever style/stroking.
paint.setStyle(origPaint.getStyle());
@@ -1704,8 +1705,8 @@ void SkDraw::drawPosText_asPaths(const char text[], size_t byteLength,
}
void SkDraw::drawPosText(const char text[], size_t byteLength,
- const SkScalar pos[], int scalarsPerPosition,
- const SkPoint& offset, const SkPaint& paint) const {
+ const SkScalar pos[], SkScalar constY,
+ int scalarsPerPosition, const SkPaint& paint) const {
SkASSERT(byteLength == 0 || text != NULL);
SkASSERT(1 == scalarsPerPosition || 2 == scalarsPerPosition);
@@ -1717,7 +1718,8 @@ void SkDraw::drawPosText(const char text[], size_t byteLength,
}
if (ShouldDrawTextAsPaths(paint, *fMatrix)) {
- this->drawPosText_asPaths(text, byteLength, pos, scalarsPerPosition, offset, paint);
+ this->drawPosText_asPaths(text, byteLength, pos, constY,
+ scalarsPerPosition, paint);
return;
}
@@ -1741,7 +1743,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, offset, scalarsPerPosition);
+ SkTextMapStateProc tmsProc(*fMatrix, constY, scalarsPerPosition);
if (cache->isSubpixel()) {
// maybe we should skip the rounding if linearText is set