| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2009-2015 Google Inc. | 2 * Copyright 2009-2015 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 /* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */ | 8 /* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */ |
| 9 | 9 |
| 10 #include "SkFontConfigInterface.h" | 10 #include "SkFontConfigInterface.h" |
| 11 #include "SkMutex.h" | |
| 12 | 11 |
| 13 #include <fontconfig/fontconfig.h> | 12 #include <fontconfig/fontconfig.h> |
| 14 | 13 |
| 15 class SkFontConfigInterfaceDirect : public SkFontConfigInterface { | 14 class SkFontConfigInterfaceDirect : public SkFontConfigInterface { |
| 16 public: | 15 public: |
| 17 SkFontConfigInterfaceDirect(); | 16 SkFontConfigInterfaceDirect(); |
| 18 ~SkFontConfigInterfaceDirect() override; | 17 ~SkFontConfigInterfaceDirect() override; |
| 19 | 18 |
| 20 bool matchFamilyName(const char familyName[], | 19 bool matchFamilyName(const char familyName[], |
| 21 SkFontStyle requested, | 20 SkFontStyle requested, |
| 22 FontIdentity* outFontIdentifier, | 21 FontIdentity* outFontIdentifier, |
| 23 SkString* outFamilyName, | 22 SkString* outFamilyName, |
| 24 SkFontStyle* outStyle) override; | 23 SkFontStyle* outStyle) override; |
| 25 | 24 |
| 26 SkStreamAsset* openStream(const FontIdentity&) override; | 25 SkStreamAsset* openStream(const FontIdentity&) override; |
| 27 | 26 |
| 28 // new APIs | 27 // new APIs |
| 29 SkDataTable* getFamilyNames() override; | 28 SkDataTable* getFamilyNames() override; |
| 30 | 29 |
| 31 protected: | 30 protected: |
| 32 virtual bool isAccessible(const char* filename); | 31 virtual bool isAccessible(const char* filename); |
| 33 | 32 |
| 34 private: | 33 private: |
| 35 SkMutex mutex_; | |
| 36 | |
| 37 bool isValidPattern(FcPattern* pattern); | 34 bool isValidPattern(FcPattern* pattern); |
| 38 FcPattern* MatchFont(FcFontSet* font_set, const char* post_config_family, | 35 FcPattern* MatchFont(FcFontSet* font_set, const char* post_config_family, |
| 39 const SkString& family); | 36 const SkString& family); |
| 40 typedef SkFontConfigInterface INHERITED; | 37 typedef SkFontConfigInterface INHERITED; |
| 41 }; | 38 }; |
| OLD | NEW |