aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/core/SkPaint.cpp
diff options
context:
space:
mode:
authorGravatar bungeman <bungeman@google.com>2015-03-11 14:05:29 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2015-03-11 14:05:29 -0700
commit79738cc7bf12d212bef4ff80591d1bf6f383663d (patch)
treecb1d0da5197677a65209309a696b447f1c371f11 /src/core/SkPaint.cpp
parentdd8c637bc74be9a03c5738e6b37f62bbd653846b (diff)
Glyph positions maintain 32 bit integer part.
A glyph position when mapped from canvas space to device space may land outside the bounds of the current 16 bit integer part of device space. Device space is already limited to 32 bits for the integer part, but for a short space in drawText and drawPosText it is currently limited to 16 bits (SkFixed). Raise this limit by moving to 48.16. This matches the current similar fix for measureText. BUG=chromium:375322 Review URL: https://codereview.chromium.org/977623002
Diffstat (limited to 'src/core/SkPaint.cpp')
-rw-r--r--src/core/SkPaint.cpp8
1 files changed, 0 insertions, 8 deletions
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index 5774839ed8..b93236f0d1 100644
--- a/src/core/SkPaint.cpp
+++ b/src/core/SkPaint.cpp
@@ -804,14 +804,6 @@ static void set_bounds(const SkGlyph& g, SkRect* bounds) {
SkIntToScalar(g.fTop + g.fHeight));
}
-// 64bits wide, with a 16bit bias. Useful when accumulating lots of 16.16 so
-// we don't overflow along the way
-typedef int64_t Sk48Dot16;
-
-static inline float Sk48Dot16ToScalar(Sk48Dot16 x) {
- return (float) (x * 1.5258789e-5); // x * (1 / 65536.0f)
-}
-
static void join_bounds_x(const SkGlyph& g, SkRect* bounds, Sk48Dot16 dx) {
SkScalar sx = Sk48Dot16ToScalar(dx);
bounds->join(SkIntToScalar(g.fLeft) + sx,