| OLD | NEW |
| 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" |
| 9 #include "SkFontStyle.h" |
| 8 #include "SkFontConfigInterface.h" | 10 #include "SkFontConfigInterface.h" |
| 9 #include "SkFontConfigTypeface.h" | 11 #include "SkFontConfigTypeface.h" |
| 10 #include "SkFontMgr.h" | |
| 11 #include "SkFontStyle.h" | |
| 12 #include "SkMath.h" | 12 #include "SkMath.h" |
| 13 #include "SkMutex.h" | |
| 14 #include "SkString.h" | 13 #include "SkString.h" |
| 15 #include "SkTDArray.h" | 14 #include "SkTDArray.h" |
| 15 #include "SkThread.h" |
| 16 | 16 |
| 17 // for now we pull these in directly. eventually we will solely rely on the | 17 // for now we pull these in directly. eventually we will solely rely on the |
| 18 // SkFontConfigInterface instance. | 18 // SkFontConfigInterface instance. |
| 19 #include <fontconfig/fontconfig.h> | 19 #include <fontconfig/fontconfig.h> |
| 20 #include <unistd.h> | 20 #include <unistd.h> |
| 21 | 21 |
| 22 namespace { | 22 namespace { |
| 23 | 23 |
| 24 // Fontconfig is not threadsafe before 2.10.91. Before that, we lock with a glo
bal mutex. | 24 // Fontconfig is not threadsafe before 2.10.91. Before that, we lock with a glo
bal mutex. |
| 25 // See skia:1497 for background. | 25 // See skia:1497 for background. |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 325 unsigned styleBits) const override { | 325 unsigned styleBits) const override { |
| 326 FCLocker lock; | 326 FCLocker lock; |
| 327 return FontConfigTypeface::LegacyCreateTypeface(familyName, (SkTypeface:
:Style)styleBits); | 327 return FontConfigTypeface::LegacyCreateTypeface(familyName, (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 } |
| OLD | NEW |