OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2006 The Android Open Source Project | 2 * Copyright 2006 The Android Open Source Project |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
6 */ | 6 */ |
7 | 7 |
8 #include "SkTypes.h" // Keep this before any #ifdef ... | 8 #include "SkTypes.h" // Keep this before any #ifdef ... |
9 #if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) | 9 #if defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) |
10 | 10 |
(...skipping 418 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
429 static const uint32_t SkCTFontColorGlyphsTrait = kCTFontColorGlyphsTrait; | 429 static const uint32_t SkCTFontColorGlyphsTrait = kCTFontColorGlyphsTrait; |
430 #else | 430 #else |
431 static const uint32_t SkCTFontColorGlyphsTrait = (1 << 13); | 431 static const uint32_t SkCTFontColorGlyphsTrait = (1 << 13); |
432 #endif | 432 #endif |
433 | 433 |
434 class SkTypeface_Mac : public SkTypeface { | 434 class SkTypeface_Mac : public SkTypeface { |
435 public: | 435 public: |
436 SkTypeface_Mac(CTFontRef fontRef, CFTypeRef resourceRef, | 436 SkTypeface_Mac(CTFontRef fontRef, CFTypeRef resourceRef, |
437 const SkFontStyle& fs, bool isFixedPitch, | 437 const SkFontStyle& fs, bool isFixedPitch, |
438 bool isLocalStream) | 438 bool isLocalStream) |
439 : SkTypeface(fs, SkTypefaceCache::NewFontID(), isFixedPitch) | 439 : SkTypeface(fs, isFixedPitch) |
440 , fFontRef(fontRef) // caller has already called CFRetain for us | 440 , fFontRef(fontRef) // caller has already called CFRetain for us |
441 , fOriginatingCFTypeRef(resourceRef) // caller has already called CFReta
in for us | 441 , fOriginatingCFTypeRef(resourceRef) // caller has already called CFReta
in for us |
442 , fHasColorGlyphs(SkToBool(CTFontGetSymbolicTraits(fFontRef) & SkCTFontC
olorGlyphsTrait)) | 442 , fHasColorGlyphs(SkToBool(CTFontGetSymbolicTraits(fFontRef) & SkCTFontC
olorGlyphsTrait)) |
443 , fIsLocalStream(isLocalStream) | 443 , fIsLocalStream(isLocalStream) |
444 { | 444 { |
445 SkASSERT(fontRef); | 445 SkASSERT(fontRef); |
446 } | 446 } |
447 | 447 |
448 AutoCFRelease<CTFontRef> fFontRef; | 448 AutoCFRelease<CTFontRef> fFontRef; |
449 AutoCFRelease<CFTypeRef> fOriginatingCFTypeRef; | 449 AutoCFRelease<CFTypeRef> fOriginatingCFTypeRef; |
(...skipping 2127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2577 | 2577 |
2578 return SkSafeRef(GetDefaultFace()); | 2578 return SkSafeRef(GetDefaultFace()); |
2579 } | 2579 } |
2580 }; | 2580 }; |
2581 | 2581 |
2582 /////////////////////////////////////////////////////////////////////////////// | 2582 /////////////////////////////////////////////////////////////////////////////// |
2583 | 2583 |
2584 SkFontMgr* SkFontMgr::Factory() { return new SkFontMgr_Mac; } | 2584 SkFontMgr* SkFontMgr::Factory() { return new SkFontMgr_Mac; } |
2585 | 2585 |
2586 #endif//defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) | 2586 #endif//defined(SK_BUILD_FOR_MAC) || defined(SK_BUILD_FOR_IOS) |
OLD | NEW |