| 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 "SkFontMgr_indirect.h" | 8 #include "SkFontMgr_indirect.h" |
| 9 | 9 |
| 10 #include "SkDataTable.h" | 10 #include "SkDataTable.h" |
| 11 #include "SkFontStyle.h" | 11 #include "SkFontStyle.h" |
| 12 #include "SkMutex.h" |
| 12 #include "SkOnce.h" | 13 #include "SkOnce.h" |
| 13 #include "SkStream.h" | 14 #include "SkStream.h" |
| 14 #include "SkTSearch.h" | 15 #include "SkString.h" |
| 15 #include "SkTypeface.h" | 16 #include "SkTypeface.h" |
| 17 #include "SkTemplates.h" |
| 16 | 18 |
| 17 class SkData; | 19 class SkData; |
| 18 class SkString; | |
| 19 | 20 |
| 20 class SkStyleSet_Indirect : public SkFontStyleSet { | 21 class SkStyleSet_Indirect : public SkFontStyleSet { |
| 21 public: | 22 public: |
| 22 /** Takes ownership of the SkRemotableFontIdentitySet. */ | 23 /** Takes ownership of the SkRemotableFontIdentitySet. */ |
| 23 SkStyleSet_Indirect(const SkFontMgr_Indirect* owner, int familyIndex, | 24 SkStyleSet_Indirect(const SkFontMgr_Indirect* owner, int familyIndex, |
| 24 SkRemotableFontIdentitySet* data) | 25 SkRemotableFontIdentitySet* data) |
| 25 : fOwner(SkRef(owner)), fFamilyIndex(familyIndex), fData(data) | 26 : fOwner(SkRef(owner)), fFamilyIndex(familyIndex), fData(data) |
| 26 { } | 27 { } |
| 27 | 28 |
| 28 int count() override { return fData->count(); } | 29 int count() override { return fData->count(); } |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 290 face.reset(this->matchFamilyStyle(NULL, style)); | 291 face.reset(this->matchFamilyStyle(NULL, style)); |
| 291 } | 292 } |
| 292 | 293 |
| 293 if (NULL == face.get()) { | 294 if (NULL == face.get()) { |
| 294 SkFontIdentity fontId = this->fProxy->matchIndexStyle(0, style); | 295 SkFontIdentity fontId = this->fProxy->matchIndexStyle(0, style); |
| 295 face.reset(this->createTypefaceFromFontId(fontId)); | 296 face.reset(this->createTypefaceFromFontId(fontId)); |
| 296 } | 297 } |
| 297 | 298 |
| 298 return face.detach(); | 299 return face.detach(); |
| 299 } | 300 } |
| OLD | NEW |