change tooBitForLCD to compare against linear size of the text, not the area
authorcommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 14 Mar 2014 22:59:05 +0000 (22:59 +0000)
committercommit-bot@chromium.org <commit-bot@chromium.org@2bbb7eff-a529-9590-31e7-b0007b416f81>
Fri, 14 Mar 2014 22:59:05 +0000 (22:59 +0000)
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

src/core/SkPaint.cpp

index 47e9aa2..2449ed6 100644 (file)
@@ -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);
 }
 
 /*