From 09fbc475274e1d49a56f4dfb2e51e7b2d4edce3d Mon Sep 17 00:00:00 2001 From: Jason Simmons Date: Wed, 10 Jul 2019 15:39:16 -0700 Subject: [PATCH] Include SkParagraph headers only when the enable-skshaper flag is on These headers are currently causing errors in MSVC-based Windows builds. --- third_party/txt/src/txt/font_collection.h | 5 ++++- third_party/txt/src/txt/paragraph_builder.cc | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/third_party/txt/src/txt/font_collection.h b/third_party/txt/src/txt/font_collection.h index d7d294c4f3eaa..8c122790a3868 100644 --- a/third_party/txt/src/txt/font_collection.h +++ b/third_party/txt/src/txt/font_collection.h @@ -27,10 +27,13 @@ #include "third_party/googletest/googletest/include/gtest/gtest_prod.h" // nogncheck #include "third_party/skia/include/core/SkFontMgr.h" #include "third_party/skia/include/core/SkRefCnt.h" -#include "third_party/skia/modules/skparagraph/include/FontCollection.h" #include "txt/asset_font_manager.h" #include "txt/text_style.h" +#if FLUTTER_ENABLE_SKSHAPER +#include "third_party/skia/modules/skparagraph/include/FontCollection.h" +#endif + namespace txt { class FontCollection : public std::enable_shared_from_this { diff --git a/third_party/txt/src/txt/paragraph_builder.cc b/third_party/txt/src/txt/paragraph_builder.cc index a5a5b0a3f4322..6aaa7ba727dd7 100644 --- a/third_party/txt/src/txt/paragraph_builder.cc +++ b/third_party/txt/src/txt/paragraph_builder.cc @@ -15,11 +15,14 @@ */ #include "paragraph_builder.h" -#include "flutter/third_party/txt/src/skia/paragraph_builder_skia.h" #include "paragraph_builder_txt.h" #include "paragraph_style.h" #include "third_party/icu/source/common/unicode/unistr.h" +#if FLUTTER_ENABLE_SKSHAPER +#include "flutter/third_party/txt/src/skia/paragraph_builder_skia.h" +#endif + namespace txt { std::unique_ptr ParagraphBuilder::CreateTxtBuilder(