| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 | 54 |
| 55 return this->matchStyleCSS3(pattern); | 55 return this->matchStyleCSS3(pattern); |
| 56 } | 56 } |
| 57 private: | 57 private: |
| 58 SkAutoTUnref<const SkFontMgr_Indirect> fOwner; | 58 SkAutoTUnref<const SkFontMgr_Indirect> fOwner; |
| 59 int fFamilyIndex; | 59 int fFamilyIndex; |
| 60 SkAutoTUnref<SkRemotableFontIdentitySet> fData; | 60 SkAutoTUnref<SkRemotableFontIdentitySet> fData; |
| 61 }; | 61 }; |
| 62 | 62 |
| 63 void SkFontMgr_Indirect::set_up_family_names(const SkFontMgr_Indirect* self) { | 63 void SkFontMgr_Indirect::set_up_family_names(const SkFontMgr_Indirect* self) { |
| 64 self->fFamilyNames.reset(self->fProxy->getFamilyNames()); | 64 self->fFamilyNames = self->fProxy->getFamilyNames(); |
| 65 } | 65 } |
| 66 | 66 |
| 67 int SkFontMgr_Indirect::onCountFamilies() const { | 67 int SkFontMgr_Indirect::onCountFamilies() const { |
| 68 fFamilyNamesInitOnce(SkFontMgr_Indirect::set_up_family_names, this); | 68 fFamilyNamesInitOnce(SkFontMgr_Indirect::set_up_family_names, this); |
| 69 return fFamilyNames->count(); | 69 return fFamilyNames->count(); |
| 70 } | 70 } |
| 71 | 71 |
| 72 void SkFontMgr_Indirect::onGetFamilyName(int index, SkString* familyName) const
{ | 72 void SkFontMgr_Indirect::onGetFamilyName(int index, SkString* familyName) const
{ |
| 73 fFamilyNamesInitOnce(SkFontMgr_Indirect::set_up_family_names, this); | 73 fFamilyNamesInitOnce(SkFontMgr_Indirect::set_up_family_names, this); |
| 74 if (index >= fFamilyNames->count()) { | 74 if (index >= fFamilyNames->count()) { |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 face.reset(this->matchFamilyStyle(nullptr, style)); | 192 face.reset(this->matchFamilyStyle(nullptr, style)); |
| 193 } | 193 } |
| 194 | 194 |
| 195 if (nullptr == face.get()) { | 195 if (nullptr == face.get()) { |
| 196 SkFontIdentity fontId = this->fProxy->matchIndexStyle(0, style); | 196 SkFontIdentity fontId = this->fProxy->matchIndexStyle(0, style); |
| 197 face.reset(this->createTypefaceFromFontId(fontId)); | 197 face.reset(this->createTypefaceFromFontId(fontId)); |
| 198 } | 198 } |
| 199 | 199 |
| 200 return face.release(); | 200 return face.release(); |
| 201 } | 201 } |
| OLD | NEW |