Update skia/BUILD.gn to use gni filegroups for font port files
The explicit lists of port files declared here could become out of sync
with the files declared in the Skia repo. This can be more easily
maintained by using the gni port variables declared by Skia. This
ensures that any new or dropped files are automatically reflected here
in PDFium. Switching to these already corrects some discrepencies, such
as the removal of SkFontMgr_android_factory.cpp and the addition of
several other header files.
Change-Id: Ic6ae03a58b8a458e68c54b9260be6316b06b112d
Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/128830
Reviewed-by: Lei Zhang <thestig@chromium.org>
Commit-Queue: Alan Screen <awscreen@chromium.org>
diff --git a/skia/BUILD.gn b/skia/BUILD.gn
index d77eb7f..3c4de68 100644
--- a/skia/BUILD.gn
+++ b/skia/BUILD.gn
@@ -262,10 +262,7 @@
# FreeType is needed everywhere (except on iOS), on Linux and Android as main
# font backend, on Windows and Mac as fallback backend for Variations.
if (!is_ios) {
- sources += [
- "//third_party/skia/src/ports/SkFontHost_FreeType.cpp",
- "//third_party/skia/src/ports/SkFontHost_FreeType_common.cpp",
- ]
+ sources += skia_ports_freetype_sources
}
if (is_win) {
@@ -279,14 +276,7 @@
frameworks = []
if (is_apple) {
# See SK_TYPEFACE_FACTORY_CORETEXT
- sources += [
- "//third_party/skia/include/ports/SkFontMgr_mac_ct.h",
- "//third_party/skia/src/ports/SkFontMgr_mac_ct.cpp",
- "//third_party/skia/src/ports/SkScalerContext_mac_ct.cpp",
- "//third_party/skia/src/ports/SkScalerContext_mac_ct.h",
- "//third_party/skia/src/ports/SkTypeface_mac_ct.cpp",
- "//third_party/skia/src/ports/SkTypeface_mac_ct.h",
- ]
+ sources += skia_ports_fontmgr_coretext_sources
frameworks += [
"CoreFoundation.framework",
"CoreGraphics.framework",
@@ -295,40 +285,26 @@
}
if (is_linux || is_chromeos) {
- sources += [
- "//third_party/skia/src/ports/SkFontConfigInterface.cpp",
- "//third_party/skia/src/ports/SkFontConfigInterface_direct.cpp",
- "//third_party/skia/src/ports/SkFontConfigInterface_direct_factory.cpp",
- "//third_party/skia/src/ports/SkFontMgr_FontConfigInterface.cpp",
- "//third_party/skia/src/ports/SkFontMgr_custom.cpp",
- "//third_party/skia/src/ports/SkFontMgr_custom_empty.cpp",
- ]
+ sources += skia_ports_fci_sources
+ sources += skia_ports_fontmgr_custom_sources
+ sources += skia_ports_fontmgr_empty_sources
}
if (is_android) {
- sources += [
- # Unlike Chromium, standalone PDFium on Linux and Chrome OS does not
- # require these files, since PDFium does not perform Android emulation.
- # Note that this requires expat.
- "//third_party/skia/src/ports/SkFontMgr_android.cpp",
- "//third_party/skia/src/ports/SkFontMgr_android_factory.cpp",
- "//third_party/skia/src/ports/SkFontMgr_android_parser.cpp",
- ]
+ # Unlike Chromium, standalone PDFium on Linux and Chrome OS does not
+ # require these files, since PDFium does not perform Android emulation.
+ # Note that this requires expat.
+ sources += skia_ports_fontmgr_android_sources
}
if (is_win || (is_apple && use_blink)) {
- sources += [
- # Add the FreeType custom font manager as a fallback backend for variable fonts.
- "//third_party/skia/src/ports/SkFontMgr_custom.cpp",
- "//third_party/skia/src/ports/SkFontMgr_custom_empty.cpp",
- ]
+ # Add the FreeType custom font manager as a fallback backend for variable fonts.
+ sources += skia_ports_fontmgr_custom_sources
+ sources += skia_ports_fontmgr_empty_sources
}
if (pdf_enable_fontations) {
- sources += [
- "//third_party/skia/src/ports/SkTypeface_fontations.cpp",
- "//third_party/skia/src/ports/SkTypeface_fontations_priv.h",
- ]
+ sources += skia_ports_typeface_fontations_sources
# Fontations Rust/C++ bridge interfaces.
deps += [