diff options
author | 2015-12-01 11:12:05 -0800 | |
---|---|---|
committer | 2015-12-01 11:12:05 -0800 | |
commit | 2211a7bdd1680003a4decbebef76f153cd0a28fa (patch) | |
tree | de998b224538b319b8e5c1c522d3cd82bb5247e4 /src/ports/SkFontConfigInterface_direct_google3.h | |
parent | 001e74426672e00f3f2783ccf728031662d4a358 (diff) |
Fix Google3 fonts. Use fontconfig rather than custom_directory_factory. Add Google3 font caching.
Some future dependents require these changes.
Depends on internal cl/108287941.
Review URL: https://codereview.chromium.org/1471033002
Diffstat (limited to 'src/ports/SkFontConfigInterface_direct_google3.h')
-rw-r--r-- | src/ports/SkFontConfigInterface_direct_google3.h | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/ports/SkFontConfigInterface_direct_google3.h b/src/ports/SkFontConfigInterface_direct_google3.h new file mode 100644 index 0000000000..fd5c5e2fed --- /dev/null +++ b/src/ports/SkFontConfigInterface_direct_google3.h @@ -0,0 +1,26 @@ +/* + * 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_direct.h" +#include "SkStream.h" +#include "SkTypes.h" + +// Loads fonts using GoogleFt2ReadFontFromMemory. +class SkFontConfigInterfaceDirectGoogle3 : public SkFontConfigInterfaceDirect { +public: + SkFontConfigInterfaceDirectGoogle3() {} + ~SkFontConfigInterfaceDirectGoogle3() override {} + + SkStreamAsset* openStream(const FontIdentity&) override; +protected: + // Override isAccessible to return true if the font is in the cache. + bool isAccessible(const char* filename) override; +private: + typedef SkFontConfigInterfaceDirect INHERITED; +}; |