Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 5be433c

Browse files
authored
[skia] Use more GNI file lists (#53685)
In http://review.skia.org/862177 (and to a lesser extent, http://review.skia.org/862416), Skia added more .gni file lists for code in src/ports. This updates Flutter to use those lists instead of hard-coding those file paths directly, making it easier for upstream changes in Skia (e.g. file renames or relocations) to be pulled into Flutter without a Flutter-side change. ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide] and the [C++, Objective-C, Java style guides]. - [ ] I listed at least one issue that this PR fixes in the description above. - [x] I added new tests to check the change I am making or feature I am adding, or the PR is [test-exempt]. See [testing the engine] for instructions on writing and running engine tests. - [ ] I updated/added relevant documentation (doc comments with `///`). - [x] I signed the [CLA]. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/wiki/Tree-hygiene#overview [Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene [test-exempt]: https://github.com/flutter/flutter/wiki/Tree-hygiene#tests [Flutter Style Guide]: https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style [testing the engine]: https://github.com/flutter/flutter/wiki/Testing-the-engine [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/wiki/Tree-hygiene#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/wiki/Chat
1 parent ad80c4e commit 5be433c

File tree

1 file changed

+24
-46
lines changed

1 file changed

+24
-46
lines changed

skia/BUILD.gn

Lines changed: 24 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -218,12 +218,8 @@ optional("fontmgr_android") {
218218
":typeface_freetype",
219219
"//flutter/third_party/expat",
220220
]
221-
public = [ "$_skia_root/include/ports/SkFontMgr_android.h" ]
222-
sources = [
223-
"$_skia_root/src/ports/SkFontMgr_android.cpp",
224-
"$_skia_root/src/ports/SkFontMgr_android_parser.cpp",
225-
"$_skia_root/src/ports/SkFontMgr_android_parser.h",
226-
]
221+
public = skia_ports_fontmgr_android_public
222+
sources = skia_ports_fontmgr_android_sources
227223
}
228224

