• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1load("//bazel:skia_rules.bzl", "exports_files_legacy", "skia_filegroup", "split_srcs_and_hdrs")
2load("//bazel:flags.bzl", "selects")
3
4licenses(["notice"])
5
6exports_files_legacy()
7
8# In own group for exporting to sksl.gni:skslc_deps.
9CORE_SKSLC_FILES = [
10    "SkParse.cpp",
11    "SkOSPath.h",
12    "SkOSPath.cpp",
13    "SkVMVisualizer.cpp",
14    "SkVMVisualizer.h",
15]
16
17split_srcs_and_hdrs(
18    name = "core_skslc",
19    files = CORE_SKSLC_FILES,
20)
21
22CORE_FILES = [
23    "SkAnimCodecPlayer.cpp",
24    "SkBase64.cpp",
25    "SkBitSet.h",
26    "SkBlitterTrace.h",
27    "SkBlitterTraceCommon.h",
28    "SkCallableTraits.h",
29    "SkCamera.cpp",
30    "SkCanvasStack.cpp",
31    "SkCanvasStack.h",
32    "SkCanvasStateUtils.cpp",
33    "SkCharToGlyphCache.cpp",
34    "SkCharToGlyphCache.h",
35    "SkClipStackUtils.cpp",
36    "SkClipStackUtils.h",
37    "SkCustomTypeface.cpp",
38    "SkCycles.h",
39    "SkDashPath.cpp",
40    "SkDashPathPriv.h",
41    "SkEventTracer.cpp",
42    "SkFloatToDecimal.cpp",
43    "SkFloatToDecimal.h",
44    "SkFloatUtils.h",
45    "SkGaussianColorFilter.cpp",
46    "SkMatrix22.cpp",
47    "SkMatrix22.h",
48    "SkMultiPictureDocument.cpp",
49    "SkMultiPictureDocumentPriv.h",
50    "SkNWayCanvas.cpp",
51    "SkNullCanvas.cpp",
52    "SkOrderedFontMgr.cpp",
53    "SkPaintFilterCanvas.cpp",
54    "SkParseColor.cpp",
55    "SkParsePath.cpp",
56    "SkPatchUtils.cpp",
57    "SkPatchUtils.h",
58    "SkPolyUtils.cpp",
59    "SkPolyUtils.h",
60    "SkShadowTessellator.cpp",
61    "SkShadowTessellator.h",
62    "SkShadowUtils.cpp",
63    "SkTestCanvas.h",
64    "SkTextUtils.cpp",
65]
66
67split_srcs_and_hdrs(
68    name = "core",
69    files = CORE_FILES,
70)
71
72skia_filegroup(
73    name = "json_hdrs",
74    srcs = [
75        "SkJSON.h",
76        "SkJSONWriter.h",
77    ],
78    visibility = [
79        "//modules/skottie:__pkg__",
80        "//tools/debugger:__pkg__",
81    ],
82)
83
84skia_filegroup(
85    name = "json_srcs",
86    srcs = [
87        "SkJSON.cpp",
88        "SkJSONWriter.cpp",
89    ],
90    visibility = [
91        "//modules/skottie:__pkg__",
92        "//tools/debugger:__pkg__",
93    ],
94)
95
96selects.config_setting_group(
97    name = "needs_json",
98    match_any = [
99        "//src/sksl:enable_sksl_tracing_true",
100    ],
101)
102
103# In separate group to avoid exporting to a *.gni file.
104SKSL_FILES = [
105    "SkShaderUtils.cpp",
106    "SkShaderUtils.h",
107]
108
109split_srcs_and_hdrs(
110    name = "sksl",
111    files = SKSL_FILES,
112)
113
114skia_filegroup(
115    name = "chromium_hdrs",
116    # We allow chromium to use this as a diagnostic tool, but it is not
117    # part of Skia's public API. It is in its own filegroup to create
118    # a gni entry containing it.
119    srcs = [
120        "SkMultiPictureDocument.h",
121    ],
122)
123
124skia_filegroup(
125    name = "srcs",
126    srcs = [
127        ":core_srcs",
128        ":core_skslc_srcs",
129    ] + select({
130        "//src/sksl:needs_sksl": [":sksl_srcs"],
131        "//conditions:default": [],
132    }) + select({
133        ":needs_json": [":json_srcs"],
134        "//conditions:default": [],
135    }),
136    visibility = ["//src:__pkg__"],
137)
138
139skia_filegroup(
140    name = "private_hdrs",
141    srcs = [
142        ":chromium_hdrs",
143        ":core_hdrs",
144        ":core_skslc_hdrs",
145    ] + select({
146        "//src/sksl:needs_sksl": [":sksl_hdrs"],
147        "//conditions:default": [],
148    }) + select({
149        ":needs_json": [":json_hdrs"],
150        "//conditions:default": [],
151    }),
152    visibility = ["//src:__pkg__"],
153)
154