Chromium Code Reviews| Index: src/ports/SkFontConfigInterfaceDirect.h |
| diff --git a/src/ports/SkFontConfigInterfaceDirect.h b/src/ports/SkFontConfigInterfaceDirect.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a484eae814af9721e3f4e530f93834ac6d8bd37a |
| --- /dev/null |
| +++ b/src/ports/SkFontConfigInterfaceDirect.h |
| @@ -0,0 +1,44 @@ |
| +/* |
| + * Copyright 2009-2015 Google Inc. |
| + * |
| + * Use of this source code is governed by a BSD-style license that can be |
| + * found in the LICENSE file. |
| + */ |
| + |
| +/* migrated from chrome/src/skia/ext/SkFontHost_fontconfig_direct.cpp */ |
| + |
| +#include "SkFontConfigInterface.h" |
| +#include "SkMutex.h" |
| + |
| +#include <fontconfig/fontconfig.h> |
| + |
| +class SkFontConfigInterfaceDirect : public SkFontConfigInterface { |
| +public: |
| + SkFontConfigInterfaceDirect(); |
| + ~SkFontConfigInterfaceDirect() override; |
| + |
| + bool matchFamilyName(const char familyName[], |
| + SkTypeface::Style requested, |
| + FontIdentity* outFontIdentifier, |
| + SkString* outFamilyName, |
| + SkTypeface::Style* outStyle) override; |
| + SkStreamAsset* openStream(const FontIdentity&) override; |
| + |
| + // new APIs |
| + SkDataTable* getFamilyNames() override; |
| + bool matchFamilySet(const char inFamilyName[], |
| + SkString* outFamilyName, |
| + SkTArray<FontIdentity>*) override; |
| + |
| +protected: |
| + // Returns the string from the pattern, or nullptr |
| + static const char* GetName(FcPattern* pattern, const char field[], int index = 0); |
| + virtual bool isValidPattern(FcPattern* pattern); |
|
bungeman-skia
2015/11/24 21:56:36
can this just be
virtual bool isAccessible(const
dogben
2015/11/30 17:15:31
Done.
|
| + |
| +private: |
| + SkMutex mutex_; |
| + |
| + FcPattern* MatchFont(FcFontSet* font_set, const char* post_config_family, |
| + const SkString& family); |
| + typedef SkFontConfigInterface INHERITED; |
| +}; |