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

Side by Side Diff: src/fonts/SkFontMgr_indirect.cpp

Issue 2211143002: Move to SkDataTable::MakeXXX and sk_sp. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Use bare pointer for global. Created 4 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
« no previous file with comments | « src/core/SkDataTable.cpp ('k') | src/ports/SkFontConfigInterface_direct.h » ('j') | 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 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
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
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 }
OLDNEW
« no previous file with comments | « src/core/SkDataTable.cpp ('k') | src/ports/SkFontConfigInterface_direct.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698