diff options
author | 2014-03-14 22:59:05 +0000 | |
---|---|---|
committer | 2014-03-14 22:59:05 +0000 | |
commit | e78f7cfced5787f741d0e1a4911b2bea2dfa2f02 (patch) | |
tree | b11ac951d7a5978d9fe0fd897bdafd9195523468 /src/core | |
parent | e01cdb3a204e9038bc80710ace87524d1488f78a (diff) |
change tooBitForLCD to compare against linear size of the text, not the area
BUG=skia:
R=bungeman@google.com, alokp@google.com
Author: reed@google.com
Review URL: https://codereview.chromium.org/200643003
git-svn-id: http://skia.googlecode.com/svn/trunk@13817 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/SkPaint.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp index 47e9aa2571..2449ed6793 100644 --- a/src/core/SkPaint.cpp +++ b/src/core/SkPaint.cpp @@ -1552,10 +1552,10 @@ static SkColor computeLuminanceColor(const SkPaint& paint) { #endif static bool tooBigForLCD(const SkScalerContext::Rec& rec) { - SkScalar area = SkScalarMul(rec.fPost2x2[0][0], rec.fPost2x2[1][1]) - - SkScalarMul(rec.fPost2x2[1][0], rec.fPost2x2[0][1]); - SkScalar size = SkScalarMul(area, rec.fTextSize); - return SkScalarAbs(size) > SkIntToScalar(SK_MAX_SIZE_FOR_LCDTEXT); + SkScalar area = rec.fPost2x2[0][0] * rec.fPost2x2[1][1] - + rec.fPost2x2[1][0] * rec.fPost2x2[0][1]; + SkScalar size = SkScalarSqrt(SkScalarAbs(area)) * rec.fTextSize; + return size > SkIntToScalar(SK_MAX_SIZE_FOR_LCDTEXT); } /* |