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

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

Issue 355573006: Fix race condition in parallel font initialization. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Make mutex optional 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_direct.cpp ('k') | no next file » | 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 2008 Google Inc. 2 * Copyright 2008 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 43
44 // convenience function to create the direct interface if none is installed. 44 // convenience function to create the direct interface if none is installed.
45 extern SkFontConfigInterface* SkCreateDirectFontConfigInterface(); 45 extern SkFontConfigInterface* SkCreateDirectFontConfigInterface();
46 46
47 static SkFontConfigInterface* RefFCI() { 47 static SkFontConfigInterface* RefFCI() {
48 for (;;) { 48 for (;;) {
49 SkFontConfigInterface* fci = SkFontConfigInterface::RefGlobal(); 49 SkFontConfigInterface* fci = SkFontConfigInterface::RefGlobal();
50 if (fci) { 50 if (fci) {
51 return fci; 51 return fci;
52 } 52 }
53 fci = SkFontConfigInterface::GetSingletonDirectInterface(); 53 fci = SkFontConfigInterface::GetSingletonDirectInterface(&gFontConfigInt erfaceMutex);
54 SkFontConfigInterface::SetGlobal(fci); 54 SkFontConfigInterface::SetGlobal(fci);
55 } 55 }
56 } 56 }
57 57
58 // export this to SkFontMgr_fontconfig.cpp until this file just goes away. 58 // export this to SkFontMgr_fontconfig.cpp until this file just goes away.
59 SkFontConfigInterface* SkFontHost_fontconfig_ref_global(); 59 SkFontConfigInterface* SkFontHost_fontconfig_ref_global();
60 SkFontConfigInterface* SkFontHost_fontconfig_ref_global() { 60 SkFontConfigInterface* SkFontHost_fontconfig_ref_global() {
61 return RefFCI(); 61 return RefFCI();
62 } 62 }
63 63
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
203 *ttcIndex = this->getIdentity().fTTCIndex; 203 *ttcIndex = this->getIdentity().fTTCIndex;
204 } 204 }
205 return stream; 205 return stream;
206 } 206 }
207 207
208 void FontConfigTypeface::onGetFontDescriptor(SkFontDescriptor* desc, 208 void FontConfigTypeface::onGetFontDescriptor(SkFontDescriptor* desc,
209 bool* isLocalStream) const { 209 bool* isLocalStream) const {
210 desc->setFamilyName(this->getFamilyName()); 210 desc->setFamilyName(this->getFamilyName());
211 *isLocalStream = SkToBool(this->getLocalStream()); 211 *isLocalStream = SkToBool(this->getLocalStream());
212 } 212 }
OLDNEW
« no previous file with comments | « src/ports/SkFontConfigInterface_direct.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698