| 1 |
load( |
| 2 |
"//bazel:skia_rules.bzl", |
| 3 |
"skia_cc_library", |
| 4 |
"skia_filegroup", |
| 5 |
"skia_objc_library", |
| 6 |
"supports_platforms", |
| 7 |
) |
| 8 |
|
| 9 |
package( |
| 10 |
default_applicable_licenses = ["//:license"], |
| 11 |
) |
| 12 |
|
| 13 |
licenses(["notice"]) |
| 14 |
|
| 15 |
skia_filegroup( |
| 16 |
name = "fontconfig_interface_srcs", |
| 17 |
srcs = [ |
| 18 |
"SkFontConfigInterface.cpp", |
| 19 |
"SkFontConfigInterface_direct.cpp", |
| 20 |
"SkFontConfigInterface_direct_factory.cpp", |
| 21 |
"SkFontConfigTypeface.h", |
| 22 |
"SkFontMgr_FontConfigInterface.cpp", |
| 23 |
], |
| 24 |
) |
| 25 |
|
| 26 |
skia_filegroup( |
| 27 |
name = "global_init", |
| 28 |
srcs = ["SkGlobalInitialization_default.cpp"], |
| 29 |
) |
| 30 |
|
| 31 |
# In own group to prevent exporting to *.gni files. |
| 32 |
skia_filegroup( |
| 33 |
name = "osfile_platform", |
| 34 |
srcs = select({ |
| 35 |
"@platforms//os:windows": [":osfile_win"], |
| 36 |
"@platforms//os:ios": [ |
| 37 |
"SkOSFile_ios.h", |
| 38 |
":osfile_posix", |
| 39 |
"//include/ports:core_foundation_hdrs", |
| 40 |
], |
| 41 |
"//conditions:default": [":osfile_posix"], |
| 42 |
}), |
| 43 |
) |
| 44 |
|
| 45 |
skia_filegroup( |
| 46 |
name = "osfile", |
| 47 |
srcs = [ |
| 48 |
"SkOSFile_stdio.cpp", |
| 49 |
":osfile_platform", |
| 50 |
], |
| 51 |
visibility = ["//tools/skslc:__pkg__"], |
| 52 |
) |
| 53 |
|
| 54 |
skia_filegroup( |
| 55 |
name = "osfile_posix", |
| 56 |
srcs = ["SkOSFile_posix.cpp"], |
| 57 |
) |
| 58 |
|
| 59 |
skia_filegroup( |
| 60 |
name = "osfile_win", |
| 61 |
srcs = ["SkOSFile_win.cpp"], |
| 62 |
) |
| 63 |
|
| 64 |
skia_filegroup( |
| 65 |
name = "malloc", |
| 66 |
srcs = ["SkMemory_malloc.cpp"], # TODO(kjlubick) add select() if necessary |
| 67 |
) |
| 68 |
|
| 69 |
skia_filegroup( |
| 70 |
name = "skdebug", |
| 71 |
srcs = select({ |
| 72 |
"@platforms//os:windows": ["SkLog_win.cpp"], |
| 73 |
"@platforms//os:android": ["SkLog_android.cpp"], |
| 74 |
"//conditions:default": ["SkLog_stdio.cpp"], |
| 75 |
}), |
| 76 |
) |
| 77 |
|
| 78 |
skia_filegroup( |
| 79 |
name = "base_srcs", |
| 80 |
srcs = [ |
| 81 |
":skdebug", |
| 82 |
# TODO(kjlubick) Chromium will need a way to overwrite the malloc impls. Having malloc |
| 83 |
# be a module doesn't quite work because ld complains "backward reference detected" |
| 84 |
# when something in a module like pathops uses malloc without depending on it. |
| 85 |
":malloc", |
| 86 |
], |
| 87 |
visibility = ["//src/base:__pkg__"], |
| 88 |
) |
| 89 |
|
| 90 |
skia_filegroup( |
| 91 |
name = "core_srcs", |
| 92 |
srcs = [ |
| 93 |
":global_init", |
| 94 |
":osfile", |
| 95 |
], |
| 96 |
visibility = ["//src/core:__pkg__"], |
| 97 |
) |
| 98 |
|
| 99 |
skia_cc_library( |
| 100 |
name = "fontmgr_custom", |
| 101 |
srcs = ["SkFontMgr_custom.cpp"], |
| 102 |
hdrs = ["SkFontMgr_custom.h"], |
| 103 |
deps = [ |
| 104 |
":freetype_support", |
| 105 |
"//src/base", |
| 106 |
"//src/core", |
| 107 |
"//src/core:core_priv", |
| 108 |
], |
| 109 |
) |
| 110 |
|
| 111 |
skia_cc_library( |
| 112 |
name = "freetype_support", |
| 113 |
srcs = [ |
| 114 |
"SkFontHost_FreeType.cpp", |
| 115 |
"SkFontHost_FreeType_common.cpp", |
| 116 |
], |
| 117 |
hdrs = [ |
| 118 |
"SkFontHost_FreeType_common.h", |
| 119 |
"SkFontScanner_FreeType_priv.h", |
| 120 |
"SkTypeface_FreeType.h", |
| 121 |
"//include/ports:typeface_freetype_hdrs", |
| 122 |
], |
| 123 |
defines = ["SK_TYPEFACE_FACTORY_FREETYPE"], |
| 124 |
implementation_deps = [ |
| 125 |
"//:pathops", |
| 126 |
"@freetype", |
| 127 |
], |
| 128 |
visibility = [ |
| 129 |
"//:__pkg__", |
| 130 |
"//tests:__pkg__", |
| 131 |
"//tools/fonts:__pkg__", |
| 132 |
], |
| 133 |
deps = [ |
| 134 |
"//:core", |
| 135 |
"//src/utils:char_to_glyphcache", |
| 136 |
], |
| 137 |
) |
| 138 |
|
| 139 |
skia_cc_library( |
| 140 |
name = "fontations_support", |
| 141 |
srcs = [":typeface_fontations_srcs"], |
| 142 |
hdrs = [ |
| 143 |
":typeface_fontations_hdrs", |
| 144 |
"//include/ports:typeface_fontations_hdrs", |
| 145 |
], |
| 146 |
defines = ["SK_TYPEFACE_FACTORY_FONTATIONS"], |
| 147 |
implementation_deps = [ |
| 148 |
"//src/ports/fontations:deps", |
| 149 |
], |
| 150 |
visibility = [ |
| 151 |
"//tests:__pkg__", |
| 152 |
"//tools/fonts:__pkg__", |
| 153 |
], |
| 154 |
deps = [ |
| 155 |
"//:core", |
| 156 |
"//src/codec:any_decoder", |
| 157 |
"//src/utils:char_to_glyphcache", |
| 158 |
], |
| 159 |
) |
| 160 |
|
| 161 |
skia_cc_library( |
| 162 |
name = "fontmgr_android_parser", |
| 163 |
srcs = [ |
| 164 |
"SkFontMgr_android_parser.cpp", |
| 165 |
], |
| 166 |
hdrs = [ |
| 167 |
"SkFontMgr_android_parser.h", |
| 168 |
], |
| 169 |
visibility = ["//:__pkg__"], |
| 170 |
deps = [ |
| 171 |
"//:core", |
| 172 |
"//src/base", |
| 173 |
"//src/core:core_priv", |
| 174 |
"@expat", |
| 175 |
], |
| 176 |
) |
| 177 |
|
| 178 |
skia_cc_library( |
| 179 |
name = "fontmgr_android", |
| 180 |
srcs = [ |
| 181 |
"SkFontMgr_android.cpp", |
| 182 |
], |
| 183 |
hdrs = [ |
| 184 |
"//include/ports:android_fontmgr_hdrs", |
| 185 |
], |
| 186 |
defines = ["SK_FONTMGR_ANDROID_AVAILABLE"], |
| 187 |
visibility = ["//:__pkg__"], |
| 188 |
deps = [ |
| 189 |
":fontmgr_android_parser", |
| 190 |
":typeface_proxy", |
| 191 |
"//:core", |
| 192 |
"//src/base", |
| 193 |
"//src/core:core_priv", |
| 194 |
], |
| 195 |
) |
| 196 |
|
| 197 |
skia_cc_library( |
| 198 |
name = "fontmgr_android_ndk", |
| 199 |
srcs = [ |
| 200 |
"SkFontMgr_android_ndk.cpp", |
| 201 |
], |
| 202 |
hdrs = [ |
| 203 |
"//include/ports:android_ndk_fontmgr_hdrs", |
| 204 |
], |
| 205 |
defines = ["SK_FONTMGR_ANDROID_NDK_AVAILABLE"], |
| 206 |
visibility = ["//:__pkg__"], |
| 207 |
deps = [ |
| 208 |
":fontmgr_android_parser", |
| 209 |
":typeface_proxy", |
| 210 |
"//:core", |
| 211 |
"//src/base", |
| 212 |
"//src/core:core_priv", |
| 213 |
], |
| 214 |
) |
| 215 |
|
| 216 |
skia_objc_library( |
| 217 |
name = "fontmgr_coretext", |
| 218 |
srcs = [ |
| 219 |
"SkFontMgr_mac_ct.cpp", |
| 220 |
], |
| 221 |
hdrs = [ |
| 222 |
"//include/ports:coretext_fontmgr_hdrs", |
| 223 |
], |
| 224 |
defines = [ |
| 225 |
"SK_FONTMGR_CORETEXT_AVAILABLE", |
| 226 |
"SK_TYPEFACE_FACTORY_CORETEXT", |
| 227 |
], |
| 228 |
features = ["layering_check"], |
| 229 |
ios_frameworks = [ |
| 230 |
"CoreText", |
| 231 |
"CoreGraphics", |
| 232 |
"CoreFoundation", |
| 233 |
], |
| 234 |
mac_frameworks = [ |
| 235 |
"ApplicationServices", |
| 236 |
"CoreFoundation", |
| 237 |
"CoreText", |
| 238 |
], |
| 239 |
target_compatible_with = supports_platforms( |
| 240 |
"@platforms//os:macos", |
| 241 |
"@platforms//os:ios", |
| 242 |
), |
| 243 |
visibility = ["//:__pkg__"], |
| 244 |
deps = [ |
| 245 |
":coretext_typeface", |
| 246 |
"//:core", |
| 247 |
"//src/base", |
| 248 |
"//src/core:core_priv", |
| 249 |
"//src/utils/mac:mac_utils_priv", |
| 250 |
], |
| 251 |
) |
| 252 |
|
| 253 |
skia_cc_library( |
| 254 |
name = "fontmgr_data_freetype", |
| 255 |
srcs = [ |
| 256 |
"SkFontMgr_custom_embedded.cpp", |
| 257 |
], |
| 258 |
hdrs = [ |
| 259 |
"//include/ports:data_fontmgr_hdrs", |
| 260 |
], |
| 261 |
defines = ["SK_FONTMGR_FREETYPE_DATA_AVAILABLE"], |
| 262 |
features = ["layering_check"], |
| 263 |
visibility = ["//:__pkg__"], |
| 264 |
deps = [ |
| 265 |
":fontmgr_custom", |
| 266 |
":freetype_support", |
| 267 |
"//:core", |
| 268 |
"//src/base", |
| 269 |
"//src/core:core_priv", |
| 270 |
], |
| 271 |
) |
| 272 |
|
| 273 |
skia_cc_library( |
| 274 |
name = "fontmgr_directory_freetype", |
| 275 |
srcs = [ |
| 276 |
"SkFontMgr_custom_directory.cpp", |
| 277 |
], |
| 278 |
hdrs = [ |
| 279 |
"//include/ports:directory_fontmgr_hdrs", |
| 280 |
], |
| 281 |
defines = ["SK_FONTMGR_FREETYPE_DIRECTORY_AVAILABLE"], |
| 282 |
features = ["layering_check"], |
| 283 |
visibility = ["//:__pkg__"], |
| 284 |
deps = [ |
| 285 |
":fontmgr_custom", |
| 286 |
":freetype_support", |
| 287 |
"//:core", |
| 288 |
"//src/base", |
| 289 |
"//src/core:core_priv", |
| 290 |
], |
| 291 |
) |
| 292 |
|
| 293 |
skia_cc_library( |
| 294 |
name = "fontmgr_empty_freetype", |
| 295 |
srcs = [ |
| 296 |
"SkFontMgr_custom_empty.cpp", |
| 297 |
], |
| 298 |
hdrs = [ |
| 299 |
"//include/ports:empty_fontmgr_hdrs", |
| 300 |
], |
| 301 |
defines = ["SK_FONTMGR_FREETYPE_EMPTY_AVAILABLE"], |
| 302 |
features = ["layering_check"], |
| 303 |
visibility = ["//:__pkg__"], |
| 304 |
deps = [ |
| 305 |
":fontmgr_custom", |
| 306 |
":freetype_support", |
| 307 |
"//:core", |
| 308 |
"//src/base", |
| 309 |
"//src/core:core_priv", |
| 310 |
], |
| 311 |
) |
| 312 |
|
| 313 |
skia_filegroup( |
| 314 |
name = "typeface_fontations_hdrs", |
| 315 |
srcs = [ |
| 316 |
"SkTypeface_fontations_factory.h", |
| 317 |
], |
| 318 |
) |
| 319 |
|
| 320 |
skia_filegroup( |
| 321 |
name = "typeface_fontations_srcs", |
| 322 |
srcs = [ |
| 323 |
"SkFontScanner_fontations.cpp", |
| 324 |
"SkFontScanner_fontations_priv.h", |
| 325 |
"SkTypeface_fontations.cpp", |
| 326 |
"SkTypeface_fontations_priv.h", |
| 327 |
], |
| 328 |
) |
| 329 |
|
| 330 |
skia_filegroup( |
| 331 |
name = "fontmgr_fontations_empty_srcs", |
| 332 |
srcs = [ |
| 333 |
"SkFontMgr_fontations_empty.cpp", |
| 334 |
], |
| 335 |
) |
| 336 |
|
| 337 |
skia_cc_library( |
| 338 |
name = "fontmgr_fontations_empty", |
| 339 |
srcs = [ |
| 340 |
":fontmgr_fontations_empty_srcs", |
| 341 |
], |
| 342 |
hdrs = [ |
| 343 |
"//include/ports:fontmgr_fontations_hdrs", |
| 344 |
], |
| 345 |
defines = ["SK_FONTMGR_FONTATIONS_AVAILABLE"], |
| 346 |
visibility = [ |
| 347 |
"//:__pkg__", |
| 348 |
"//tools/fonts:__pkg__", |
| 349 |
], |
| 350 |
deps = [ |
| 351 |
":fontations_support", |
| 352 |
"//:core", |
| 353 |
"//:pathops", |
| 354 |
"//src/ports/fontations:deps", |
| 355 |
], |
| 356 |
) |
| 357 |
|
| 358 |
skia_cc_library( |
| 359 |
name = "typeface_proxy", |
| 360 |
srcs = [":typeface_proxy_srcs"], |
| 361 |
hdrs = [":typeface_proxy_hdrs"], |
| 362 |
deps = [ |
| 363 |
"//:core", |
| 364 |
], |
| 365 |
) |
| 366 |
|
| 367 |
skia_cc_library( |
| 368 |
name = "fontmgr_fontconfig", |
| 369 |
srcs = [ |
| 370 |
"SkFontMgr_fontconfig.cpp", |
| 371 |
], |
| 372 |
hdrs = [ |
| 373 |
"//include/ports:fontconfig_fontmgr_hdrs", |
| 374 |
], |
| 375 |
defines = ["SK_FONTMGR_FONTCONFIG_AVAILABLE"], |
| 376 |
target_compatible_with = supports_platforms( |
| 377 |
"@platforms//os:linux", |
| 378 |
), |
| 379 |
visibility = [ |
| 380 |
"//:__pkg__", |
| 381 |
"//tools/fonts:__pkg__", |
| 382 |
], |
| 383 |
deps = [ |
| 384 |
":typeface_proxy", |
| 385 |
"//:core", |
| 386 |
"//bazel/external/fontconfig", |
| 387 |
"//src/base", |
| 388 |
"//src/core:core_priv", |
| 389 |
], |
| 390 |
) |
| 391 |
|
| 392 |
skia_filegroup( |
| 393 |
name = "typeface_mac_hdrs", |
| 394 |
srcs = ["SkTypeface_mac_ct.h"], |
| 395 |
visibility = ["//src/utils/mac:__pkg__"], |
| 396 |
) |
| 397 |
|
| 398 |
skia_filegroup( |
| 399 |
name = "typeface_mac_srcs", |
| 400 |
srcs = [ |
| 401 |
"SkScalerContext_mac_ct.cpp", |
| 402 |
"SkScalerContext_mac_ct.h", |
| 403 |
"SkTypeface_mac_ct.cpp", |
| 404 |
], |
| 405 |
) |
| 406 |
|
| 407 |
skia_filegroup( |
| 408 |
name = "typeface_proxy_hdrs", |
| 409 |
srcs = ["SkTypeface_proxy.h"], |
| 410 |
) |
| 411 |
|
| 412 |
skia_filegroup( |
| 413 |
name = "typeface_proxy_srcs", |
| 414 |
srcs = ["SkTypeface_proxy.cpp"], |
| 415 |
) |
| 416 |
|
| 417 |
skia_objc_library( |
| 418 |
name = "coretext_typeface", |
| 419 |
srcs = [ |
| 420 |
":typeface_mac_srcs", |
| 421 |
], |
| 422 |
hdrs = [ |
| 423 |
":typeface_mac_hdrs", |
| 424 |
"//include/ports:mac_typeface", |
| 425 |
], |
| 426 |
features = ["layering_check"], |
| 427 |
ios_frameworks = [ |
| 428 |
"CoreFoundation", |
| 429 |
"CoreGraphics", |
| 430 |
"CoreText", |
| 431 |
], |
| 432 |
mac_frameworks = ["ApplicationServices"], |
| 433 |
visibility = [ |
| 434 |
"//:__pkg__", |
| 435 |
"//modules/skshaper:__pkg__", |
| 436 |
], |
| 437 |
deps = [ |
| 438 |
"//:core", |
| 439 |
"//src/base", |
| 440 |
"//src/core:core_priv", |
| 441 |
"//src/utils/mac:mac_utils_priv", |
| 442 |
], |
| 443 |
) |
| 444 |
|
| 445 |
skia_objc_library( |
| 446 |
name = "imagegenerator_coregraphics", |
| 447 |
srcs = [ |
| 448 |
"SkImageGeneratorCG.cpp", |
| 449 |
], |
| 450 |
hdrs = [ |
| 451 |
"//include/ports:imagegenerator_cg_hdrs", |
| 452 |
], |
| 453 |
features = ["layering_check"], |
| 454 |
ios_frameworks = [ |
| 455 |
"CoreGraphics", |
| 456 |
"ImageIO", |
| 457 |
"MobileCoreServices", |
| 458 |
], |
| 459 |
mac_frameworks = ["ApplicationServices"], |
| 460 |
visibility = ["//:__pkg__"], |
| 461 |
deps = [ |
| 462 |
"//:core", |
| 463 |
"//src/base", |
| 464 |
"//src/codec:any_decoder", |
| 465 |
"//src/core:core_priv", |
| 466 |
"//src/utils/mac:mac_utils_priv", |
| 467 |
], |
| 468 |
) |
| 469 |
|
| 470 |
skia_cc_library( |
| 471 |
name = "imagegenerator_ndk", |
| 472 |
srcs = ["SkImageGeneratorNDK.cpp"], |
| 473 |
hdrs = ["//include/ports:imagegenerator_ndk_hdrs"], |
| 474 |
features = ["layering_check"], |
| 475 |
visibility = ["//:__pkg__"], |
| 476 |
deps = [ |
| 477 |
"//:core", |
| 478 |
"//src/base", |
| 479 |
"//src/codec:any_decoder", |
| 480 |
"//src/core:core_priv", |
| 481 |
], |
| 482 |
) |
| 483 |
|
| 484 |
skia_cc_library( |
| 485 |
name = "imagegenerator_wic", |
| 486 |
srcs = ["SkImageGeneratorWIC.cpp"], |
| 487 |
hdrs = ["//include/ports:imagegenerator_wic_hdrs"], |
| 488 |
features = ["layering_check"], |
| 489 |
visibility = ["//:__pkg__"], |
| 490 |
deps = [ |
| 491 |
"//:core", |
| 492 |
"//src/base", |
| 493 |
"//src/codec:any_decoder", |
| 494 |
"//src/core:core_priv", |
| 495 |
], |
| 496 |
) |
| 497 |
|
| 498 |
skia_cc_library( |
| 499 |
name = "imagegenerator", |
| 500 |
visibility = ["//dm:__pkg__"], |
| 501 |
deps = select({ |
| 502 |
"@platforms//os:android": [":imagegenerator_ndk"], |
| 503 |
"@platforms//os:macos": [":imagegenerator_coregraphics"], |
| 504 |
"@platforms//os:ios": [":imagegenerator_coregraphics"], |
| 505 |
"@platforms//os:windows": [":imagegenerator_wic"], |
| 506 |
"//conditions:default": [], |
| 507 |
}), |
| 508 |
) |
| 509 |
|
| 510 |
skia_filegroup( |
| 511 |
name = "windows_fonts_srcs", |
| 512 |
srcs = [ |
| 513 |
"SkFontMgr_win_dw.cpp", |
| 514 |
"SkScalerContext_win_dw.cpp", |
| 515 |
"SkScalerContext_win_dw.h", |
| 516 |
"SkTypeface_win_dw.cpp", |
| 517 |
"SkTypeface_win_dw.h", |
| 518 |
], |
| 519 |
) |
| 520 |
|
| 521 |
skia_filegroup( |
| 522 |
name = "fontmgr_fuchsia_srcs", |
| 523 |
srcs = ["SkFontMgr_fuchsia.cpp"], |
| 524 |
) |
| 525 |
|
| 526 |
skia_filegroup( |
| 527 |
name = "fonthost_win_srcs", |
| 528 |
srcs = ["SkFontHost_win.cpp"], |
| 529 |
) |