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

Unified Diff: src/core/SkPaint.cpp

Issue 200643003: change tooBitForLCD to compare against linear size of the text, not the area (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: Created 6 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/core/SkPaint.cpp
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp
index 47e9aa2571f457105a84d75f724f7d413fab07db..2449ed6793c241fa55ce5c0dfccc77ec72a34a7a 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);
}
/*
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698