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

Unified Diff: src/gpu/GrBitmapTextContext.cpp

Issue 977623002: Glyph positions maintain 32 bit integer part. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Use Sk48Dot6, do no fixed math. Created 5 years, 10 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
Index: src/gpu/GrBitmapTextContext.cpp
diff --git a/src/gpu/GrBitmapTextContext.cpp b/src/gpu/GrBitmapTextContext.cpp
index d06df1c16bcce17ee33f8462e9512b2a2aef8b6e..740c039fc9448fdde68713db8b6563374fedad71 100755
--- a/src/gpu/GrBitmapTextContext.cpp
+++ b/src/gpu/GrBitmapTextContext.cpp
@@ -265,11 +265,11 @@ void GrBitmapTextContext::onDrawPosText(GrRenderTarget* rt, const GrClip& clip,
SkDEBUGCODE(SkFixed prevAdvY = metricGlyph.fAdvanceY;)
SkPoint tmsLoc;
tmsProc(pos, &tmsLoc);
- SkIPoint fixedLoc;
- alignProc(tmsLoc, metricGlyph, &fixedLoc);
+ SkPoint alignLoc;
+ alignProc(tmsLoc, metricGlyph, &alignLoc);
- SkFixed fx = fixedLoc.fX + halfSampleX;
- SkFixed fy = fixedLoc.fY + halfSampleY;
+ SkFixed fx = SkScalarToFixed(alignLoc.fX) + halfSampleX;
+ SkFixed fy = SkScalarToFixed(alignLoc.fY) + halfSampleY;
// have to call again, now that we've been "aligned"
const SkGlyph& glyph = glyphCacheProc(cache, &currentText,
@@ -320,11 +320,11 @@ void GrBitmapTextContext::onDrawPosText(GrRenderTarget* rt, const GrClip& clip,
SkPoint tmsLoc;
tmsProc(pos, &tmsLoc);
- SkIPoint fixedLoc;
- alignProc(tmsLoc, glyph, &fixedLoc);
+ SkPoint alignLoc;
+ alignProc(tmsLoc, glyph, &alignLoc);
- SkFixed fx = fixedLoc.fX + SK_FixedHalf; //halfSampleX;
- SkFixed fy = fixedLoc.fY + SK_FixedHalf; //halfSampleY;
+ SkFixed fx = SkScalarToFixed(alignLoc.fX) + SK_FixedHalf; //halfSampleX;
+ SkFixed fy = SkScalarToFixed(alignLoc.fY) + SK_FixedHalf; //halfSampleY;
this->appendGlyph(GrGlyph::Pack(glyph.getGlyphID(),
glyph.getSubXFixed(),
glyph.getSubYFixed()),

Powered by Google App Engine
This is Rietveld 408576698