diff options
author | bungeman <bungeman@google.com> | 2015-02-23 16:17:43 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-02-23 16:17:43 -0800 |
commit | 994e818efe4b6dd01291c34fad29d49fb5586355 (patch) | |
tree | 6f8ca08c24f89fa953f762d2eedc411187c8ed88 /src | |
parent | 51fdb4f8f63b6bb13e719000381e225503a2d4a0 (diff) |
Provide Mac 10.6 SDK support for kCTFontColorGlyphsTrait.
kCTFontColorGlyphsTrait was introduced in Mac 10.7 and iPhone 4.3 SDKs.
Chromium still builds with the 10.6 SDK, so provide this constant when
it is otherwise unavailable.
TBR=mtklein@google.com
Review URL: https://codereview.chromium.org/951723003
Diffstat (limited to 'src')
-rwxr-xr-x | src/ports/SkFontHost_mac.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ports/SkFontHost_mac.cpp b/src/ports/SkFontHost_mac.cpp index c4330cab1d..8c1010b1f1 100755 --- a/src/ports/SkFontHost_mac.cpp +++ b/src/ports/SkFontHost_mac.cpp @@ -436,6 +436,14 @@ static SkFontID CTFontRef_to_SkFontID(CTFontRef fontRef) { #define WEIGHT_THRESHOLD ((SkFontStyle::kNormal_Weight + SkFontStyle::kBold_Weight)/2) +// kCTFontColorGlyphsTrait was added in the Mac 10.7 and iPhone 4.3 SDKs. +// Being an enum value it is not guarded by version macros, but old SDKs must still be supported. +#if defined(__MAC_10_7) || defined(__IPHONE_4_3) +static const uint32_t SkCTFontColorGlyphsTrait = kCTFontColorGlyphsTrait; +#else +static const uint32_t SkCTFontColorGlyphsTrait = (1 << 13); +#endif + class SkTypeface_Mac : public SkTypeface { public: SkTypeface_Mac(const SkFontStyle& fs, SkFontID fontID, bool isFixedPitch, @@ -444,7 +452,7 @@ public: , fRequestedName(requestedName) , fFontRef(fontRef) // caller has already called CFRetain for us , fIsLocalStream(isLocalStream) - , fHasColorGlyphs(CTFontGetSymbolicTraits(fFontRef) & kCTFontColorGlyphsTrait) + , fHasColorGlyphs(CTFontGetSymbolicTraits(fFontRef) & SkCTFontColorGlyphsTrait) { SkASSERT(fontRef); } |