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

Side by Side Diff: src/ports/SkFontConfigInterface_android.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 | « include/ports/SkFontConfigInterface.h ('k') | src/ports/SkFontConfigInterface_direct.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 /* 2 /*
3 * Copyright 2013 The Android Open Source Project 3 * Copyright 2013 The Android Open Source Project
4 * 4 *
5 * Use of this source code is governed by a BSD-style license that can be 5 * Use of this source code is governed by a BSD-style license that can be
6 * found in the LICENSE file. 6 * found in the LICENSE file.
7 */ 7 */
8 8
9 #include "SkFontConfigInterface.h" 9 #include "SkFontConfigInterface.h"
10 #include "SkTypeface_android.h" 10 #include "SkTypeface_android.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 } 148 }
149 149
150 gFontConfigInterface = new SkFontConfigInterfaceAndroid(fontFamilies); 150 gFontConfigInterface = new SkFontConfigInterfaceAndroid(fontFamilies);
151 151
152 // cleanup the data we received from the parser 152 // cleanup the data we received from the parser
153 fontFamilies.deleteAll(); 153 fontFamilies.deleteAll();
154 } 154 }
155 return gFontConfigInterface; 155 return gFontConfigInterface;
156 } 156 }
157 157
158 SkFontConfigInterface* SkFontConfigInterface::GetSingletonDirectInterface() { 158 SkFontConfigInterface* SkFontConfigInterface::GetSingletonDirectInterface(SkBase Mutex*) {
159 // Doesn't need passed-in mutex because getSingletonInterface() uses one
159 return getSingletonInterface(); 160 return getSingletonInterface();
160 } 161 }
161 162
162 /////////////////////////////////////////////////////////////////////////////// 163 ///////////////////////////////////////////////////////////////////////////////
163 164
164 static bool has_font(const SkTArray<FontRec>& array, const SkString& filename) { 165 static bool has_font(const SkTArray<FontRec>& array, const SkString& filename) {
165 for (int i = 0; i < array.count(); i++) { 166 for (int i = 0; i < array.count(); i++) {
166 if (array[i].fFileName == filename) { 167 if (array[i].fFileName == filename) {
167 return true; 168 return true;
168 } 169 }
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 return SkSafeRef(retTypeface); 907 return SkSafeRef(retTypeface);
907 } 908 }
908 909
909 #endif 910 #endif
910 911
911 /////////////////////////////////////////////////////////////////////////////// 912 ///////////////////////////////////////////////////////////////////////////////
912 913
913 SkFontMgr* SkFontMgr::Factory() { 914 SkFontMgr* SkFontMgr::Factory() {
914 return NULL; 915 return NULL;
915 } 916 }
OLDNEW
« no previous file with comments | « include/ports/SkFontConfigInterface.h ('k') | src/ports/SkFontConfigInterface_direct.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698