| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2014 Google Inc. | 2 * Copyright 2014 Google Inc. |
| 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 "SkDataTable.h" | 8 #include "SkDataTable.h" |
| 9 #include "SkFontDescriptor.h" | 9 #include "SkFontDescriptor.h" |
| 10 #include "SkFontHost_FreeType_common.h" | 10 #include "SkFontHost_FreeType_common.h" |
| (...skipping 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 * @param pattern a complete pattern from FcFontRenderPrepare. | 576 * @param pattern a complete pattern from FcFontRenderPrepare. |
| 577 */ | 577 */ |
| 578 SkTypeface* createTypefaceFromFcPattern(FcPattern* pattern) const { | 578 SkTypeface* createTypefaceFromFcPattern(FcPattern* pattern) const { |
| 579 FCLocker::AssertHeld(); | 579 FCLocker::AssertHeld(); |
| 580 SkAutoMutexAcquire ama(fTFCacheMutex); | 580 SkAutoMutexAcquire ama(fTFCacheMutex); |
| 581 SkTypeface* face = fTFCache.findByProcAndRef(FindByFcPattern, pattern); | 581 SkTypeface* face = fTFCache.findByProcAndRef(FindByFcPattern, pattern); |
| 582 if (NULL == face) { | 582 if (NULL == face) { |
| 583 FcPatternReference(pattern); | 583 FcPatternReference(pattern); |
| 584 face = SkTypeface_fontconfig::Create(pattern); | 584 face = SkTypeface_fontconfig::Create(pattern); |
| 585 if (face) { | 585 if (face) { |
| 586 fTFCache.add(face, SkFontStyle(), true); | 586 fTFCache.add(face, SkFontStyle()); |
| 587 } | 587 } |
| 588 } | 588 } |
| 589 return face; | 589 return face; |
| 590 } | 590 } |
| 591 | 591 |
| 592 public: | 592 public: |
| 593 SkFontMgr_fontconfig() | 593 SkFontMgr_fontconfig() |
| 594 : fFC(FcInitLoadConfigAndFonts()) | 594 : fFC(FcInitLoadConfigAndFonts()) |
| 595 , fFamilyNames(GetFamilyNames(fFC)) { } | 595 , fFamilyNames(GetFamilyNames(fFC)) { } |
| 596 | 596 |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 return typeface.detach(); | 859 return typeface.detach(); |
| 860 } | 860 } |
| 861 | 861 |
| 862 return this->matchFamilyStyle(NULL, style); | 862 return this->matchFamilyStyle(NULL, style); |
| 863 } | 863 } |
| 864 }; | 864 }; |
| 865 | 865 |
| 866 SkFontMgr* SkFontMgr::Factory() { | 866 SkFontMgr* SkFontMgr::Factory() { |
| 867 return SkNEW(SkFontMgr_fontconfig); | 867 return SkNEW(SkFontMgr_fontconfig); |
| 868 } | 868 } |
| OLD | NEW |