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

Unified Diff: src/gpu/GrDistanceFieldTextContext.cpp

Issue 298753005: Remove 1/2 pixel offsets for distance field layout. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 7 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/gpu/GrDistanceFieldTextContext.cpp
diff --git a/src/gpu/GrDistanceFieldTextContext.cpp b/src/gpu/GrDistanceFieldTextContext.cpp
index afc2a47ff15603f8f14ecf8b8dd43fc99302eedb..2d2f9a14432dd7aae4a719e6469858f30bb8ef84 100755
--- a/src/gpu/GrDistanceFieldTextContext.cpp
+++ b/src/gpu/GrDistanceFieldTextContext.cpp
@@ -416,8 +416,8 @@ void GrDistanceFieldTextContext::drawText(const GrPaint& paint, const SkPaint& s
y -= alignY;
}
- SkFixed fx = SkScalarToFixed(x) + SK_FixedHalf;
- SkFixed fy = SkScalarToFixed(y) + SK_FixedHalf;
+ SkFixed fx = SkScalarToFixed(x);
+ SkFixed fy = SkScalarToFixed(y);
SkFixed fixedScale = SkScalarToFixed(sizeRatio);
while (text < stop) {
const SkGlyph& glyph = glyphCacheProc(cache, &text, 0, 0);
@@ -426,8 +426,8 @@ void GrDistanceFieldTextContext::drawText(const GrPaint& paint, const SkPaint& s
this->drawPackedGlyph(GrGlyph::Pack(glyph.getGlyphID(),
glyph.getSubXFixed(),
glyph.getSubYFixed()),
- SkFixedFloorToFixed(fx),
- SkFixedFloorToFixed(fy),
+ fx,
+ fy,
fontScaler);
}
@@ -473,8 +473,8 @@ void GrDistanceFieldTextContext::drawPosText(const GrPaint& paint, const SkPaint
this->drawPackedGlyph(GrGlyph::Pack(glyph.getGlyphID(),
glyph.getSubXFixed(),
glyph.getSubYFixed()),
- SkScalarToFixed(x) + SK_FixedHalf, //d1g.fHalfSampleX,
- SkScalarToFixed(y) + SK_FixedHalf, //d1g.fHalfSampleY,
+ SkScalarToFixed(x),
+ SkScalarToFixed(y),
fontScaler);
}
pos += scalarsPerPosition;
@@ -492,10 +492,8 @@ void GrDistanceFieldTextContext::drawPosText(const GrPaint& paint, const SkPaint
this->drawPackedGlyph(GrGlyph::Pack(glyph.getGlyphID(),
glyph.getSubXFixed(),
glyph.getSubYFixed()),
- SkScalarToFixed(x) - (glyph.fAdvanceX >> alignShift)
- + SK_FixedHalf, //d1g.fHalfSampleX,
- SkScalarToFixed(y) - (glyph.fAdvanceY >> alignShift)
- + SK_FixedHalf, //d1g.fHalfSampleY,
+ SkScalarToFixed(x) - (glyph.fAdvanceX >> alignShift),
+ SkScalarToFixed(y) - (glyph.fAdvanceY >> alignShift),
fontScaler);
}
pos += scalarsPerPosition;
« 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