| load("//bazel:flags.bzl", "selects") |
| load( |
| "//bazel:skia_rules.bzl", |
| "exports_files_legacy", |
| "select_multi", |
| "skia_cc_deps", |
| "skia_cc_library", |
| "skia_filegroup", |
| "skia_objc_library", |
| ) |
| |
| package( |
| default_applicable_licenses = ["//:license"], |
| ) |
| |
| licenses(["notice"]) |
| |
| exports_files_legacy() |
| |
| skia_filegroup( |
| name = "discardable_memory_pool", |
| srcs = select({ |
| "//src/lazy:use_default_global_memory_pool_true": ["SkDiscardableMemory_none.cpp"], |
| "//conditions:default": [], |
| }), |
| ) |
| |
| # Any setting that causes this skia_filegroup to be included also needs to have a dependency on freetype. |
| # See "deps" and "uses_freetype" at the bottom of this file. |
| skia_filegroup( |
| name = "typeface_freetype", |
| srcs = [ |
| "SkFontHost_FreeType.cpp", |
| "SkFontHost_FreeType_common.cpp", |
| ], |
| ) |
| |
| skia_filegroup( |
| name = "typeface_freetype_hdrs", |
| srcs = [ |
| "SkFontHost_FreeType_common.h", |
| "SkTypeface_FreeType.h", |
| ], |
| ) |
| |
| skia_filegroup( |
| name = "typeface_fontations", |
| srcs = select({ |
| "//bazel/common_config_settings:use_fontations_true": [ |
| ":typeface_fontations_hdrs", |
| ":typeface_fontations_srcs", |
| ], |
| "//conditions:default": [], |
| }), |
| ) |
| |
| skia_filegroup( |
| name = "fontmgr", |
| srcs = select_multi( |
| { |
| "//bazel/common_config_settings:android_fontmgr": [ |
| ":fontmgr_android_srcs", |
| ":typeface_freetype", |
| ], |
| "//bazel/common_config_settings:custom_directory_fontmgr": [":fontmgr_custom_directory"], |
| "//bazel/common_config_settings:custom_embedded_fontmgr": [":fontmgr_custom_embedded"], |
| "//bazel/common_config_settings:custom_empty_fontmgr": [":fontmgr_custom_empty"], |
| "//bazel/common_config_settings:fci_fontmgr": [":fontmgr_fci"], |
| }, |
| ) + select({ |
| "@platforms//os:linux": [":legacy_fontmgr_fontconfig"], |
| "//conditions:default": [], |
| }), |
| ) |
| |
| skia_filegroup( |
| name = "fontmgr_android_srcs", |
| srcs = [ |
| "SkFontMgr_android.cpp", |
| "SkFontMgr_android_parser.cpp", |
| ], |
| ) |
| |
| skia_filegroup( |
| name = "fontmgr_android_hdrs", |
| srcs = [ |
| "SkFontMgr_android_parser.h", |
| ], |
| ) |
| |
| skia_filegroup( |
| name = "legacy_fontmgr_custom", |
| srcs = [ |
| "SkFontMgr_custom.cpp", |
| ":typeface_freetype", |
| ], |
| ) |
| |
| skia_filegroup( |
| name = "fontmgr_custom_directory", |
| srcs = [ |
| "SkFontMgr_custom_directory.cpp", |
| ":legacy_fontmgr_custom", |
| ], |
| ) |
| |
| skia_filegroup( |
| name = "fontmgr_custom_embedded", |
| srcs = [ |
| "SkFontMgr_custom_embedded.cpp", |
| ":legacy_fontmgr_custom", |
| ], |
| ) |
| |
| skia_filegroup( |
| name = "fontmgr_custom_empty", |
| srcs = [ |
| "SkFontMgr_custom_empty.cpp", |
| ":legacy_fontmgr_custom", |
| ], |
| ) |
| |
| # Any setting that causes this skia_filegroup to be included also needs to have a dependency on |
| # fontconfig. See "deps" and "uses_fontconfig" at the bottom of this file. |
| skia_filegroup( |
| name = "legacy_fontmgr_fontconfig", |
| srcs = [ |
| "SkFontMgr_fontconfig.cpp", |
| ":typeface_freetype", |
| ], |
| ) |
| |
| # TODO(bungeman, kjlubick) break this up into the direct and Interface part. |
| # Alternatively, delete it. |
| # Any setting that causes this skia_filegroup to be included also needs to have a dependency on |
| # fontconfig. See "deps" and "uses_fontconfig" at the bottom of this file. |
| skia_filegroup( |
| name = "fontmgr_fci", |
| srcs = [ |
| ":fontconfig_interface_srcs", |
| ":typeface_freetype", |
| ], |
| ) |
| |
| skia_filegroup( |
| name = "fontconfig_interface_srcs", |
| srcs = [ |
| "SkFontConfigInterface.cpp", |
| "SkFontConfigInterface_direct.cpp", |
| "SkFontConfigInterface_direct_factory.cpp", |
| "SkFontConfigTypeface.h", |
| "SkFontMgr_FontConfigInterface.cpp", |
| ], |
| ) |
| |
| skia_filegroup( |
| name = "global_init", |
| srcs = ["SkGlobalInitialization_default.cpp"], |
| ) |
| |
| # In own group to prevent exporting to *.gni files. |
| skia_filegroup( |
| name = "osfile_platform", |
| srcs = select({ |
| "@platforms//os:windows": [":osfile_win"], |
| "@platforms//os:ios": [ |
| "SkOSFile_ios.h", |
| ":osfile_posix", |
| "//include/ports:core_foundation_hdrs", |
| ], |
| "//conditions:default": [":osfile_posix"], |
| }), |
| ) |
| |
| skia_filegroup( |
| name = "osfile", |
| srcs = [ |
| "SkOSFile_stdio.cpp", |
| ":osfile_platform", |
| ], |
| visibility = ["//tools/skslc:__pkg__"], |
| ) |
| |
| skia_filegroup( |
| name = "osfile_posix", |
| srcs = ["SkOSFile_posix.cpp"], |
| ) |
| |
| skia_filegroup( |
| name = "osfile_win", |
| srcs = ["SkOSFile_win.cpp"], |
| ) |
| |
| skia_filegroup( |
| name = "malloc", |
| srcs = ["SkMemory_malloc.cpp"], # TODO(kjlubick) add select() if necessary |
| ) |
| |
| skia_filegroup( |
| name = "load_dynamic_library", |
| srcs = ["SkOSLibrary.h"] + select({ |
| "@platforms//os:windows": ["SkOSLibrary_win.cpp"], |
| "//conditions:default": ["SkOSLibrary_posix.cpp"], |
| }), |
| visibility = ["//tools/gpu:__pkg__"], |
| ) |
| |
| skia_filegroup( |
| name = "skdebug", |
| srcs = select({ |
| "@platforms//os:windows": ["SkDebug_win.cpp"], |
| "@platforms//os:android": ["SkDebug_android.cpp"], |
| "//conditions:default": ["SkDebug_stdio.cpp"], |
| }), |
| ) |
| |
| skia_filegroup( |
| name = "srcs", |
| srcs = [ |
| ":discardable_memory_pool", |
| ":fontmgr", |
| ":global_init", |
| ":load_dynamic_library", |
| ":malloc", |
| ":osfile", |
| ":skdebug", |
| ":typeface_fontations", |
| ], |
| visibility = ["//src:__pkg__"], |
| ) |
| |
| skia_filegroup( |
| name = "private_hdrs", |
| srcs = [ |
| "SkOSLibrary.h", |
| ] + select({ |
| ":uses_freetype": [ |
| "SkFontHost_FreeType_common.h", |
| "SkFontMgr_custom.h", |
| "SkTypeface_FreeType.h", |
| ], |
| "//conditions:default": [], |
| }) + select({ |
| "@platforms//os:ios": ["SkOSFile_ios.h"], |
| "//conditions:default": [], |
| }) + select({ |
| "//bazel/common_config_settings:android_fontmgr": [":fontmgr_android_hdrs"], |
| "//conditions:default": [], |
| }) + select({ |
| "//bazel/common_config_settings:fci_fontmgr": [ |
| "SkFontConfigInterface_direct.h", |
| "SkFontConfigTypeface.h", |
| ], |
| "//conditions:default": [], |
| }) + select({ |
| "//bazel/common_config_settings:use_fontations_true": [ |
| "SkFontScanner_fontations.h", |
| ":typeface_fontations_hdrs", |
| ], |
| "//conditions:default": [], |
| }), |
| visibility = ["//src:__pkg__"], |
| ) |
| |
| selects.config_setting_group( |
| name = "uses_freetype", |
| match_any = [ |
| "//bazel/common_config_settings:android_fontmgr", |
| "//bazel/common_config_settings:custom_directory_fontmgr", |
| "//bazel/common_config_settings:custom_embedded_fontmgr", |
| "//bazel/common_config_settings:custom_empty_fontmgr", |
| "//bazel/common_config_settings:fontconfig_fontmgr", |
| "//bazel/common_config_settings:fci_fontmgr", |
| "@platforms//os:linux", |
| ], |
| ) |
| |
| selects.config_setting_group( |
| name = "uses_fontconfig", |
| match_any = [ |
| "//bazel/common_config_settings:fontconfig_fontmgr", |
| "//bazel/common_config_settings:fci_fontmgr", |
| "@platforms//os:linux", |
| ], |
| ) |
| |
| selects.config_setting_group( |
| name = "uses_fontations", |
| match_any = [ |
| "//bazel/common_config_settings:use_fontations_true", |
| ], |
| ) |
| |
| skia_cc_deps( |
| name = "deps", |
| linkopts = select({ |
| "@platforms//os:linux": ["-ldl"], |
| "@platforms//os:android": [ |
| "-llog", # Provides __android_log_vprint, needed by //src/ports/SkDebug_android.cpp. |
| ], |
| "//conditions:default": [], |
| }), |
| visibility = ["//src:__pkg__"], |
| deps = select({ |
| ":uses_freetype": ["@freetype"], |
| "//conditions:default": [], |
| }) + select({ |
| ":uses_fontconfig": ["//bazel/external/fontconfig"], |
| "//conditions:default": [], |
| }) + select({ |
| "//bazel/common_config_settings:android_fontmgr": ["@expat"], |
| "//conditions:default": [], |
| }) + select({ |
| "//bazel/common_config_settings:use_fontations_true": [ |
| ":fontmgr_fontations_empty", |
| "//src/ports/fontations:deps", |
| ], |
| "//conditions:default": [], |
| }), |
| ) |
| |
| skia_filegroup( |
| name = "base_srcs", |
| srcs = [ |
| ":skdebug", |
| # TODO(kjlubick) Chromium will need a way to overwrite the malloc impls. Having malloc |
| # be a module doesn't quite work because ld complains "backward reference detected" |
| # when something in a module like pathops uses malloc without depending on it. |
| ":malloc", |
| ], |
| visibility = ["//src/base:__pkg__"], |
| ) |
| |
| skia_filegroup( |
| name = "core_srcs", |
| srcs = [ |
| ":global_init", |
| ":osfile", |
| ], |
| visibility = ["//src/core:__pkg__"], |
| ) |
| |
| skia_filegroup( |
| name = "fontmgr_custom_srcs", |
| srcs = [ |
| "SkFontMgr_custom.cpp", |
| ], |
| ) |
| |
| skia_filegroup( |
| name = "fontmgr_custom_hdrs", |
| srcs = [ |
| "SkFontMgr_custom.h", |
| ], |
| ) |
| |
| skia_cc_library( |
| name = "fontmgr_custom", |
| srcs = [":fontmgr_custom_srcs"], |
| hdrs = [":fontmgr_custom_hdrs"], |
| deps = [ |
| ":freetype_support", |
| "//src/base", |
| "//src/core", |
| "//src/core:core_priv", |
| ], |
| ) |
| |
| skia_cc_library( |
| name = "freetype_support", |
| srcs = [ |
| ":typeface_freetype", |
| "//src/utils:char_to_glyphcache", |
| ], |
| hdrs = [":typeface_freetype_hdrs"], |
| deps = [ |
| "//:core", |
| "//:pathops", |
| "@freetype", |
| ], |
| ) |
| |
| skia_cc_library( |
| name = "fontmgr_android_freetype", |
| srcs = [ |
| ":fontmgr_android_srcs", |
| ], |
| hdrs = [ |
| ":fontmgr_android_hdrs", |
| "//include/ports:android_fontmgr_hdrs", |
| ], |
| defines = ["SK_FONTMGR_ANDROID_AVAILABLE"], |
| visibility = ["//:__pkg__"], |
| deps = [ |
| ":freetype_support", |
| "//:core", |
| "//src/base", |
| "//src/core:core_priv", |
| "@expat", |
| ], |
| ) |
| |
| skia_filegroup( |
| name = "fontmgr_coretext_srcs", |
| srcs = ["SkFontMgr_mac_ct.cpp"], |
| ) |
| |
| skia_objc_library( |
| name = "fontmgr_coretext", |
| srcs = [ |
| ":fontmgr_coretext_srcs", |
| ], |
| hdrs = [ |
| "//include/ports:coretext_fontmgr_hdrs", |
| ], |
| defines = ["SK_FONTMGR_CORETEXT_AVAILABLE"], |
| features = ["layering_check"], |
| ios_frameworks = [ |
| "CoreText", |
| "CoreGraphics", |
| "CoreFoundation", |
| ], |
| mac_frameworks = [ |
| "ApplicationServices", |
| "CoreFoundation", |
| "CoreText", |
| ], |
| visibility = ["//:__pkg__"], |
| deps = [ |
| ":coretext_typeface", |
| "//:core", |
| "//src/base", |
| "//src/core:core_priv", |
| ], |
| ) |
| |
| skia_cc_library( |
| name = "fontmgr_data_freetype", |
| srcs = [ |
| "SkFontMgr_custom_embedded.cpp", |
| ], |
| hdrs = [ |
| "//include/ports:data_fontmgr_hdrs", |
| ], |
| defines = ["SK_FONTMGR_FREETYPE_DATA_AVAILABLE"], |
| features = ["layering_check"], |
| visibility = ["//:__pkg__"], |
| deps = [ |
| ":fontmgr_custom", |
| ":freetype_support", |
| "//:core", |
| "//src/base", |
| "//src/core:core_priv", |
| ], |
| ) |
| |
| skia_cc_library( |
| name = "fontmgr_directory_freetype", |
| srcs = [ |
| "SkFontMgr_custom_directory.cpp", |
| ], |
| hdrs = [ |
| "//include/ports:directory_fontmgr_hdrs", |
| ], |
| defines = ["SK_FONTMGR_FREETYPE_DIRECTORY_AVAILABLE"], |
| features = ["layering_check"], |
| visibility = ["//:__pkg__"], |
| deps = [ |
| ":fontmgr_custom", |
| ":freetype_support", |
| "//:core", |
| "//src/base", |
| "//src/core:core_priv", |
| ], |
| ) |
| |
| skia_cc_library( |
| name = "fontmgr_empty_freetype", |
| srcs = [ |
| "SkFontMgr_custom_empty.cpp", |
| ], |
| hdrs = [ |
| "//include/ports:empty_fontmgr_hdrs", |
| ], |
| defines = ["SK_FONTMGR_FREETYPE_EMPTY_AVAILABLE"], |
| features = ["layering_check"], |
| visibility = ["//:__pkg__"], |
| deps = [ |
| ":fontmgr_custom", |
| ":freetype_support", |
| "//:core", |
| "//src/base", |
| "//src/core:core_priv", |
| ], |
| ) |
| |
| skia_filegroup( |
| name = "typeface_fontations_hdrs", |
| srcs = ["SkTypeface_fontations_priv.h"], |
| ) |
| |
| skia_filegroup( |
| name = "typeface_fontations_srcs", |
| srcs = ["SkTypeface_fontations.cpp"], |
| ) |
| |
| skia_filegroup( |
| name = "fontmgr_fontations_empty_srcs", |
| srcs = [ |
| "SkFontMgr_fontations_empty.cpp", |
| "SkFontMgr_fontations_empty.h", |
| ], |
| ) |
| |
| skia_cc_library( |
| name = "fontmgr_fontations_empty", |
| srcs = [ |
| ":fontmgr_fontations_empty_srcs", |
| ":typeface_fontations", |
| "//include/ports:typeface_fontations_hdrs", |
| ], |
| hdrs = [ |
| "//include/ports:fontmgr_fontations_hdrs", |
| ], |
| defines = ["SK_FONTMGR_FONTATIONS_AVAILABLE"], |
| visibility = [ |
| "//:__pkg__", |
| "//tools/fonts:__pkg__", |
| ], |
| deps = [ |
| "//:core", |
| "//:pathops", |
| "//src/ports/fontations:deps", |
| ], |
| ) |
| |
| skia_cc_library( |
| name = "fontmgr_fontconfig_freetype", |
| srcs = [ |
| "SkFontMgr_fontconfig.cpp", |
| ], |
| hdrs = [ |
| "//include/ports:fontconfig_fontmgr_hdrs", |
| ], |
| defines = ["SK_FONTMGR_FONTCONFIG_AVAILABLE"], |
| visibility = ["//:__pkg__"], |
| deps = [ |
| ":freetype_support", |
| "//:core", |
| "//bazel/external/fontconfig", |
| "//src/base", |
| "//src/core:core_priv", |
| ], |
| ) |
| |
| skia_filegroup( |
| name = "typeface_mac_hdrs", |
| srcs = ["SkTypeface_mac_ct.h"], |
| visibility = ["//src/utils/mac:__pkg__"], |
| ) |
| |
| skia_filegroup( |
| name = "typeface_mac_srcs", |
| srcs = [ |
| "SkScalerContext_mac_ct.cpp", |
| "SkScalerContext_mac_ct.h", |
| "SkTypeface_mac_ct.cpp", |
| ], |
| ) |
| |
| skia_objc_library( |
| name = "coretext_typeface", |
| srcs = [ |
| ":typeface_mac_srcs", |
| ], |
| hdrs = [ |
| ":typeface_mac_hdrs", |
| "//include/ports:mac_typeface", |
| ], |
| features = ["layering_check"], |
| ios_frameworks = [ |
| "CoreFoundation", |
| "CoreGraphics", |
| "CoreText", |
| ], |
| mac_frameworks = ["ApplicationServices"], |
| visibility = [ |
| "//:__pkg__", |
| "//modules/skshaper:__pkg__", |
| ], |
| deps = [ |
| "//:core", |
| "//src/base", |
| "//src/core:core_priv", |
| "//src/utils/mac:mac_utils_priv", |
| ], |
| ) |
| |
| skia_objc_library( |
| name = "imagegenerator_coregraphics", |
| srcs = [ |
| "SkImageGeneratorCG.cpp", |
| ], |
| hdrs = [ |
| "//include/ports:imagegenerator_cg_hdrs", |
| ], |
| features = ["layering_check"], |
| ios_frameworks = [ |
| "CoreGraphics", |
| "ImageIO", |
| "MobileCoreServices", |
| ], |
| mac_frameworks = ["ApplicationServices"], |
| visibility = ["//:__pkg__"], |
| deps = [ |
| "//:core", |
| "//src/base", |
| "//src/codec:any_decoder", |
| "//src/core:core_priv", |
| "//src/utils/mac:mac_utils_priv", |
| ], |
| ) |
| |
| skia_filegroup( |
| name = "windows_fonts_srcs", |
| srcs = [ |
| "SkFontMgr_win_dw.cpp", |
| "SkScalerContext_win_dw.cpp", |
| "SkScalerContext_win_dw.h", |
| "SkTypeface_win_dw.cpp", |
| "SkTypeface_win_dw.h", |
| ], |
| ) |
| |
| skia_filegroup( |
| name = "fontmgr_fuchsia_srcs", |
| srcs = ["SkFontMgr_fuchsia.cpp"], |
| ) |
| |
| skia_filegroup( |
| name = "fonthost_win_srcs", |
| srcs = ["SkFontHost_win.cpp"], |
| ) |