| Index: src/ports/SkFontHost_FreeType_common.h
|
| diff --git a/src/ports/SkFontHost_FreeType_common.h b/src/ports/SkFontHost_FreeType_common.h
|
| index 79e6d651631103642729c4788fc55f8b3bf2ec5b..226f55d45741bdd92663d2a7833c1a6e1ddba2c2 100644
|
| --- a/src/ports/SkFontHost_FreeType_common.h
|
| +++ b/src/ports/SkFontHost_FreeType_common.h
|
| @@ -12,6 +12,7 @@
|
| #include "SkGlyph.h"
|
| #include "SkScalerContext.h"
|
| #include "SkTypeface.h"
|
| +#include "SkTypes.h"
|
|
|
| #include <ft2build.h>
|
| #include FT_FREETYPE_H
|
| @@ -48,8 +49,18 @@ public:
|
| /** For SkFontMgrs to make use of our ability to extract
|
| * name and style from a stream, using FreeType's API.
|
| */
|
| - static bool ScanFont(SkStream* stream, int ttcIndex,
|
| - SkString* name, SkFontStyle* style, bool* isFixedPitch);
|
| + class Scanner : ::SkNoncopyable {
|
| + public:
|
| + Scanner();
|
| + ~Scanner();
|
| + bool recognizedFont(SkStream* stream, int* numFonts) const;
|
| + bool scanFont(SkStream* stream, int ttcIndex,
|
| + SkString* name, SkFontStyle* style, bool* isFixedPitch) const;
|
| + private:
|
| + FT_Face openFace(SkStream* stream, int ttcIndex, FT_Stream ftStream) const;
|
| + FT_Library fLibrary;
|
| + mutable SkMutex fLibraryMutex;
|
| + };
|
|
|
| protected:
|
| SkTypeface_FreeType(const SkFontStyle& style, SkFontID uniqueID, bool isFixedPitch)
|
|
|