Round scale factors to rasterize text
Harder, better, faster, stronger.
Change-Id: Iee4125de98c4e61603f56bb7f06002cc86458214
diff --git a/libs/hwui/font/Font.cpp b/libs/hwui/font/Font.cpp
index 9307f11..c932087 100644
--- a/libs/hwui/font/Font.cpp
+++ b/libs/hwui/font/Font.cpp
@@ -53,8 +53,8 @@
mStrokeWidth = paint->getStrokeWidth();
mAntiAliasing = paint->isAntiAlias();
mLookupTransform.reset();
- mLookupTransform[SkMatrix::kMScaleX] = matrix[mat4::kScaleX];
- mLookupTransform[SkMatrix::kMScaleY] = matrix[mat4::kScaleY];
+ mLookupTransform[SkMatrix::kMScaleX] = roundf(fmaxf(1.0f, matrix[mat4::kScaleX]));
+ mLookupTransform[SkMatrix::kMScaleY] = roundf(fmaxf(1.0f, matrix[mat4::kScaleY]));
if (!mLookupTransform.invert(&mInverseLookupTransform)) {
ALOGW("Could not query the inverse lookup transform for this font");
}