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

Side by Side Diff: src/ports/SkFontMgr_fontconfig.cpp

Issue 664173003: Remove a pointless use of SkWeakRefCnt. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: missed also Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « src/ports/SkFontHost_win.cpp ('k') | src/ports/SkFontMgr_win_dw.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « src/ports/SkFontHost_win.cpp ('k') | src/ports/SkFontMgr_win_dw.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698