move specialization of 16 -vs- 32 lcd format to the fonthost

git-svn-id: http://skia.googlecode.com/svn/trunk@2351 2bbb7eff-a529-9590-31e7-b0007b416f81
This commit is contained in:
reed@google.com 2011-09-28 17:26:42 +00:00
parent 421093d99c
commit 2739b27d7d
2 changed files with 5 additions and 4 deletions

View File

@ -1195,6 +1195,7 @@ static void add_flattenable(SkDescriptor* desc, uint32_t tag,
buffer->flatten(desc->addEntry(tag, buffer->size(), NULL));
}
// SkFontHost can override this choice in FilterRec()
static SkMask::Format computeMaskFormat(const SkPaint& paint) {
uint32_t flags = paint.getFlags();
@ -1204,11 +1205,7 @@ static SkMask::Format computeMaskFormat(const SkPaint& paint) {
}
if (flags & SkPaint::kLCDRenderText_Flag) {
#if !defined(SK_SUPPORT_888_TEXT)
return SkMask::kLCD16_Format;
#else
return SkMask::kLCD32_Format;
#endif
}
return SkMask::kA8_Format;

View File

@ -1088,6 +1088,10 @@ void SkFontHost::FilterRec(SkScalerContext::Rec* rec) {
h = SkPaint::kNormal_Hinting;
}
rec->setHinting(h);
if (SkMask::kLCD16_Format == rec->fMaskFormat) {
rec->fMaskFormat = SkMask::kLCD32_Format;
}
}
///////////////////////////////////////////////////////////////////////////