| OLD | NEW |
| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 54 * assumed to be heterogeneous by the code, but the code need not do anything p
articularly | 54 * assumed to be heterogeneous by the code, but the code need not do anything p
articularly |
| 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 http://skbug.com/1497 for background. | 64 // See https://bug.skia.org/1497 for background. |
| 65 SK_DECLARE_STATIC_MUTEX(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 { |
| (...skipping 798 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 873 return typeface.detach(); | 873 return typeface.detach(); |
| 874 } | 874 } |
| 875 | 875 |
| 876 return this->matchFamilyStyle(nullptr, style); | 876 return this->matchFamilyStyle(nullptr, style); |
| 877 } | 877 } |
| 878 }; | 878 }; |
| 879 | 879 |
| 880 SK_API SkFontMgr* SkFontMgr_New_FontConfig(FcConfig* fc) { | 880 SK_API SkFontMgr* SkFontMgr_New_FontConfig(FcConfig* fc) { |
| 881 return new SkFontMgr_fontconfig(fc); | 881 return new SkFontMgr_fontconfig(fc); |
| 882 } | 882 } |
| OLD | NEW |