Debian Codegraph @

tools/window/BUILD.bazel

raw
1 load("//bazel:skia_rules.bzl", "skia_cc_library", "skia_filegroup", "skia_objc_library")
2
3 package(
4 default_applicable_licenses = ["//:license"],
5 )
6
7 licenses(["notice"])
8
9 skia_filegroup(
10 name = "public_hdrs",
11 srcs = [
12 "DisplayParams.h",
13 "WindowContext.h",
14 ],
15 )
16
17 skia_filegroup(
18 name = "common_srcs",
19 srcs = [
20 "RasterWindowContext.h", # only used in tools/window/ so not part of public API
21 "WindowContext.cpp",
22 ],
23 )
24
25 skia_filegroup(
26 name = "public_unix_hdrs",
27 srcs = [
28 "unix/RasterWindowContext_unix.h",
29 "unix/XlibWindowInfo.h",
30 ],
31 )
32
33 skia_filegroup(
34 name = "common_unix_srcs",
35 srcs = [
36 "unix/RasterWindowContext_unix.cpp",
37 ],
38 )
39
40 skia_filegroup(
41 name = "public_mac_hdrs",
42 srcs = [
43 "mac/RasterWindowContext_mac.h",
44 ],
45 )
46
47 skia_filegroup(
48 name = "common_mac_non_arc_srcs",
49 srcs = [
50 "mac/MacWindowInfo.h",
51 "mac/RasterWindowContext_mac.mm",
52 ],
53 )
54
55 skia_filegroup(
56 name = "common_ios_srcs",
57 srcs = [
58 "ios/RasterWindowContext_ios.mm",
59 ],
60 )
61
62 skia_filegroup(
63 name = "common_ganesh_gl_srcs",
64 srcs = [
65 "GLWindowContext.cpp",
66 "GLWindowContext.h",
67 ],
68 )
69
70 skia_filegroup(
71 name = "public_unix_ganesh_gl_hdrs",
72 srcs = [
73 "unix/GaneshGLWindowContext_unix.h",
74 ],
75 )
76
77 skia_filegroup(
78 name = "unix_ganesh_gl_srcs",
79 srcs = [
80 "unix/GaneshGLWindowContext_unix.cpp",
81 ],
82 )
83
84 skia_filegroup(
85 name = "public_mac_ganesh_gl_hdrs",
86 srcs = [
87 "mac/GaneshGLWindowContext_mac.h",
88 ],
89 )
90
91 skia_filegroup(
92 name = "mac_ganesh_gl_non_arc_srcs",
93 srcs = [
94 "mac/GaneshGLWindowContext_mac.mm",
95 "mac/MacWindowGLUtils.h",
96 ],
97 )
98
99 skia_filegroup(
100 name = "common_metal_non_arc_srcs",
101 srcs = [
102 "MetalWindowContext.h",
103 "MetalWindowContext.mm",
104 ],
105 )
106
107 skia_filegroup(
108 name = "public_mac_ganesh_metal_hdrs",
109 srcs = [
110 "mac/GaneshMetalWindowContext_mac.h",
111 ],
112 )
113
114 skia_filegroup(
115 name = "mac_ganesh_metal_non_arc_srcs",
116 srcs = [
117 "mac/GaneshMetalWindowContext_mac.mm",
118 ],
119 )
120
121 skia_filegroup(
122 name = "common_vulkan_srcs",
123 srcs = [
124 "VulkanWindowContext.cpp",
125 "VulkanWindowContext.h",
126 ],
127 )
128
129 skia_filegroup(
130 name = "public_unix_ganesh_vulkan_hdrs",
131 srcs = [
132 "unix/GaneshVulkanWindowContext_unix.h",
133 ],
134 )
135
136 skia_filegroup(
137 name = "unix_ganesh_vulkan_srcs",
138 srcs = [
139 "unix/GaneshVulkanWindowContext_unix.cpp",
140 ],
141 )
142
143 skia_filegroup(
144 name = "public_graphite_hdrs",
145 srcs = [
146 "GraphiteDisplayParams.h",
147 ],
148 )
149
150 skia_filegroup(
151 name = "common_graphite_vulkan_srcs",
152 srcs = [
153 "GraphiteNativeVulkanWindowContext.cpp",
154 "GraphiteNativeVulkanWindowContext.h",
155 ],
156 )
157
158 skia_filegroup(
159 name = "public_unix_graphite_vulkan_hdrs",
160 srcs = [
161 "unix/GraphiteNativeVulkanWindowContext_unix.h",
162 ],
163 )
164
165 skia_filegroup(
166 name = "unix_graphite_vulkan_srcs",
167 srcs = [
168 "unix/GraphiteNativeVulkanWindowContext_unix.cpp",
169 ],
170 )
171
172 skia_filegroup(
173 name = "common_graphite_metal_srcs",
174 srcs = [
175 "GraphiteNativeMetalWindowContext.h",
176 "GraphiteNativeMetalWindowContext.mm",
177 ],
178 )
179
180 skia_filegroup(
181 name = "public_mac_graphite_metal_hdrs",
182 srcs = [
183 "mac/GraphiteNativeMetalWindowContext_mac.h",
184 ],
185 )
186
187 skia_filegroup(
188 name = "mac_graphite_metal_srcs",
189 srcs = [
190 "mac/GraphiteNativeMetalWindowContext_mac.mm",
191 ],
192 )
193
194 skia_cc_library(
195 name = "window",
196 testonly = True,
197 visibility = ["//tools:__subpackages__"],
198 deps = select({
199 "@platforms//os:linux": [":window_linux"],
200 "@platforms//os:macos": [":window_mac"],
201 }),
202 )
203
204 skia_cc_library(
205 name = "window_linux",
206 testonly = True,
207 srcs = [
208 ":common_ganesh_gl_srcs",
209 ":common_graphite_vulkan_srcs",
210 ":common_srcs",
211 ":common_unix_srcs",
212 ":common_vulkan_srcs",
213 ":unix_ganesh_gl_srcs",
214 ":unix_ganesh_vulkan_srcs",
215 ":unix_graphite_vulkan_srcs",
216 ],
217 hdrs = [
218 ":public_graphite_hdrs",
219 ":public_hdrs",
220 ":public_unix_ganesh_gl_hdrs",
221 ":public_unix_ganesh_vulkan_hdrs",
222 ":public_unix_graphite_vulkan_hdrs",
223 ":public_unix_hdrs",
224 ],
225 linkopts = [
226 "-lX11",
227 "-lxcb", # dep of X11
228 "-lXau", # dep of xcb
229 "-lXdmcp", # dep of xcb
230 "-lX11-xcb", # needed for Vulkan
231 ],
232 deps = [
233 "//:core",
234 "//tools/gpu/vk:testutils",
235 "//src/gpu/vk/vulkanmemoryallocator",
236 # Ganesh Support
237 "//src/gpu/ganesh:ganesh_TEST_UTIL",
238 "//src/gpu/ganesh/gl:ganesh_gl_TEST_UTIL",
239 "//src/gpu/ganesh/gl/glx:glx_factory_TEST_UTIL",
240 "//src/gpu/ganesh/vk:ganesh_vulkan_TEST_UTIL",
241 # Graphite Support
242 "//tools/graphite:graphite_utils",
243 "//src/gpu/graphite:graphite_TEST_UTIL",
244 "//src/gpu/graphite/vk:graphite_native_vulkan_TEST_UTIL",
245 ],
246 )
247
248 skia_objc_library(
249 name = "window_mac",
250 testonly = True,
251 srcs = [
252 ":common_ganesh_gl_srcs",
253 ":common_srcs",
254 ],
255 hdrs = [
256 ":public_graphite_hdrs",
257 ":public_hdrs",
258 ":public_mac_ganesh_gl_hdrs",
259 ":public_mac_ganesh_metal_hdrs",
260 ":public_mac_graphite_metal_hdrs",
261 ":public_mac_hdrs",
262 ],
263 non_arc_srcs = [
264 ":common_mac_non_arc_srcs",
265 ":mac_ganesh_gl_non_arc_srcs",
266 ":mac_ganesh_metal_non_arc_srcs",
267 ":common_graphite_metal_srcs",
268 ":common_metal_non_arc_srcs",
269 ":common_ganesh_gl_srcs",
270 ":mac_graphite_metal_srcs",
271 ],
272 sdk_frameworks = [
273 "QuartzCore",
274 "Cocoa",
275 "Foundation",
276 ],
277 deps = [
278 "//:core",
279 "//tools:tool_utils",
280 # Ganesh Support
281 "//src/gpu/ganesh/gl:ganesh_gl_TEST_UTIL",
282 "//src/gpu/ganesh/gl/mac:mac_factory_TEST_UTIL",
283 "//src/gpu/ganesh/mtl:ganesh_metal_TEST_UTIL",
284 # Graphite Support
285 "//tools/graphite:graphite_utils",
286 "//src/gpu/graphite:graphite_TEST_UTIL",
287 "//src/gpu/graphite/mtl:graphite_native_metal_TEST_UTIL",
288 ],
289 )