229225
optional("fontmgr_custom") {
@@ -232,8 +228,7 @@ optional("fontmgr_custom") {
232228
skia_enable_fontmgr_custom_embedded || skia_enable_fontmgr_custom_empty
233229

234230
deps = [ ":typeface_freetype" ]
235-
public = [ "$_skia_root/src/ports/SkFontMgr_custom.h" ]
236-
sources = [ "$_skia_root/src/ports/SkFontMgr_custom.cpp" ]
231+
sources = skia_ports_fontmgr_custom_sources
237232
}
238233

239234
optional("fontmgr_custom_directory") {
@@ -243,8 +238,8 @@ optional("fontmgr_custom_directory") {
243238
":fontmgr_custom",
244239
":typeface_freetype",
245240
]
246-
public = [ "$_skia_root/include/ports/SkFontMgr_directory.h" ]
247-
sources = [ "$_skia_root/src/ports/SkFontMgr_custom_directory.cpp" ]
241+
public = skia_ports_fontmgr_directory_public
242+
sources = skia_ports_fontmgr_directory_sources
248243
}
249244

250245
optional("fontmgr_custom_embedded") {
@@ -255,7 +250,7 @@ optional("fontmgr_custom_embedded") {
255250
":fontmgr_custom",
256251
":typeface_freetype",
257252
]
258-
sources = [ "$_skia_root/src/ports/SkFontMgr_custom_embedded.cpp" ]
253+
sources = skia_ports_fontmgr_embedded_sources
259254
}
260255

261256
optional("fontmgr_custom_empty") {
@@ -266,8 +261,8 @@ optional("fontmgr_custom_empty") {
266261
":fontmgr_custom",
267262
":typeface_freetype",
268263
]
269-
public = [ "$_skia_root/include/ports/SkFontMgr_empty.h" ]
270-
sources = [ "$_skia_root/src/ports/SkFontMgr_custom_empty.cpp" ]
264+
public = skia_ports_fontmgr_empty_public
265+
sources = skia_ports_fontmgr_empty_sources
271266
}
272267

273268
optional("fontmgr_fontconfig") {
@@ -276,9 +271,9 @@ optional("fontmgr_fontconfig") {
276271

277272
# The public header includes fontconfig.h and uses FcConfig*
278273
public_deps = [ "//third_party:fontconfig" ]
279-
public = [ "$_skia_root/include/ports/SkFontMgr_fontconfig.h" ]
274+
public = skia_ports_fontmgr_fontconfig_public
280275
deps = [ ":typeface_freetype" ]
281-
sources = [ "$_skia_root/src/ports/SkFontMgr_fontconfig.cpp" ]
276+
sources = skia_ports_fontmgr_fontconfig_sources
282277
}
283278

284279
optional("fontmgr_fuchsia") {
@@ -292,8 +287,8 @@ optional("fontmgr_fuchsia") {
292287
} else {
293288
deps = [ "//sdk/fidl/fuchsia.fonts" ]
294289
}
295-
public = [ "$_skia_root/src/ports/SkFontMgr_fuchsia.h" ]
296-
sources = [ "$_skia_root/src/ports/SkFontMgr_fuchsia.cpp" ]
290+
public = skia_ports_fontmgr_fuchsia_public
291+
sources = skia_ports_fontmgr_fuchsia_sources
297292
}
298293

299294
optional("fontmgr_mac_ct") {
@@ -303,17 +298,8 @@ optional("fontmgr_mac_ct") {
303298
"SK_TYPEFACE_FACTORY_CORETEXT",
304299
"SK_FONTMGR_CORETEXT_AVAILABLE",
305300
]
306-
public = [
307-
"$_skia_root/include/ports/SkFontMgr_mac_ct.h",
308-
"$_skia_root/include/ports/SkTypeface_mac.h",
309-
]
310-
sources = [
311-
"$_skia_root/src/ports/SkFontMgr_mac_ct.cpp",
312-
"$_skia_root/src/ports/SkScalerContext_mac_ct.cpp",
313-
"$_skia_root/src/ports/SkScalerContext_mac_ct.h",
314-
"$_skia_root/src/ports/SkTypeface_mac_ct.cpp",
315-
"$_skia_root/src/ports/SkTypeface_mac_ct.h",
316-
]
301+
public = skia_ports_fontmgr_coretext_public
302+
sources = skia_ports_fontmgr_coretext_sources
317303

318304
if (is_mac) {
319305
frameworks = [
@@ -342,14 +328,8 @@ optional("fontmgr_win") {
342328
"SK_TYPEFACE_FACTORY_DIRECTWRITE",
343329
"SK_FONTMGR_DIRECTWRITE_AVAILABLE",
344330
]
345-
public = [ "$_skia_root/include/ports/SkTypeface_win.h" ]
346-
sources = [
347-
"$_skia_root/src/ports/SkFontMgr_win_dw.cpp",
348-
"$_skia_root/src/ports/SkScalerContext_win_dw.cpp",
349-
"$_skia_root/src/ports/SkScalerContext_win_dw.h",
350-
"$_skia_root/src/ports/SkTypeface_win_dw.cpp",
351-
"$_skia_root/src/ports/SkTypeface_win_dw.h",
352-
]
331+
public = skia_ports_windows_fonts_public
332+
sources = skia_ports_windows_fonts_sources
353333
if (skia_dwritecore_sdk != "") {
354334
defines = [ "DWRITE_CORE" ]
355335
if (is_win && is_clang) {
@@ -377,7 +357,9 @@ optional("gpu_shared") {
377357
public_deps = []
378358
frameworks = []
379359

380-
sources = skia_shared_gpu_sources + skia_sksl_gpu_sources
360+
sources = skia_shared_gpu_sources
361+
sources += skia_sksl_pipeline_sources
362+
sources += skia_sksl_codegen_sources
381363

382364
if (skia_use_vulkan) {
383365
public_defines += [ "SK_VULKAN" ]
@@ -565,11 +547,7 @@ optional("typeface_freetype") {
565547

566548
public_defines = [ "SK_TYPEFACE_FACTORY_FREETYPE" ]
567549
deps = [ "//flutter/third_party/freetype2" ]
568-
sources = [
569-
"$_skia_root/src/ports/SkFontHost_FreeType.cpp",
570-
"$_skia_root/src/ports/SkFontHost_FreeType_common.cpp",
571-
"$_skia_root/src/ports/SkFontHost_FreeType_common.h",
572-
]
550+
sources = skia_ports_freetype_sources
573551
}
574552

575553
optional("webp_decode") {
@@ -663,7 +641,9 @@ skia_component("skia") {
663641
sources += skia_codec_core
664642
sources += skia_codec_decode_bmp
665643
sources += skia_encode_srcs
666-
sources += skia_sksl_sources
644+
sources += skia_sksl_core_sources
645+
sources += skia_sksl_default_module_sources
646+
sources += skia_ports_sources
667647
sources += [
668648
"$_skia_root/src/android/SkAndroidFrameworkUtils.cpp",
669649
"$_skia_root/src/android/SkAnimatedImage.cpp",
@@ -673,9 +653,7 @@ skia_component("skia") {
673653
"$_skia_root/src/codec/SkParseEncodedOrigin.cpp",
674654
"$_skia_root/src/codec/SkSampledCodec.cpp",
675655
"$_skia_root/src/ports/SkDiscardableMemory_none.cpp",
676-
"$_skia_root/src/ports/SkGlobalInitialization_default.cpp",
677656
"$_skia_root/src/ports/SkMemory_malloc.cpp",
678-
"$_skia_root/src/ports/SkOSFile_stdio.cpp",
679657
"$_skia_root/src/sfnt/SkOTTable_name.cpp",
680658
"$_skia_root/src/sfnt/SkOTUtils.cpp",
681659
]
@@ -694,10 +672,10 @@ skia_component("skia") {
694672
}
695673

696674
if (is_win) {
675+
sources += skia_ports_windows_sources
697676
sources += [
698677
"$_skia_root/src/ports/SkDebug_win.cpp",
699678
"$_skia_root/src/ports/SkImageGeneratorWIC.cpp",
700-
"$_skia_root/src/ports/SkOSFile_win.cpp",
701679
"$_skia_root/src/ports/SkOSLibrary_win.cpp",
702680
]
703681
libs += [

0 commit comments

Comments
 (0)