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

Side by Side Diff: src/core/SkFontHost.cpp

Issue 22849025: Implement SkEmptyFontMgr::onLegacyCreateTypeface and make pure virtual. (Closed) Base URL: http://skia.googlecode.com/svn/trunk/
Patch Set: Created 7 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « include/ports/SkFontMgr.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 2009 The Android Open Source Project 2 * Copyright 2009 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 "SkFontLCDConfig.h" 8 #include "SkFontLCDConfig.h"
9 9
10 static SkFontLCDConfig::LCDOrientation gLCDOrientation = SkFontLCDConfig::kHoriz ontal_LCDOrientation; 10 static SkFontLCDConfig::LCDOrientation gLCDOrientation = SkFontLCDConfig::kHoriz ontal_LCDOrientation;
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 } 119 }
120 virtual SkTypeface* onCreateFromData(SkData*, int) SK_OVERRIDE { 120 virtual SkTypeface* onCreateFromData(SkData*, int) SK_OVERRIDE {
121 return NULL; 121 return NULL;
122 } 122 }
123 virtual SkTypeface* onCreateFromStream(SkStream*, int) SK_OVERRIDE { 123 virtual SkTypeface* onCreateFromStream(SkStream*, int) SK_OVERRIDE {
124 return NULL; 124 return NULL;
125 } 125 }
126 virtual SkTypeface* onCreateFromFile(const char[], int) SK_OVERRIDE { 126 virtual SkTypeface* onCreateFromFile(const char[], int) SK_OVERRIDE {
127 return NULL; 127 return NULL;
128 } 128 }
129 virtual SkTypeface* onLegacyCreateTypeface(const char [], unsigned) SK_OVERR IDE {
130 return NULL;
131 }
129 }; 132 };
130 133
131 static SkFontStyleSet* emptyOnNull(SkFontStyleSet* fsset) { 134 static SkFontStyleSet* emptyOnNull(SkFontStyleSet* fsset) {
132 if (NULL == fsset) { 135 if (NULL == fsset) {
133 fsset = SkFontStyleSet::CreateEmpty(); 136 fsset = SkFontStyleSet::CreateEmpty();
134 } 137 }
135 return fsset; 138 return fsset;
136 } 139 }
137 140
138 int SkFontMgr::countFamilies() { 141 int SkFontMgr::countFamilies() {
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 return NULL; 183 return NULL;
181 } 184 }
182 return this->onCreateFromFile(path, ttcIndex); 185 return this->onCreateFromFile(path, ttcIndex);
183 } 186 }
184 187
185 SkTypeface* SkFontMgr::legacyCreateTypeface(const char familyName[], 188 SkTypeface* SkFontMgr::legacyCreateTypeface(const char familyName[],
186 unsigned styleBits) { 189 unsigned styleBits) {
187 return this->onLegacyCreateTypeface(familyName, styleBits); 190 return this->onLegacyCreateTypeface(familyName, styleBits);
188 } 191 }
189 192
190 SkTypeface* SkFontMgr::onLegacyCreateTypeface(const char familyName[],
191 unsigned styleBits) {
192 SkASSERT(!"unimplemented");
193 return NULL;
194 }
195
196 SkFontMgr* SkFontMgr::RefDefault() { 193 SkFontMgr* SkFontMgr::RefDefault() {
197 static SkFontMgr* gFM; 194 static SkFontMgr* gFM;
198 if (NULL == gFM) { 195 if (NULL == gFM) {
199 gFM = SkFontMgr::Factory(); 196 gFM = SkFontMgr::Factory();
200 // we never want to return NULL 197 // we never want to return NULL
201 if (NULL == gFM) { 198 if (NULL == gFM) {
202 gFM = SkNEW(SkEmptyFontMgr); 199 gFM = SkNEW(SkEmptyFontMgr);
203 } 200 }
204 } 201 }
205 return SkRef(gFM); 202 return SkRef(gFM);
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 SkAutoTUnref<SkFontMgr> fm(SkFontMgr::RefDefault()); 234 SkAutoTUnref<SkFontMgr> fm(SkFontMgr::RefDefault());
238 return fm->createFromFile(path); 235 return fm->createFromFile(path);
239 } 236 }
240 237
241 SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream* stream) { 238 SkTypeface* SkFontHost::CreateTypefaceFromStream(SkStream* stream) {
242 SkAutoTUnref<SkFontMgr> fm(SkFontMgr::RefDefault()); 239 SkAutoTUnref<SkFontMgr> fm(SkFontMgr::RefDefault());
243 return fm->createFromStream(stream); 240 return fm->createFromStream(stream);
244 } 241 }
245 242
246 #endif 243 #endif
OLDNEW
« no previous file with comments | « include/ports/SkFontMgr.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698