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

Side by Side Diff: src/ports/SkFontConfigInterface_direct_factory.cpp

Issue 1936213002: Clean up SkFontConfigInterface implementation. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: SkOnce Created 4 years, 7 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
OLDNEW
1 /* 1 /*
2 * Copyright 2009-2015 Google Inc. 2 * Copyright 2009-2015 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 /* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */ 8 #include "SkFontConfigInterface_direct.h"
9 #include "SkOnce.h"
9 10
10 #include "SkFontConfigInterface_direct.h" 11 SkFontConfigInterface* SkFontConfigInterface::GetSingletonDirectInterface() {
11 #include "SkMutex.h" 12 static SkFontConfigInterface* singleton;
12 13 static SkOnce once;
13 SkFontConfigInterface* SkFontConfigInterface::GetSingletonDirectInterface(SkBase Mutex* mutex) { 14 once([]{ singleton = new SkFontConfigInterfaceDirect(); });
14 SkAutoMutexAcquire ac(mutex);
15 static SkFontConfigInterfaceDirect* singleton = nullptr;
16 if (singleton == nullptr) {
17 singleton = new SkFontConfigInterfaceDirect;
18 }
19 return singleton; 15 return singleton;
20 } 16 }
OLDNEW
« no previous file with comments | « src/ports/SkFontConfigInterface_direct.cpp ('k') | src/ports/SkFontConfigInterface_direct_google3_factory.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698