1load("//bazel:skia_rules.bzl", "skia_cc_library", "skia_filegroup", "skia_objc_library") 2 3package( 4 default_applicable_licenses = ["//:license"], 5) 6 7licenses(["notice"]) 8 9skia_filegroup( 10 name = "common_hdrs", 11 srcs = [ 12 "DisplayParams.h", 13 "WindowContext.h", 14 ], 15) 16 17skia_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 25skia_filegroup( 26 name = "common_linux_hdrs", 27 srcs = [ 28 "unix/RasterWindowContext_unix.h", 29 "unix/XlibWindowInfo.h", 30 ], 31) 32 33skia_filegroup( 34 name = "common_linux_srcs", 35 srcs = [ 36 "unix/RasterWindowContext_unix.cpp", 37 ], 38) 39 40skia_filegroup( 41 name = "common_mac_hdrs", 42 srcs = [ 43 "mac/RasterWindowContext_mac.h", 44 ], 45) 46 47skia_filegroup( 48 name = "common_mac_srcs", 49 srcs = [ 50 "mac/MacWindowInfo.h", 51 "mac/RasterWindowContext_mac.mm", 52 ], 53) 54 55skia_filegroup( 56 name = "common_ios_srcs", 57 srcs = [ 58 "ios/RasterWindowContext_ios.mm", 59 ], 60) 61 62skia_filegroup( 63 name = "common_ganesh_gl_srcs", 64 srcs = [ 65 "GLWindowContext.cpp", 66 "GLWindowContext.h", 67 ], 68) 69 70skia_filegroup( 71 name = "linux_ganesh_gl_hdrs", 72 srcs = [ 73 "unix/GaneshGLWindowContext_unix.h", 74 ], 75) 76 77skia_filegroup( 78 name = "linux_ganesh_gl_srcs", 79 srcs = [ 80 "unix/GaneshGLWindowContext_unix.cpp", 81 ], 82) 83 84skia_filegroup( 85 name = "mac_ganesh_gl_hdrs", 86 srcs = [ 87 "mac/GaneshGLWindowContext_mac.h", 88 ], 89) 90 91skia_filegroup( 92 name = "mac_ganesh_gl_srcs", 93 srcs = [ 94 "mac/GaneshGLWindowContext_mac.mm", 95 "mac/MacWindowGLUtils.h", 96 ], 97) 98 99skia_filegroup( 100 name = "common_metal_hdrs", 101 srcs = [ 102 "MetalWindowContext.h", 103 ], 104) 105 106skia_filegroup( 107 name = "common_metal_srcs", 108 srcs = [ 109 "MetalWindowContext.mm", 110 ], 111) 112 113skia_filegroup( 114 name = "mac_ganesh_metal_hdrs", 115 srcs = [ 116 "mac/GaneshMetalWindowContext_mac.h", 117 ], 118) 119 120skia_filegroup( 121 name = "mac_ganesh_metal_srcs", 122 srcs = [ 123 "mac/GaneshMetalWindowContext_mac.mm", 124 ], 125) 126 127skia_filegroup( 128 name = "common_vulkan_srcs", 129 srcs = [ 130 "VulkanWindowContext.cpp", 131 "VulkanWindowContext.h", 132 ], 133) 134 135skia_filegroup( 136 name = "linux_ganesh_vulkan_hdrs", 137 srcs = [ 138 "unix/GaneshVulkanWindowContext_unix.h", 139 ], 140) 141 142skia_filegroup( 143 name = "linux_ganesh_vulkan_srcs", 144 srcs = [ 145 "unix/GaneshVulkanWindowContext_unix.cpp", 146 ], 147) 148 149skia_cc_library( 150 name = "window", 151 testonly = True, 152 visibility = ["//tools:__subpackages__"], 153 deps = select({ 154 "@platforms//os:linux": [":window_linux"], 155 "@platforms//os:macos": [":window_mac"], 156 "@platforms//os:ios": [":window_ios"], 157 }), 158) 159 160skia_cc_library( 161 name = "window_linux", 162 testonly = True, 163 srcs = [ 164 ":common_ganesh_gl_srcs", 165 ":common_linux_srcs", 166 ":common_srcs", 167 ":common_vulkan_srcs", 168 ":linux_ganesh_gl_srcs", 169 ":linux_ganesh_vulkan_srcs", 170 ], 171 hdrs = [ 172 ":common_hdrs", 173 ":common_linux_hdrs", 174 ":linux_ganesh_gl_hdrs", 175 ":linux_ganesh_vulkan_hdrs", 176 ], 177 linkopts = [ 178 "-lX11", 179 "-lxcb", # dep of X11 180 "-lXau", # dep of xcb 181 "-lXdmcp", # dep of xcb 182 "-lX11-xcb", # needed for Vulkan 183 ], 184 deps = [ 185 "//:core", 186 "//src/gpu/ganesh:ganesh_TEST_UTIL", 187 "//src/gpu/ganesh/gl:ganesh_gl_TEST_UTIL", 188 "//src/gpu/ganesh/gl/glx:glx_factory_TEST_UTIL", 189 "//src/gpu/ganesh/vk:ganesh_vulkan_TEST_UTIL", 190 "//tools/gpu/vk:testutils", 191 ], 192) 193 194skia_objc_library( 195 name = "window_mac", 196 testonly = True, 197 srcs = [ 198 "common_ganesh_gl_srcs", 199 ":common_mac_srcs", 200 ":common_metal_srcs", 201 ":common_srcs", 202 ":mac_ganesh_gl_srcs", 203 ":mac_ganesh_metal_srcs", 204 ], 205 hdrs = [ 206 ":common_hdrs", 207 ":common_mac_hdrs", 208 ":common_metal_hdrs", 209 ":mac_ganesh_gl_hdrs", 210 ":mac_ganesh_metal_hdrs", 211 ], 212 sdk_frameworks = [ 213 "QuartzCore", 214 "Cocoa", 215 "Foundation", 216 ], 217 deps = [ 218 "//:core", 219 "//src/gpu/ganesh/gl:ganesh_gl_TEST_UTIL", 220 "//src/gpu/ganesh/gl/mac:mac_factory_TEST_UTIL", 221 "//src/gpu/ganesh/mtl:ganesh_metal_TEST_UTIL", 222 "//tools:tool_utils", 223 ], 224) 225 226skia_objc_library( 227 name = "window_ios", 228 testonly = True, 229 srcs = [ 230 "common_ganesh_gl_srcs", 231 ":common_ios_srcs", 232 ":common_srcs", 233 ], 234 hdrs = [ 235 "ios/WindowContextFactory_ios.h", 236 ":common_hdrs", 237 ":common_metal_hdrs", 238 "//tools/sk_app:hdrs", 239 "//tools/sk_app/ios:hdrs", 240 ], 241 deps = [ 242 "//:core", 243 "//src/gpu/ganesh/gl:ganesh_gl_TEST_UTIL", 244 "//src/gpu/ganesh/gl/iOS:ios_factory", 245 "//tools:tool_utils", 246 "//tools/skui", 247 ], 248) 249 250# TODO(kjlubick): fold this into window above for the backends which depend on graphite 251skia_cc_library( 252 name = "window_graphite", 253 testonly = True, 254 hdrs = [ 255 "GraphiteDisplayParams.h", 256 ], 257 visibility = ["//tools:__subpackages__"], 258 deps = [ 259 ":window", 260 "//tools/graphite:graphite_utils", 261 ], 262) 263