add override for max-text-size for lcd

git-svn-id: http://skia.googlecode.com/svn/trunk@2258 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2011-09-13 17:20:30 +00:00
parent cecd3ac9d0
commit c27b74174e
2 changed files with 11 additions and 2 deletions

View File

@ -137,6 +137,13 @@
*/
//#define SK_ALLOW_OVER_32K_BITMAPS
/* Define this to set the upper limit for text to support LCD. Values that
are very large increase the cost in the font cache and draw slower, without
improving readability. If this is undefined, Skia will use its default
value (e.g. 48)
*/
//#define SK_MAX_SIZE_FOR_LCDTEXT 48
/* If SK_DEBUG is defined, then you can optionally define SK_SUPPORT_UNITTEST
which will run additional self-tests at startup. These can take a long time,
so this flag is optional.

View File

@ -1226,13 +1226,15 @@ static SkPaint::Hinting computeHinting(const SkPaint& paint) {
// Beyond this size, LCD doesn't appreciably improve quality, but it always
// cost more RAM and draws slower, so we set a cap.
static const SkScalar SK_MAX_SIZE_FOR_LCDTEXT = SkIntToScalar(48);
#ifndef SK_MAX_SIZE_FOR_LCDTEXT
#define SK_MAX_SIZE_FOR_LCDTEXT 48
#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) > SK_MAX_SIZE_FOR_LCDTEXT;
return SkScalarAbs(size) > SkIntToScalar(SK_MAX_SIZE_FOR_LCDTEXT);
}
/*