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