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

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

Issue 924333003: Remove FontConfigTypeface::getFamilyName(). (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 unified diff | Download patch
« no previous file with comments | « src/ports/SkFontConfigTypeface.h ('k') | no next file » | 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 2008 Google Inc. 2 * Copyright 2008 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 "SkFontConfigInterface.h" 8 #include "SkFontConfigInterface.h"
9 #include "SkFontConfigTypeface.h" 9 #include "SkFontConfigTypeface.h"
10 #include "SkFontDescriptor.h" 10 #include "SkFontDescriptor.h"
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after
78 78
79 SkTypeface* FontConfigTypeface::LegacyCreateTypeface( 79 SkTypeface* FontConfigTypeface::LegacyCreateTypeface(
80 const SkTypeface* familyFace, 80 const SkTypeface* familyFace,
81 const char familyName[], 81 const char familyName[],
82 SkTypeface::Style style) { 82 SkTypeface::Style style) {
83 SkAutoTUnref<SkFontConfigInterface> fci(RefFCI()); 83 SkAutoTUnref<SkFontConfigInterface> fci(RefFCI());
84 if (NULL == fci.get()) { 84 if (NULL == fci.get()) {
85 return NULL; 85 return NULL;
86 } 86 }
87 87
88 SkString familyFaceName;
88 if (familyFace) { 89 if (familyFace) {
bungeman-skia 2015/02/18 21:05:49 It turns out we never actually come down this path
89 FontConfigTypeface* fct = (FontConfigTypeface*)familyFace; 90 familyFace->getFamilyName(&familyFaceName);
90 familyName = fct->getFamilyName(); 91 familyName = familyFaceName.c_str();
91 } 92 }
92 93
93 SkFontStyle requestedStyle(style); 94 SkFontStyle requestedStyle(style);
94 FindRec rec(familyName, requestedStyle); 95 FindRec rec(familyName, requestedStyle);
95 SkTypeface* face = SkTypefaceCache::FindByProcAndRef(find_proc, &rec); 96 SkTypeface* face = SkTypefaceCache::FindByProcAndRef(find_proc, &rec);
96 if (face) { 97 if (face) {
97 //SkDebugf("found cached face <%s> <%s> %p [%d]\n", 98 //SkDebugf("found cached face <%s> <%s> %p [%d]\n",
98 // familyName, ((FontConfigTypeface*)face)->getFamilyName(), 99 // familyName, ((FontConfigTypeface*)face)->getFamilyName(),
99 // face, face->getRefCnt()); 100 // face, face->getRefCnt());
100 return face; 101 return face;
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 SkAutoTUnref<SkFontConfigInterface> fci(RefFCI()); 138 SkAutoTUnref<SkFontConfigInterface> fci(RefFCI());
138 if (NULL == fci.get()) { 139 if (NULL == fci.get()) {
139 return NULL; 140 return NULL;
140 } 141 }
141 142
142 *ttcIndex = this->getIdentity().fTTCIndex; 143 *ttcIndex = this->getIdentity().fTTCIndex;
143 return fci->openStream(this->getIdentity()); 144 return fci->openStream(this->getIdentity());
144 } 145 }
145 146
146 void FontConfigTypeface::onGetFamilyName(SkString* familyName) const { 147 void FontConfigTypeface::onGetFamilyName(SkString* familyName) const {
147 *familyName = this->getFamilyName(); 148 *familyName = fFamilyName;
148 } 149 }
149 150
150 void FontConfigTypeface::onGetFontDescriptor(SkFontDescriptor* desc, 151 void FontConfigTypeface::onGetFontDescriptor(SkFontDescriptor* desc,
151 bool* isLocalStream) const { 152 bool* isLocalStream) const {
152 desc->setFamilyName(this->getFamilyName()); 153 SkString name;
154 this->getFamilyName(&name);
155 desc->setFamilyName(name.c_str());
153 desc->setFontIndex(this->getIdentity().fTTCIndex); 156 desc->setFontIndex(this->getIdentity().fTTCIndex);
154 *isLocalStream = SkToBool(this->getLocalStream()); 157 *isLocalStream = SkToBool(this->getLocalStream());
155 } 158 }
OLDNEW
« no previous file with comments | « src/ports/SkFontConfigTypeface.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698