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

Side by Side Diff: src/fonts/SkFontMgr_fontconfig.cpp

Issue 240513003: Don't unset gFCSafeToUse when it's still safe to use. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 8 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 | « no previous file | 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 2013 Google Inc. 2 * Copyright 2013 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 "SkFontMgr.h" 8 #include "SkFontMgr.h"
9 #include "SkFontStyle.h" 9 #include "SkFontStyle.h"
10 #include "SkFontConfigInterface.h" 10 #include "SkFontConfigInterface.h"
(...skipping 20 matching lines...) Expand all
31 if (FcGetVersion() < 21091) { // We assume FcGetVersion() has always be en thread safe. 31 if (FcGetVersion() < 21091) { // We assume FcGetVersion() has always be en thread safe.
32 gFCMutex.acquire(); 32 gFCMutex.acquire();
33 fUnlock = true; 33 fUnlock = true;
34 } else { 34 } else {
35 fUnlock = false; 35 fUnlock = false;
36 } 36 }
37 gFCSafeToUse = true; 37 gFCSafeToUse = true;
38 } 38 }
39 39
40 ~FCLocker() { 40 ~FCLocker() {
41 gFCSafeToUse = false;
42 if (fUnlock) { 41 if (fUnlock) {
42 gFCSafeToUse = false;
43 gFCMutex.release(); 43 gFCMutex.release();
44 } 44 }
45 } 45 }
46 46
47 private: 47 private:
48 bool fUnlock; 48 bool fUnlock;
49 }; 49 };
50 50
51 } // namespace 51 } // namespace
52 52
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after
325 FCLocker lock; 325 FCLocker lock;
326 return FontConfigTypeface::LegacyCreateTypeface(NULL, familyName, 326 return FontConfigTypeface::LegacyCreateTypeface(NULL, familyName,
327 (SkTypeface::Style)styleBits); 327 (SkTypeface::Style)styleBits);
328 } 328 }
329 }; 329 };
330 330
331 SkFontMgr* SkFontMgr::Factory() { 331 SkFontMgr* SkFontMgr::Factory() {
332 SkFontConfigInterface* fci = RefFCI(); 332 SkFontConfigInterface* fci = RefFCI();
333 return fci ? SkNEW_ARGS(SkFontMgr_fontconfig, (fci)) : NULL; 333 return fci ? SkNEW_ARGS(SkFontMgr_fontconfig, (fci)) : NULL;
334 } 334 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698