diff options
Diffstat (limited to 'src/utils')
-rw-r--r-- | src/utils/SkDeferredCanvas.cpp | 4 | ||||
-rw-r--r-- | src/utils/SkGatherPixelRefsAndRects.h | 19 | ||||
-rw-r--r-- | src/utils/SkPictureUtils.cpp | 4 |
3 files changed, 16 insertions, 11 deletions
diff --git a/src/utils/SkDeferredCanvas.cpp b/src/utils/SkDeferredCanvas.cpp index 06f7bb089a..c8402dda4a 100644 --- a/src/utils/SkDeferredCanvas.cpp +++ b/src/utils/SkDeferredCanvas.cpp @@ -210,8 +210,8 @@ protected: SkScalar x, SkScalar y, const SkPaint& paint) SK_OVERRIDE {SkASSERT(0);} virtual void drawPosText(const SkDraw&, const void* text, size_t len, - const SkScalar pos[], int scalarsPerPos, - const SkPoint& offset, const SkPaint& paint) SK_OVERRIDE + const SkScalar pos[], SkScalar constY, + int scalarsPerPos, const SkPaint& paint) SK_OVERRIDE {SkASSERT(0);} virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len, const SkPath& path, diff --git a/src/utils/SkGatherPixelRefsAndRects.h b/src/utils/SkGatherPixelRefsAndRects.h index 0a4bb5b84c..e1e5ccd92e 100644 --- a/src/utils/SkGatherPixelRefsAndRects.h +++ b/src/utils/SkGatherPixelRefsAndRects.h @@ -195,8 +195,8 @@ protected: this->drawRect(draw, bounds, paint); } virtual void drawPosText(const SkDraw& draw, const void* text, size_t len, - const SkScalar pos[], int scalarsPerPos, - const SkPoint& offset, const SkPaint& paint) SK_OVERRIDE { + const SkScalar pos[], SkScalar constY, + int scalarsPerPos, const SkPaint& paint) SK_OVERRIDE { SkBitmap bitmap; if (!GetBitmapFromPaint(paint, &bitmap)) { return; @@ -209,13 +209,18 @@ protected: // Similar to SkDraw asserts. SkASSERT(scalarsPerPos == 1 || scalarsPerPos == 2); - SkPoint min = SkPoint::Make(offset.x() + pos[0], - offset.y() + (2 == scalarsPerPos ? pos[1] : 0)); - SkPoint max = min; + SkScalar y = scalarsPerPos == 1 ? constY : constY + pos[1]; + + SkPoint min, max; + min.set(pos[0], y); + max.set(pos[0], y); for (size_t i = 1; i < len; ++i) { - SkScalar x = offset.x() + pos[i * scalarsPerPos]; - SkScalar y = offset.y() + (2 == scalarsPerPos ? pos[i * 2 + 1] : 0); + SkScalar x = pos[i * scalarsPerPos]; + SkScalar y = constY; + if (2 == scalarsPerPos) { + y += pos[i * scalarsPerPos + 1]; + } min.set(SkMinScalar(x, min.x()), SkMinScalar(y, min.y())); max.set(SkMaxScalar(x, max.x()), SkMaxScalar(y, max.y())); diff --git a/src/utils/SkPictureUtils.cpp b/src/utils/SkPictureUtils.cpp index 391e5ffc79..4f4d2bf30a 100644 --- a/src/utils/SkPictureUtils.cpp +++ b/src/utils/SkPictureUtils.cpp @@ -132,8 +132,8 @@ public: this->addBitmapFromPaint(paint); } virtual void drawPosText(const SkDraw&, const void* text, size_t len, - const SkScalar pos[], int, - const SkPoint&, const SkPaint& paint) SK_OVERRIDE { + const SkScalar pos[], SkScalar constY, + int, const SkPaint& paint) SK_OVERRIDE { this->addBitmapFromPaint(paint); } virtual void drawTextOnPath(const SkDraw&, const void* text, size_t len, |