diff options
author | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-01-26 22:10:41 +0000 |
---|---|---|
committer | reed@google.com <reed@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81> | 2011-01-26 22:10:41 +0000 |
commit | 618ef5ee3bc1fae284c766597fd518faabf7373d (patch) | |
tree | 9db94f1f402ae231fb81dfa27ddb5ed5a9699b4b | |
parent | 8af0b361657b0de0dd3183996976e9c557d7ae41 (diff) |
conditionalize impl on SK_SUPPORT_PDF, to help chrome build
git-svn-id: http://skia.googlecode.com/svn/trunk@740 2bbb7eff-a529-9590-31e7-b0007b416f81
-rw-r--r-- | src/ports/SkFontHost_FreeType.cpp | 57 |
1 files changed, 33 insertions, 24 deletions
diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp index c05e982215..05a1468b71 100644 --- a/src/ports/SkFontHost_FreeType.cpp +++ b/src/ports/SkFontHost_FreeType.cpp @@ -283,30 +283,7 @@ static void unref_ft_face(FT_Face face) { /////////////////////////////////////////////////////////////////////////// -void SkFontHost::FilterRec(SkScalerContext::Rec* rec) { - if (!gLCDSupportValid) { - InitFreetype(); - FT_Done_FreeType(gFTLibrary); - } - - if (!gLCDSupport && rec->isLCD()) { - // If the runtime Freetype library doesn't support LCD mode, we disable - // it here. - rec->fMaskFormat = SkMask::kA8_Format; - } - - SkPaint::Hinting h = rec->getHinting(); - if (SkPaint::kFull_Hinting == h && !rec->isLCD()) { - // collapse full->normal hinting if we're not doing LCD - h = SkPaint::kNormal_Hinting; - } else if ((rec->fFlags & SkScalerContext::kSubpixelPositioning_Flag) && - SkPaint::kNo_Hinting != h) { - // to do subpixel, we must have at most slight hinting - h = SkPaint::kSlight_Hinting; - } - rec->setHinting(h); -} - +#ifdef SK_SUPPORT_PDF static bool GetLetterCBox(FT_Face face, char letter, FT_BBox* bbox) { const FT_UInt glyph_id = FT_Get_Char_Index(face, letter); if (!glyph_id) @@ -585,6 +562,38 @@ SkPDFTypefaceInfo* SkFontHost::GetPDFTypefaceInfo(uint32_t fontID) { unref_ft_face(face); return info; } +#else +SkPDFTypefaceInfo* SkFontHost::GetPDFTypefaceInfo(uint32_t fontID) { + SkDebugf("--- GetPDFTypefaceInfo unimplemented\n"); + return NULL; +} +#endif + +/////////////////////////////////////////////////////////////////////////// + +void SkFontHost::FilterRec(SkScalerContext::Rec* rec) { + if (!gLCDSupportValid) { + InitFreetype(); + FT_Done_FreeType(gFTLibrary); + } + + if (!gLCDSupport && rec->isLCD()) { + // If the runtime Freetype library doesn't support LCD mode, we disable + // it here. + rec->fMaskFormat = SkMask::kA8_Format; + } + + SkPaint::Hinting h = rec->getHinting(); + if (SkPaint::kFull_Hinting == h && !rec->isLCD()) { + // collapse full->normal hinting if we're not doing LCD + h = SkPaint::kNormal_Hinting; + } else if ((rec->fFlags & SkScalerContext::kSubpixelPositioning_Flag) && + SkPaint::kNo_Hinting != h) { + // to do subpixel, we must have at most slight hinting + h = SkPaint::kSlight_Hinting; + } + rec->setHinting(h); +} SkScalerContext_FreeType::SkScalerContext_FreeType(const SkDescriptor* desc) : SkScalerContext(desc) { |