Alternate approach to turn on freetype in Fuchsia.
What do you think of this? It's basically what you wrote, factored differently.
Flipping on skia_use_freetype will enable the SkFontHost_Freetype*.cpp files
via the :typeface_freetype target.
Then we just pull out the SkFontMgr Fuchsia wants to use into its own little
:fontmgr_fuchsia target. No major difference here, except the availability
of freetype headers, etc, is a bit more tightly scoped to just those that
need them.
We (obviously?) don't have Fuchsia builders, so I've got to rely on you for sanity testing this.
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2333913002
Review-Url: https://codereview.chromium.org/2333913002
diff --git a/BUILD.gn b/BUILD.gn
index e770c5b..c6841bb 100644
--- a/BUILD.gn
+++ b/BUILD.gn
@@ -10,7 +10,7 @@
skia_use_expat = true
skia_use_fontconfig = is_linux
- skia_use_freetype = is_android || is_linux
+ skia_use_freetype = is_android || is_fuchsia || is_linux
skia_use_giflib = !is_fuchsia
skia_use_libjpeg_turbo = true
skia_use_libpng = true
@@ -258,6 +258,18 @@
]
}
+optional("fontmgr_fuchsia") {
+ enabled = is_fuchsia && skia_use_freetype
+
+ deps = [
+ "//third_party/freetype2",
+ ]
+ sources = [
+ "src/ports/SkFontMgr_custom.cpp",
+ "src/ports/SkFontMgr_custom_empty_factory.cpp",
+ ]
+}
+
optional("gif") {
enabled = skia_use_giflib
public_defines = [ "SK_HAS_GIF_LIBRARY" ]
@@ -367,6 +379,7 @@
":fontmgr_android",
":fontmgr_custom",
":fontmgr_fontconfig",
+ ":fontmgr_fuchsia",
":gif",
":jpeg",
":none",
@@ -498,11 +511,7 @@
}
if (is_fuchsia) {
- sources += [
- "src/gpu/gl/GrGLCreateNativeInterface_none.cpp",
- "src/ports/SkDebug_stdio.cpp",
- "src/ports/SkFontMgr_empty_factory.cpp",
- ]
+ sources += [ "src/gpu/gl/GrGLCreateNativeInterface_none.cpp" ]
}
}