diff options
Diffstat (limited to 'src/core/SkPaint.cpp')
-rw-r--r-- | src/core/SkPaint.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp index fc5e57c..412ab2b 100644 --- a/src/core/SkPaint.cpp +++ b/src/core/SkPaint.cpp @@ -72,6 +72,7 @@ SkPaint::SkPaint() { fHinting = SkPaintDefaults_Hinting; #ifdef SK_BUILD_FOR_ANDROID new(&fTextLocale) SkString(); + fFontVariant = kDefault_Variant; fGenerationID = 0; #endif } @@ -373,9 +374,17 @@ void SkPaint::setTextLocale(const SkString& locale) { } } -void SkPaint::setLanguage(const SkLanguage& language) { - setTextLocale(SkString(language.getTag())); +void SkPaint::setFontVariant(FontVariant fontVariant) { + if ((unsigned)fontVariant <= kLast_Variant) { + GEN_ID_INC_EVAL((unsigned)fontVariant != fFontVariant); + fFontVariant = fontVariant; + } else { +#ifdef SK_REPORT_API_RANGE_CHECK + SkDebugf("SkPaint::setFontVariant(%d) out of range\n", fontVariant); +#endif + } } + #endif /////////////////////////////////////////////////////////////////////////////// @@ -1565,6 +1574,9 @@ void SkScalerContext::MakeRec(const SkPaint& paint, #else rec->setLuminanceBits(computeLuminance(paint)); #endif +#ifdef SK_BUILD_FOR_ANDROID + rec->fFontVariant = paint.getFontVariant(); +#endif //SK_BUILD_FOR_ANDROID /* Allow the fonthost to modify our rec before we use it as a key into the cache. This way if we're asking for something that they will ignore, |