aboutsummaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorGravatar benjaminwagner <benjaminwagner@google.com>2016-03-25 11:24:30 -0700
committerGravatar Commit bot <commit-bot@chromium.org>2016-03-25 11:24:30 -0700
commit77a9cc1dead147fc547895d3725d9ee2150cda73 (patch)
treebce525275f6242f4ed5bc7ad196810d60f5c03e6 /src
parentd442d32335a12964af1691b64977621d18048d20 (diff)
Don't convert to Sk48Dot16 in DrawOneGlyph.
Diffstat (limited to 'src')
-rw-r--r--src/core/SkDraw.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/core/SkDraw.cpp b/src/core/SkDraw.cpp
index 60db401aea..b4bcc2ea4d 100644
--- a/src/core/SkDraw.cpp
+++ b/src/core/SkDraw.cpp
@@ -1455,18 +1455,16 @@ public:
void operator()(const SkGlyph& glyph, SkPoint position, SkPoint rounding) {
position += rounding;
- Sk48Dot16 fx = SkScalarTo48Dot16(position.fX);
- Sk48Dot16 fy = SkScalarTo48Dot16(position.fY);
// Prevent glyphs from being drawn outside of or straddling the edge of device space.
- if ((fx >> 16) > INT_MAX - (INT16_MAX + UINT16_MAX) ||
- (fx >> 16) < INT_MIN - (INT16_MIN + 0 /*UINT16_MIN*/) ||
- (fy >> 16) > INT_MAX - (INT16_MAX + UINT16_MAX) ||
- (fy >> 16) < INT_MIN - (INT16_MIN + 0 /*UINT16_MIN*/)) {
+ if (position.fX > INT_MAX - (INT16_MAX + UINT16_MAX) ||
+ position.fX < INT_MIN - (INT16_MIN + 0 /*UINT16_MIN*/) ||
+ position.fY > INT_MAX - (INT16_MAX + UINT16_MAX) ||
+ position.fY < INT_MIN - (INT16_MIN + 0 /*UINT16_MIN*/)) {
return;
}
- int left = Sk48Dot16FloorToInt(fx);
- int top = Sk48Dot16FloorToInt(fy);
+ int left = SkScalarFloorToInt(position.fX);
+ int top = SkScalarFloorToInt(position.fY);
SkASSERT(glyph.fWidth > 0 && glyph.fHeight > 0);
left += glyph.fLeft;