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

Side by Side Diff: src/ports/SkFontMgr_FontConfigInterface.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/ports/SkFontConfigInterface_direct.cpp ('k') | src/ports/SkFontMgr_fontconfig.cpp » ('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 2013 Google Inc. 2 * Copyright 2013 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 "SkFontConfigInterface.h" 8 #include "SkFontConfigInterface.h"
9 #include "SkFontConfigTypeface.h" 9 #include "SkFontConfigTypeface.h"
10 #include "SkFontDescriptor.h" 10 #include "SkFontDescriptor.h"
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
132 SkTypeface_FCI* cachedFCTypeface = static_cast<SkTypeface_FCI*>(cachedTypefa ce); 132 SkTypeface_FCI* cachedFCTypeface = static_cast<SkTypeface_FCI*>(cachedTypefa ce);
133 FontIdentity* identity = static_cast<FontIdentity*>(ctx); 133 FontIdentity* identity = static_cast<FontIdentity*>(ctx);
134 134
135 return cachedFCTypeface->getIdentity() == *identity; 135 return cachedFCTypeface->getIdentity() == *identity;
136 } 136 }
137 137
138 /////////////////////////////////////////////////////////////////////////////// 138 ///////////////////////////////////////////////////////////////////////////////
139 139
140 class SkFontMgr_FCI : public SkFontMgr { 140 class SkFontMgr_FCI : public SkFontMgr {
141 SkAutoTUnref<SkFontConfigInterface> fFCI; 141 SkAutoTUnref<SkFontConfigInterface> fFCI;
142 SkAutoTUnref<SkDataTable> fFamilyNames; 142 sk_sp<SkDataTable> fFamilyNames;
143 SkTypeface_FreeType::Scanner fScanner; 143 SkTypeface_FreeType::Scanner fScanner;
144 144
145 mutable SkMutex fMutex; 145 mutable SkMutex fMutex;
146 mutable SkTypefaceCache fTFCache; 146 mutable SkTypefaceCache fTFCache;
147 147
148 // The value of maxSize here is a compromise between cache hits and cache si ze. 148 // The value of maxSize here is a compromise between cache hits and cache si ze.
149 // See https://crbug.com/424082#63 for reason for current size. 149 // See https://crbug.com/424082#63 for reason for current size.
150 static const size_t kMaxSize = 1 << 15; 150 static const size_t kMaxSize = 1 << 15;
151 mutable SkFontRequestCache fCache; 151 mutable SkFontRequestCache fCache;
152 152
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 fCache.add(face, request.release()); 244 fCache.add(face, request.release());
245 245
246 return face; 246 return face;
247 } 247 }
248 }; 248 };
249 249
250 SK_API SkFontMgr* SkFontMgr_New_FCI(SkFontConfigInterface* fci) { 250 SK_API SkFontMgr* SkFontMgr_New_FCI(SkFontConfigInterface* fci) {
251 SkASSERT(fci); 251 SkASSERT(fci);
252 return new SkFontMgr_FCI(fci); 252 return new SkFontMgr_FCI(fci);
253 } 253 }
OLDNEW
« no previous file with comments | « src/ports/SkFontConfigInterface_direct.cpp ('k') | src/ports/SkFontMgr_fontconfig.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698