diff --git a/m133/include/core/SkFontMgr.h b/m133/include/core/SkFontMgr.h index d247c9f72375815b9f5671936c983a822bc2fbee..c3dec6def643213d003d0a17570ab4ef14aa4f0d 100644 --- a/m133/include/core/SkFontMgr.h +++ b/m133/include/core/SkFontMgr.h @@ -149,10 +149,10 @@ public: } std::vector> getSystemFonts(); +#endif /** Return the default fontmgr. */ static sk_sp RefDefault(); -#endif /* Returns an empty font manager without any typeface dependencies */ static sk_sp RefEmpty(); diff --git a/m133/modules/svg/BUILD.gn b/m133/modules/svg/BUILD.gn index 004f7406df48b95c3cd8b9b2fa0b269ba7d315f3..ea1a3065462f0cc711aa3db98166e3acf5a6b785 100644 --- a/m133/modules/svg/BUILD.gn +++ b/m133/modules/svg/BUILD.gn @@ -18,6 +18,25 @@ if (skia_enable_svg && skia_use_expat) { ] } + config("svg_private_config") { + defines = [] + if (skia_use_harfbuzz) { + defines += [ "SK_SHAPER_HARFBUZZ_AVAILABLE" ] + } + if (skia_enable_skunicode) { + defines += [ "SK_SHAPER_UNICODE_AVAILABLE" ] + } + if (skia_use_libgrapheme) { + defines += [ "SK_UNICODE_LIBGRAPHEME_IMPLEMENTATION" ] + } + if (skia_use_icu4x) { + defines += [ "SK_UNICODE_ICU4X_IMPLEMENTATION" ] + } + if (skia_use_icu) { + defines += [ "SK_UNICODE_ICU_IMPLEMENTATION" ] + } + } + ohos_source_set("svg") { check_includes = false import("svg.gni") @@ -27,6 +46,7 @@ if (skia_enable_svg && skia_use_expat) { configs = [ "../../:skia_private" ] if (use_oh_skia) { configs += [ "../../:skia_wno" ] + configs += [ ":svg_private_config" ] } } diff --git a/m133/modules/svg/include/SkSVGRenderContext.h b/m133/modules/svg/include/SkSVGRenderContext.h index b6bc5d5facfced023155edddb847737cd34ddb38..ddc23acfe786a889f308637a5bf70f7096163903 100644 --- a/m133/modules/svg/include/SkSVGRenderContext.h +++ b/m133/modules/svg/include/SkSVGRenderContext.h @@ -163,7 +163,7 @@ public: // It is probably an oversight to try to render without having set the SkFontMgr. // We will assert this in debug mode, but fallback to an empty fontmgr in release builds. SkASSERT(fFontMgr); - return fFontMgr ? fFontMgr : SkFontMgr::RefEmpty(); + return fFontMgr ? fFontMgr : SkFontMgr::RefDefault(); } // Returns the translate/scale transformation required to map into the current OBB scope, diff --git a/m133/modules/svg/src/SkSVGDOM.cpp b/m133/modules/svg/src/SkSVGDOM.cpp index 8c66f7e4e82a6aa32b716893d415a1a5a84fc366..465bcab899abbf7feb153b94d65e415932432630 100644 --- a/m133/modules/svg/src/SkSVGDOM.cpp +++ b/m133/modules/svg/src/SkSVGDOM.cpp @@ -13,6 +13,7 @@ #include "include/private/base/SkAssert.h" #include "include/private/base/SkTo.h" #include "modules/skshaper/include/SkShaper_factory.h" +#include "modules/skshaper/utils/FactoryHelpers.h" #include "modules/svg/include/SkSVGAttribute.h" #include "modules/svg/include/SkSVGAttributeParser.h" #include "modules/svg/include/SkSVGCircle.h" @@ -442,7 +443,7 @@ sk_sp SkSVGDOM::Builder::make(SkStream& str) const { auto resource_provider = fResourceProvider ? fResourceProvider : sk_make_sp(); - auto factory = fTextShapingFactory ? fTextShapingFactory : SkShapers::Primitive::Factory(); + auto factory = fTextShapingFactory ? fTextShapingFactory : SkShapers::BestAvailable(); return sk_sp(new SkSVGDOM(sk_sp(static_cast(root.release())), std::move(fFontMgr), diff --git a/m133/src/core/SkFontMgr.cpp b/m133/src/core/SkFontMgr.cpp index 8b49a44f8453576bd0f92ec1e3343982511916de..20b9f722a2eab0f8988f4d4f3bfe5395cc4a9c4f 100644 --- a/m133/src/core/SkFontMgr.cpp +++ b/m133/src/core/SkFontMgr.cpp @@ -170,7 +170,6 @@ sk_sp SkFontMgr::RefEmpty() { return singleton; } -#ifdef ENABLE_TEXT_ENHANCE // A global function pointer that's not declared, but can be overriden at startup by test tools. sk_sp (*gSkFontMgr_DefaultFactory)() = nullptr; @@ -185,7 +184,6 @@ sk_sp SkFontMgr::RefDefault() { }); return singleton; } -#endif /** * Width has the greatest priority.