diff --git a/include/config/SkUserConfig.h b/include/config/SkUserConfig.h index 05d92acdaf..0064193808 100644 --- a/include/config/SkUserConfig.h +++ b/include/config/SkUserConfig.h @@ -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. diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp index 0b8ec22f82..770569a25e 100644 --- a/src/core/SkPaint.cpp +++ b/src/core/SkPaint.cpp @@ -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); } /*