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

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

Issue 365503003: Revert of Fix race condition in parallel font initialization. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 5 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_android.cpp ('k') | src/ports/SkFontHost_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 2009 Google Inc. 2 * Copyright 2009 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 /* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */
9 9
10 #include <string> 10 #include <string>
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 // new APIs 117 // new APIs
118 virtual SkDataTable* getFamilyNames() SK_OVERRIDE; 118 virtual SkDataTable* getFamilyNames() SK_OVERRIDE;
119 virtual bool matchFamilySet(const char inFamilyName[], 119 virtual bool matchFamilySet(const char inFamilyName[],
120 SkString* outFamilyName, 120 SkString* outFamilyName,
121 SkTArray<FontIdentity>*) SK_OVERRIDE; 121 SkTArray<FontIdentity>*) SK_OVERRIDE;
122 122
123 private: 123 private:
124 SkMutex mutex_; 124 SkMutex mutex_;
125 }; 125 };
126 126
127 SkFontConfigInterface* SkFontConfigInterface::GetSingletonDirectInterface(SkBase Mutex* mutex) { 127 SkFontConfigInterface* SkFontConfigInterface::GetSingletonDirectInterface() {
128 SkAutoMutexAcquire ac(mutex); 128 SK_DECLARE_STATIC_LAZY_PTR(SkFontConfigInterfaceDirect, direct);
129 static SkFontConfigInterfaceDirect* singleton = NULL; 129 return direct.get();
130 if (singleton == NULL) {
131 singleton = SkNEW(SkFontConfigInterfaceDirect);
132 }
133 return singleton;
134 } 130 }
135 131
136 /////////////////////////////////////////////////////////////////////////////// 132 ///////////////////////////////////////////////////////////////////////////////
137 133
138 // Returns the string from the pattern, or NULL 134 // Returns the string from the pattern, or NULL
139 static const char* get_name(FcPattern* pattern, const char field[], 135 static const char* get_name(FcPattern* pattern, const char field[],
140 int index = 0) { 136 int index = 0) {
141 const char* name; 137 const char* name;
142 if (FcPatternGetString(pattern, field, index, 138 if (FcPatternGetString(pattern, field, index,
143 (FcChar8**)&name) != FcResultMatch) { 139 (FcChar8**)&name) != FcResultMatch) {
(...skipping 580 matching lines...) Expand 10 before | Expand all | Expand 10 after
724 *trimmedMatches.append() = match[i]; 720 *trimmedMatches.append() = match[i];
725 } 721 }
726 } 722 }
727 723
728 SkFontStyleSet_FC* sset = SkNEW_ARGS(SkFontStyleSet_FC, 724 SkFontStyleSet_FC* sset = SkNEW_ARGS(SkFontStyleSet_FC,
729 (trimmedMatches.begin(), 725 (trimmedMatches.begin(),
730 trimmedMatches.count())); 726 trimmedMatches.count()));
731 #endif 727 #endif
732 return false; 728 return false;
733 } 729 }
OLDNEW
« no previous file with comments | « src/ports/SkFontConfigInterface_android.cpp ('k') | src/ports/SkFontHost_fontconfig.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698