Apply bilinear filtering to text.
Change-Id: I2c81ad657ee2a11a2139e0b11ae3749db54c0749
diff --git a/libs/hwui/FontRenderer.h b/libs/hwui/FontRenderer.h
index de5c019..4fb8f8d 100644
--- a/libs/hwui/FontRenderer.h
+++ b/libs/hwui/FontRenderer.h
@@ -183,14 +183,14 @@
}
bool fitBitmap(const SkGlyph& glyph, uint32_t *retOriginX, uint32_t *retOriginY) {
- if (glyph.fHeight > mMaxHeight) {
+ if (glyph.fHeight + 2 > mMaxHeight) {
return false;
}
- if (mCurrentCol + glyph.fWidth < mMaxWidth) {
- *retOriginX = mCurrentCol;
- *retOriginY = mCurrentRow;
- mCurrentCol += glyph.fWidth;
+ if (mCurrentCol + glyph.fWidth + 2 < mMaxWidth) {
+ *retOriginX = mCurrentCol + 1;
+ *retOriginY = mCurrentRow + 1;
+ mCurrentCol += glyph.fWidth + 2;
mDirty = true;
return true;
}