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

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

Issue 1945353003: Revert of SK_DECLARE_STATIC_MUTEX -> static SkMutex (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: 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
« no previous file with comments | « src/ports/SkFontHost_mac.cpp ('k') | src/ports/SkTLS_win.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 2014 Google Inc. 2 * Copyright 2014 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 "SkDataTable.h" 8 #include "SkDataTable.h"
9 #include "SkFixed.h" 9 #include "SkFixed.h"
10 #include "SkFontDescriptor.h" 10 #include "SkFontDescriptor.h"
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 * interesting if the values go against convention. 55 * interesting if the values go against convention.
56 * 56 *
57 * Somewhat like DirectWrite, FontConfig supports synthetics through FC_EMBOLDE N and FC_MATRIX. 57 * Somewhat like DirectWrite, FontConfig supports synthetics through FC_EMBOLDE N and FC_MATRIX.
58 * Like all synthetic information, such information must be passed with the fon t data. 58 * Like all synthetic information, such information must be passed with the fon t data.
59 */ 59 */
60 60
61 namespace { 61 namespace {
62 62
63 // Fontconfig is not threadsafe before 2.10.91. Before that, we lock with a glob al mutex. 63 // Fontconfig is not threadsafe before 2.10.91. Before that, we lock with a glob al mutex.
64 // See https://bug.skia.org/1497 for background. 64 // See https://bug.skia.org/1497 for background.
65 static SkMutex gFCMutex; 65 SK_DECLARE_STATIC_MUTEX(gFCMutex);
66 66
67 #ifdef SK_DEBUG 67 #ifdef SK_DEBUG
68 void* CreateThreadFcLocked() { return new bool(false); } 68 void* CreateThreadFcLocked() { return new bool(false); }
69 void DeleteThreadFcLocked(void* v) { delete static_cast<bool*>(v); } 69 void DeleteThreadFcLocked(void* v) { delete static_cast<bool*>(v); }
70 # define THREAD_FC_LOCKED \ 70 # define THREAD_FC_LOCKED \
71 static_cast<bool*>(SkTLS::Get(CreateThreadFcLocked, DeleteThreadFcLocked )) 71 static_cast<bool*>(SkTLS::Get(CreateThreadFcLocked, DeleteThreadFcLocked ))
72 #endif 72 #endif
73 73
74 struct FCLocker { 74 struct FCLocker {
75 // Assume FcGetVersion() has always been thread safe. 75 // Assume FcGetVersion() has always been thread safe.
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
933 return typeface.release(); 933 return typeface.release();
934 } 934 }
935 935
936 return this->matchFamilyStyle(nullptr, style); 936 return this->matchFamilyStyle(nullptr, style);
937 } 937 }
938 }; 938 };
939 939
940 SK_API SkFontMgr* SkFontMgr_New_FontConfig(FcConfig* fc) { 940 SK_API SkFontMgr* SkFontMgr_New_FontConfig(FcConfig* fc) {
941 return new SkFontMgr_fontconfig(fc); 941 return new SkFontMgr_fontconfig(fc);
942 } 942 }
OLDNEW
« no previous file with comments | « src/ports/SkFontHost_mac.cpp ('k') | src/ports/SkTLS_win.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698