From 2739b27d7d13691603d07982ff0d6dd0658bd364 Mon Sep 17 00:00:00 2001 From: "reed@google.com" Date: Wed, 28 Sep 2011 17:26:42 +0000 Subject: [PATCH] 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 --- src/core/SkPaint.cpp | 5 +---- src/ports/SkFontHost_mac_coretext.cpp | 4 ++++ 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/core/SkPaint.cpp b/src/core/SkPaint.cpp index 4afbed9c17..9197adde0f 100644 --- a/src/core/SkPaint.cpp +++ b/src/core/SkPaint.cpp @@ -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; diff --git a/src/ports/SkFontHost_mac_coretext.cpp b/src/ports/SkFontHost_mac_coretext.cpp index 021f2ecd6a..f0bc6b7fed 100644 --- a/src/ports/SkFontHost_mac_coretext.cpp +++ b/src/ports/SkFontHost_mac_coretext.cpp @@ -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; + } } ///////////////////////////////////////////////////////////////////////////