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

Unified Diff: src/core/SkDraw.cpp

Issue 1831983002: Don't convert to Sk48Dot16 in DrawOneGlyph. (Closed) Base URL: https://skia.googlesource.com/skia@master
Patch Set: Created 4 years, 9 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 | « no previous file | no next file » | 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 60db401aea54408025f35e19c15d9668070ded33..b4bcc2ea4d8104b4c8c0632aac8269a06cbe3e2f 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;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698