| 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 "SkFontMgr.h" | 9 #include "SkFontMgr.h" |
| 10 #include "SkFontMgr_indirect.h" | 10 #include "SkFontMgr_indirect.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 return; | 171 return; |
| 172 } | 172 } |
| 173 familyName->set(fFamilyNames->atStr(index)); | 173 familyName->set(fFamilyNames->atStr(index)); |
| 174 } | 174 } |
| 175 | 175 |
| 176 SkFontStyleSet* SkFontMgr_Indirect::onCreateStyleSet(int index) const { | 176 SkFontStyleSet* SkFontMgr_Indirect::onCreateStyleSet(int index) const { |
| 177 SkRemotableFontIdentitySet* set = fProxy->getIndex(index); | 177 SkRemotableFontIdentitySet* set = fProxy->getIndex(index); |
| 178 if (NULL == set) { | 178 if (NULL == set) { |
| 179 return NULL; | 179 return NULL; |
| 180 } | 180 } |
| 181 return SkNEW_ARGS(SkStyleSet_Indirect, (this, index, set)); | 181 return new SkStyleSet_Indirect(this, index, set); |
| 182 } | 182 } |
| 183 | 183 |
| 184 SkFontStyleSet* SkFontMgr_Indirect::onMatchFamily(const char familyName[]) const
{ | 184 SkFontStyleSet* SkFontMgr_Indirect::onMatchFamily(const char familyName[]) const
{ |
| 185 return SkNEW_ARGS(SkStyleSet_Indirect, (this, -1, fProxy->matchName(familyNa
me))); | 185 return new SkStyleSet_Indirect(this, -1, fProxy->matchName(familyName)); |
| 186 } | 186 } |
| 187 | 187 |
| 188 SkTypeface* SkFontMgr_Indirect::createTypefaceFromFontId(const SkFontIdentity& i
d) const { | 188 SkTypeface* SkFontMgr_Indirect::createTypefaceFromFontId(const SkFontIdentity& i
d) const { |
| 189 if (id.fDataId == SkFontIdentity::kInvalidDataId) { | 189 if (id.fDataId == SkFontIdentity::kInvalidDataId) { |
| 190 return NULL; | 190 return NULL; |
| 191 } | 191 } |
| 192 | 192 |
| 193 SkAutoMutexAcquire ama(fDataCacheMutex); | 193 SkAutoMutexAcquire ama(fDataCacheMutex); |
| 194 | 194 |
| 195 SkAutoTUnref<SkTypeface> dataTypeface; | 195 SkAutoTUnref<SkTypeface> dataTypeface; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 295 face.reset(this->matchFamilyStyle(NULL, style)); | 295 face.reset(this->matchFamilyStyle(NULL, style)); |
| 296 } | 296 } |
| 297 | 297 |
| 298 if (NULL == face.get()) { | 298 if (NULL == face.get()) { |
| 299 SkFontIdentity fontId = this->fProxy->matchIndexStyle(0, style); | 299 SkFontIdentity fontId = this->fProxy->matchIndexStyle(0, style); |
| 300 face.reset(this->createTypefaceFromFontId(fontId)); | 300 face.reset(this->createTypefaceFromFontId(fontId)); |
| 301 } | 301 } |
| 302 | 302 |
| 303 return face.detach(); | 303 return face.detach(); |
| 304 } | 304 } |
| OLD | NEW |