diff --git a/build/BUILD.gn b/build/BUILD.gn index c0665468707dd0d1f59954122d339b0811ea8cc8..9c2e7b82a50586d2bb71daf5e9d8784f21c2ec1f 100644 --- a/build/BUILD.gn +++ b/build/BUILD.gn @@ -28,8 +28,13 @@ config("flutter_config") { "$flutter_root", "$flutter_root/engine", "$flutter_root/engine/flutter", - "$flutter_root/engine/flutter/third_party/txt/src", ] + + if (use_new_skia) { + include_dirs += [ "$flutter_root/txt/src" ] + } else { + include_dirs += [ "$flutter_root/engine/flutter/third_party/txt/src" ] + } cflags = [ "-fvisibility=hidden", diff --git a/build/harfbuzz/BUILD.gn b/build/harfbuzz/BUILD.gn index dd30b3d986cb8216f25dd77329df82a28a06f576..3686bb28bed2db04fb68a9082b013bd48a3a909f 100644 --- a/build/harfbuzz/BUILD.gn +++ b/build/harfbuzz/BUILD.gn @@ -15,6 +15,12 @@ import("//build/ohos.gni") import("//foundation/arkui/ace_engine/ace_config.gni") import("//third_party/flutter/flutter_config.gni") +if (use_new_skia) { + skia_root = "//third_party/skia" +} else { + skia_root = "$flutter_root/skia" +} + config("libharfbuzz_compile_flags") { cflags_cc = [ "-std=c++14", @@ -35,8 +41,8 @@ config("libharfbuzz_compile_flags") { ] include_dirs = [ - "$flutter_root/skia/third_party/harfbuzz", - "$flutter_root/skia/third_party/externals/harfbuzz/src", + "$skia_root/third_party/harfbuzz", + "$skia_root/third_party/externals/harfbuzz/src", ] } @@ -46,7 +52,7 @@ template("ace_libharfbuzz") { ohos_source_set(target_name) { part_name = flutter_part subsystem_name = flutter_subsystem - license_file = "$flutter_root/skia/third_party/externals/harfbuzz/COPYING" + license_file = "$skia_root/third_party/externals/harfbuzz/COPYING" defines += invoker.defines defines += [ "HAVE_ICU", @@ -66,58 +72,71 @@ template("ace_libharfbuzz") { } sources = [ - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-aat-layout.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-aat-map.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-blob.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-buffer-serialize.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-buffer.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-common.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-face.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-font.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-icu.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-map.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-cff1-table.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-cff2-table.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-color.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-face.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-font.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-layout.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-map.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-math.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-name.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-arabic.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-default.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-hangul.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-hebrew.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-indic-table.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-indic.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-khmer.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-myanmar.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-thai.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-use-table.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-use.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-complex-vowel-constraints.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-fallback.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape-normalize.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-shape.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-tag.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ot-var.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-set.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-shape-plan.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-shape.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-shaper.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-static.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-subset-cff-common.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-subset-cff1.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-subset-cff2.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-subset-input.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-subset-plan.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-subset.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-ucd.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-unicode.cc", - "$flutter_root/skia/third_party/externals/harfbuzz/src/hb-warning.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-aat-layout.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-aat-map.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-blob.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-buffer-serialize.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-buffer.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-common.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-face.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-font.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-icu.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-map.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-cff1-table.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-cff2-table.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-color.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-face.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-font.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-layout.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-map.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-math.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-name.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-shape-complex-arabic.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-shape-complex-default.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-shape-complex-hangul.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-shape-complex-hebrew.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-shape-complex-indic-table.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-shape-complex-indic.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-shape-complex-khmer.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-shape-complex-myanmar.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-shape-complex-thai.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-shape-complex-use-table.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-shape-complex-use.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-shape-complex-vowel-constraints.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-shape-fallback.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-shape-normalize.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-shape.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-tag.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-var.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-set.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-shape-plan.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-shape.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-shaper.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-static.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-subset-cff-common.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-subset-cff1.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-subset-cff2.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-subset-input.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-subset-plan.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-subset.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ucd.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-unicode.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-warning.cc", ] - + + if (use_new_skia) { + sources -= [ + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-shape-complex-use-table.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-warning.cc" + ] + sources += [ + "$skia_root/third_party/externals/harfbuzz/src/hb-number.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-metrics.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-fallback-shape.cc", + "$skia_root/third_party/externals/harfbuzz/src/hb-ot-shape-complex-syllabic.cc", + ] + } + deps = [ "$ace_flutter_engine_root/icu:ace_libicu_$platform" ] } } diff --git a/build/libtxt/BUILD.gn b/build/libtxt/BUILD.gn index 46d70e46dc7a1dd7a29820bacabdc8fc24e0dd89..485723cb10fc5b396fe4fd4bc0b4f770943253b2 100644 --- a/build/libtxt/BUILD.gn +++ b/build/libtxt/BUILD.gn @@ -23,6 +23,12 @@ config("thirdparty_lib_txt_config") { ] } +if (use_new_skia) { + txt_root = "$flutter_root/txt" +} else { + txt_root = "$flutter_root/engine/flutter/third_party/txt" +} + template("thirdparty_lib_txt") { forward_variables_from(invoker, "*") @@ -42,67 +48,81 @@ template("thirdparty_lib_txt") { } sources = [ - "$flutter_root/engine/flutter/third_party/txt/src/log/log.cc", - "$flutter_root/engine/flutter/third_party/txt/src/minikin/CmapCoverage.cpp", - "$flutter_root/engine/flutter/third_party/txt/src/minikin/Emoji.cpp", - "$flutter_root/engine/flutter/third_party/txt/src/minikin/FontCollection.cpp", - "$flutter_root/engine/flutter/third_party/txt/src/minikin/FontFamily.cpp", - "$flutter_root/engine/flutter/third_party/txt/src/minikin/FontLanguage.cpp", - "$flutter_root/engine/flutter/third_party/txt/src/minikin/FontLanguageListCache.cpp", - "$flutter_root/engine/flutter/third_party/txt/src/minikin/FontUtils.cpp", - "$flutter_root/engine/flutter/third_party/txt/src/minikin/GraphemeBreak.cpp", - "$flutter_root/engine/flutter/third_party/txt/src/minikin/HbFontCache.cpp", - "$flutter_root/engine/flutter/third_party/txt/src/minikin/Hyphenator.cpp", - "$flutter_root/engine/flutter/third_party/txt/src/minikin/Layout.cpp", - "$flutter_root/engine/flutter/third_party/txt/src/minikin/LayoutUtils.cpp", - "$flutter_root/engine/flutter/third_party/txt/src/minikin/LineBreaker.cpp", - "$flutter_root/engine/flutter/third_party/txt/src/minikin/Measurement.cpp", - "$flutter_root/engine/flutter/third_party/txt/src/minikin/MinikinFont.cpp", - "$flutter_root/engine/flutter/third_party/txt/src/minikin/MinikinInternal.cpp", - "$flutter_root/engine/flutter/third_party/txt/src/minikin/SparseBitSet.cpp", - "$flutter_root/engine/flutter/third_party/txt/src/minikin/WordBreaker.cpp", - "$flutter_root/engine/flutter/third_party/txt/src/txt/asset_font_manager.cc", - "$flutter_root/engine/flutter/third_party/txt/src/txt/font_asset_provider.cc", - "$flutter_root/engine/flutter/third_party/txt/src/txt/font_collection.cc", - "$flutter_root/engine/flutter/third_party/txt/src/txt/font_features.cc", - "$flutter_root/engine/flutter/third_party/txt/src/txt/font_skia.cc", - "$flutter_root/engine/flutter/third_party/txt/src/txt/paint_record.cc", - "$flutter_root/engine/flutter/third_party/txt/src/txt/paragraph_builder.cc", - "$flutter_root/engine/flutter/third_party/txt/src/txt/paragraph_builder_txt.cc", - "$flutter_root/engine/flutter/third_party/txt/src/txt/paragraph_style.cc", - "$flutter_root/engine/flutter/third_party/txt/src/txt/paragraph_txt.cc", - "$flutter_root/engine/flutter/third_party/txt/src/txt/placeholder_run.cc", - "$flutter_root/engine/flutter/third_party/txt/src/txt/styled_runs.cc", - "$flutter_root/engine/flutter/third_party/txt/src/txt/test_font_manager.cc", - "$flutter_root/engine/flutter/third_party/txt/src/txt/text_decoration.cc", - "$flutter_root/engine/flutter/third_party/txt/src/txt/text_shadow.cc", - "$flutter_root/engine/flutter/third_party/txt/src/txt/text_style.cc", - "$flutter_root/engine/flutter/third_party/txt/src/txt/typeface_font_asset_provider.cc", - "$flutter_root/engine/flutter/third_party/txt/src/utils/JenkinsHash.cpp", + "$txt_root/src/log/log.cc", + "$txt_root/src/minikin/CmapCoverage.cpp", + "$txt_root/src/minikin/Emoji.cpp", + "$txt_root/src/minikin/FontCollection.cpp", + "$txt_root/src/minikin/FontFamily.cpp", + "$txt_root/src/minikin/FontLanguage.cpp", + "$txt_root/src/minikin/FontLanguageListCache.cpp", + "$txt_root/src/minikin/FontUtils.cpp", + "$txt_root/src/minikin/GraphemeBreak.cpp", + "$txt_root/src/minikin/HbFontCache.cpp", + "$txt_root/src/minikin/Hyphenator.cpp", + "$txt_root/src/minikin/Layout.cpp", + "$txt_root/src/minikin/LayoutUtils.cpp", + "$txt_root/src/minikin/LineBreaker.cpp", + "$txt_root/src/minikin/Measurement.cpp", + "$txt_root/src/minikin/MinikinFont.cpp", + "$txt_root/src/minikin/MinikinInternal.cpp", + "$txt_root/src/minikin/SparseBitSet.cpp", + "$txt_root/src/minikin/WordBreaker.cpp", + "$txt_root/src/txt/asset_font_manager.cc", + "$txt_root/src/txt/font_asset_provider.cc", + "$txt_root/src/txt/font_collection.cc", + "$txt_root/src/txt/font_features.cc", + "$txt_root/src/txt/font_skia.cc", + "$txt_root/src/txt/paint_record.cc", + "$txt_root/src/txt/paragraph_builder.cc", + "$txt_root/src/txt/paragraph_builder_txt.cc", + "$txt_root/src/txt/paragraph_style.cc", + "$txt_root/src/txt/paragraph_txt.cc", + "$txt_root/src/txt/placeholder_run.cc", + "$txt_root/src/txt/styled_runs.cc", + "$txt_root/src/txt/test_font_manager.cc", + "$txt_root/src/txt/text_decoration.cc", + "$txt_root/src/txt/text_shadow.cc", + "$txt_root/src/txt/text_style.cc", + "$txt_root/src/txt/typeface_font_asset_provider.cc", + "$txt_root/src/utils/JenkinsHash.cpp", ] - deps = [ - "$ace_flutter_engine_root:flutter_engine_fml_$platform", - "$ace_flutter_engine_root/icu:ace_libicu_$platform", - "$ace_flutter_engine_root/skia:ace_skia_$platform", - ] + if (use_new_skia) { + deps = [ + "$ace_flutter_engine_root:flutter_engine_fml_$platform", + "$ace_flutter_engine_root/icu:ace_libicu_$platform", + "//third_party/skia:skia", + "$ace_flutter_engine_root/harfbuzz:ace_libharfbuzz_$platform", + ] + include_dirs = [ + "$flutter_root/txt/src", + "//third_party/skia/third_party/externals/harfbuzz/src", + "//", + ] + } else { + deps = [ + "$ace_flutter_engine_root:flutter_engine_fml_$platform", + "$ace_flutter_engine_root/icu:ace_libicu_$platform", + "$ace_flutter_engine_root/skia:ace_skia_$platform", + ] + } if (platform == "ohos") { if (defined(oem_commercial_build) && oem_commercial_build) { - sources += [ "$flutter_root/engine/flutter/third_party/txt/src/txt/platform_android.cc" ] + sources += [ "$txt_root/src/txt/platform_android.cc" ] } else { - sources += [ "$flutter_root/engine/flutter/third_party/txt/src/txt/platform_ohos.cc" ] + sources += [ "$txt_root/src/txt/platform_android.cc" ] # todo modify } } else if (platform == "windows") { sources += - [ "$flutter_root/engine/flutter/third_party/txt/src/txt/platform.cc" ] + [ "$txt_root/src/txt/platform.cc" ] if (use_mingw_win) { defines += [ "SK_BUILD_FONT_MGR_FOR_PREVIEW_WIN" ] } } else if (platform == "mac" || platform == "ios") { cflags = [ "-DNS_FORMAT_ARGUMENT(A)=" ] sources += [ - "$flutter_root/engine/flutter/third_party/txt/src/txt/platform_mac.mm", + "$txt_root/src/txt/platform_mac.mm", ] if (use_mac) { defines += [ "SK_BUILD_FONT_MGR_FOR_PREVIEW_MAC" ] @@ -123,9 +143,9 @@ template("thirdparty_lib_txt") { } } } else if (platform == "android") { - sources += [ "$flutter_root/engine/flutter/third_party/txt/src/txt/platform_android.cc" ] + sources += [ "$txt_root/src/txt/platform_android.cc" ] } else if (platform == "linux") { - sources += [ "$flutter_root/engine/flutter/third_party/txt/src/txt/platform_linux.cc" ] + sources += [ "$txt_root/src/txt/platform_linux.cc" ] if (use_linux) { defines += [ "SK_BUILD_FONT_MGR_FOR_PREVIEW_LINUX" ] }