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

Unified Diff: src/gpu/GrAtlasTextContext.cpp

Issue 1132853004: Keep Big Glyph coordinates in float in GrAtlasTextContext (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 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 | « src/gpu/GrAtlasTextContext.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/gpu/GrAtlasTextContext.cpp
diff --git a/src/gpu/GrAtlasTextContext.cpp b/src/gpu/GrAtlasTextContext.cpp
index 81769db6ec149a7b0126f29f9f963441d1951bc5..9b863f806c4da5b12cda6a6925c01763fe7d6388 100644
--- a/src/gpu/GrAtlasTextContext.cpp
+++ b/src/gpu/GrAtlasTextContext.cpp
@@ -1255,7 +1255,7 @@ void GrAtlasTextContext::bmpAppendGlyph(BitmapTextBlob* blob, int runIndex,
// If the glyph is too large we fall back to paths
if (glyph->fTooLargeForAtlas) {
- this->appendGlyphPath(blob, glyph, scaler, vx, vy);
+ this->appendGlyphPath(blob, glyph, scaler, SkIntToScalar(vx), SkIntToScalar(vy));
return;
}
@@ -1331,8 +1331,7 @@ bool GrAtlasTextContext::dfAppendGlyph(BitmapTextBlob* blob, int runIndex,
// TODO combine with the above
// If the glyph is too large we fall back to paths
if (glyph->fTooLargeForAtlas) {
- this->appendGlyphPath(blob, glyph, scaler, SkScalarRoundToInt(sx - dx),
- SkScalarRoundToInt(sy - dy));
+ this->appendGlyphPath(blob, glyph, scaler, sx - dx, sy - dy);
return true;
}
@@ -1349,7 +1348,7 @@ bool GrAtlasTextContext::dfAppendGlyph(BitmapTextBlob* blob, int runIndex,
}
inline void GrAtlasTextContext::appendGlyphPath(BitmapTextBlob* blob, GrGlyph* glyph,
- GrFontScaler* scaler, int x, int y) {
+ GrFontScaler* scaler, SkScalar x, SkScalar y) {
if (NULL == glyph->fPath) {
SkPath* path = SkNEW(SkPath);
if (!scaler->getGlyphPath(glyph->glyphID(), path)) {
@@ -2150,12 +2149,10 @@ inline void GrAtlasTextContext::flushBigGlyphs(BitmapTextBlob* cacheBlob, GrRend
const SkIRect& clipBounds) {
for (int i = 0; i < cacheBlob->fBigGlyphs.count(); i++) {
BitmapTextBlob::BigGlyph& bigGlyph = cacheBlob->fBigGlyphs[i];
- bigGlyph.fVx += SkScalarTruncToInt(transX);
- bigGlyph.fVy += SkScalarTruncToInt(transY);
+ bigGlyph.fVx += transX;
+ bigGlyph.fVy += transY;
SkMatrix translate;
- translate.setTranslate(SkIntToScalar(bigGlyph.fVx),
- SkIntToScalar(bigGlyph.fVy));
- GrStrokeInfo strokeInfo(SkStrokeRec::kFill_InitStyle);
+ translate.setTranslate(bigGlyph.fVx, bigGlyph.fVy);
fGpuDevice->internalDrawPath(bigGlyph.fPath, skPaint, SkMatrix::I(), &translate, clipBounds,
false);
}
« no previous file with comments | « src/gpu/GrAtlasTextContext.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698