diff --git a/src/ports/SkFontHost_FreeType.cpp b/src/ports/SkFontHost_FreeType.cpp index 536201bdd1..bdf970480f 100644 --- a/src/ports/SkFontHost_FreeType.cpp +++ b/src/ports/SkFontHost_FreeType.cpp @@ -67,6 +67,21 @@ # include #endif +#ifdef TT_SUPPORT_COLRV1 +// FT_ClipBox and FT_Get_Color_Glyph_ClipBox introduced VER-2-11-0-18-g47cf8ebf4 +// FT_COLR_COMPOSITE_PLUS and renumbering introduced VER-2-11-0-21-ge40ae7569 +// FT_SIZEOF_LONG_LONG introduced VER-2-11-0-31-gffdac8d67 +// FT_PaintRadialGradient changed size and layout at VER-2-11-0-147-gd3d3ff76d +// FT_STATIC_CAST introduced VER-2-11-0-172-g9079c5d91 +// So undefine TT_SUPPORT_COLRV1 before 2.11.1 but not if FT_STATIC_CAST is defined. +#if (((FREETYPE_MAJOR) < 2) || \ + ((FREETYPE_MAJOR) == 2 && (FREETYPE_MINOR) < 11) || \ + ((FREETYPE_MAJOR) == 2 && (FREETYPE_MINOR) == 11 && (FREETYPE_PATCH) < 1)) && \ + !defined(FT_STATIC_CAST) +# undef TT_SUPPORT_COLRV1 +#endif +#endif + //#define ENABLE_GLYPH_SPEW // for tracing calls //#define DUMP_STRIKE_CREATION //#define SK_FONTHOST_FREETYPE_RUNTIME_VERSION diff --git a/src/ports/SkFontHost_FreeType_common.cpp b/src/ports/SkFontHost_FreeType_common.cpp index 6cb03d9406..33d31cf20a 100644 --- a/src/ports/SkFontHost_FreeType_common.cpp +++ b/src/ports/SkFontHost_FreeType_common.cpp @@ -31,7 +31,20 @@ #include #ifdef TT_SUPPORT_COLRV1 -#include "src/core/SkScopeExit.h" +// FT_ClipBox and FT_Get_Color_Glyph_ClipBox introduced VER-2-11-0-18-g47cf8ebf4 +// FT_COLR_COMPOSITE_PLUS and renumbering introduced VER-2-11-0-21-ge40ae7569 +// FT_SIZEOF_LONG_LONG introduced VER-2-11-0-31-gffdac8d67 +// FT_PaintRadialGradient changed size and layout at VER-2-11-0-147-gd3d3ff76d +// FT_STATIC_CAST introduced VER-2-11-0-172-g9079c5d91 +// So undefine TT_SUPPORT_COLRV1 before 2.11.1 but not if FT_STATIC_CAST is defined. +#if (((FREETYPE_MAJOR) < 2) || \ + ((FREETYPE_MAJOR) == 2 && (FREETYPE_MINOR) < 11) || \ + ((FREETYPE_MAJOR) == 2 && (FREETYPE_MINOR) == 11 && (FREETYPE_PATCH) < 1)) && \ + !defined(FT_STATIC_CAST) +# undef TT_SUPPORT_COLRV1 +#else +# include "src/core/SkScopeExit.h" +#endif #endif // FT_LOAD_COLOR and the corresponding FT_Pixel_Mode::FT_PIXEL_MODE_BGRA