Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(16)

Unified Diff: src/ports/SkFontHost_mac.cpp

Issue 949933003: Use traits instead of table for color glyph detection. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ports/SkFontHost_mac.cpp
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp
index fba8867de52b9ea3a6c6709119329e5f155550ce..c4330cab1d374f03a7908b95321427e007d96f50 100755
--- a/src/ports/SkFontHost_mac.cpp
+++ b/src/ports/SkFontHost_mac.cpp
@@ -444,21 +444,9 @@ public:
, fRequestedName(requestedName)
, fFontRef(fontRef) // caller has already called CFRetain for us
, fIsLocalStream(isLocalStream)
- , fHasSbixTable(false)
+ , fHasColorGlyphs(CTFontGetSymbolicTraits(fFontRef) & kCTFontColorGlyphsTrait)
{
SkASSERT(fontRef);
-
- AutoCFRelease<CFArrayRef> tags(CTFontCopyAvailableTables(fFontRef,kCTFontTableOptionNoOptions));
- if (tags) {
- int count = SkToInt(CFArrayGetCount(tags));
- for (int i = 0; i < count; ++i) {
- uintptr_t tag = reinterpret_cast<uintptr_t>(CFArrayGetValueAtIndex(tags, i));
- if ('sbix' == tag) {
- fHasSbixTable = true;
- break;
- }
- }
- }
}
SkString fRequestedName;
@@ -484,7 +472,7 @@ protected:
private:
bool fIsLocalStream;
- bool fHasSbixTable;
+ bool fHasColorGlyphs;
typedef SkTypeface INHERITED;
};
@@ -1897,7 +1885,7 @@ void SkTypeface_Mac::onFilterRec(SkScalerContextRec* rec) const {
// CoreText provides no information as to whether a glyph will be color or not.
// Fonts may mix outlines and bitmaps, so information is needed on a glyph by glyph basis.
// If a font contains an 'sbix' table, consider it to be a color font, and disable lcd.
- if (fHasSbixTable) {
+ if (fHasColorGlyphs) {
rec->fMaskFormat = SkMask::kARGB32_Format;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698