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

Side by Side Diff: src/core/SkFontHost.cpp

Issue 651723003: Require SK_DECLARE_STATIC_LAZY_PTR is used in global scope. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: safe unref Created 6 years, 2 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/SkData.cpp ('k') | src/core/SkGlyphCache.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 2009 The Android Open Source Project 2 * Copyright 2009 The Android Open Source Project
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 "SkFontLCDConfig.h" 8 #include "SkFontLCDConfig.h"
9 #include "SkLazyPtr.h" 9 #include "SkLazyPtr.h"
10 10
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 return NULL; 191 return NULL;
192 } 192 }
193 return this->onCreateFromFile(path, ttcIndex); 193 return this->onCreateFromFile(path, ttcIndex);
194 } 194 }
195 195
196 SkTypeface* SkFontMgr::legacyCreateTypeface(const char familyName[], 196 SkTypeface* SkFontMgr::legacyCreateTypeface(const char familyName[],
197 unsigned styleBits) const { 197 unsigned styleBits) const {
198 return this->onLegacyCreateTypeface(familyName, styleBits); 198 return this->onLegacyCreateTypeface(familyName, styleBits);
199 } 199 }
200 200
201 SkFontMgr* SkFontMgr::CreateDefault() { 201 // As a template argument this must have external linkage.
202 SkFontMgr* sk_fontmgr_create_default() {
202 SkFontMgr* fm = SkFontMgr::Factory(); 203 SkFontMgr* fm = SkFontMgr::Factory();
203 return fm ? fm : SkNEW(SkEmptyFontMgr); 204 return fm ? fm : SkNEW(SkEmptyFontMgr);
204 } 205 }
205 206
207 SK_DECLARE_STATIC_LAZY_PTR(SkFontMgr, singleton, sk_fontmgr_create_default);
208
206 SkFontMgr* SkFontMgr::RefDefault() { 209 SkFontMgr* SkFontMgr::RefDefault() {
207 SK_DECLARE_STATIC_LAZY_PTR(SkFontMgr, singleton, CreateDefault);
208 return SkRef(singleton.get()); 210 return SkRef(singleton.get());
209 } 211 }
OLDNEW
« no previous file with comments | « src/core/SkData.cpp ('k') | src/core/SkGlyphCache.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698