blob: d85cc8a407f1a8da30967b8784e49b9586137784 [file]
load("//bazel:skia_rules.bzl", "skia_cc_library", "skia_filegroup", "skia_objc_library")
package(
default_applicable_licenses = ["//:license"],
)
licenses(["notice"])
skia_filegroup(
name = "public_hdrs",
srcs = [
"DisplayParams.h",
"WindowContext.h",
],
)
skia_filegroup(
name = "common_srcs",
srcs = [
"RasterWindowContext.h", # only used in tools/window/ so not part of public API
"WindowContext.cpp",
],
)
skia_filegroup(
name = "public_unix_hdrs",
srcs = [
"unix/RasterWindowContext_unix.h",
"unix/XlibWindowInfo.h",
],
)
skia_filegroup(
name = "common_unix_srcs",
srcs = [
"unix/RasterWindowContext_unix.cpp",
],
)
skia_filegroup(
name = "public_mac_hdrs",
srcs = [
"mac/RasterWindowContext_mac.h",
],
)
skia_filegroup(
name = "common_mac_non_arc_srcs",
srcs = [
"mac/MacWindowInfo.h",
"mac/RasterWindowContext_mac.mm",
],
)
skia_filegroup(
name = "common_ios_srcs",
srcs = [
"ios/RasterWindowContext_ios.mm",
],
)
skia_filegroup(
name = "common_ganesh_gl_srcs",
srcs = [
"GLWindowContext.cpp",
"GLWindowContext.h",
],
)
skia_filegroup(
name = "public_unix_ganesh_gl_hdrs",
srcs = [
"unix/GaneshGLWindowContext_unix.h",
],
)
skia_filegroup(
name = "unix_ganesh_gl_srcs",
srcs = [
"unix/GaneshGLWindowContext_unix.cpp",
],
)
skia_filegroup(
name = "public_mac_ganesh_gl_hdrs",
srcs = [
"mac/GaneshGLWindowContext_mac.h",
],
)
skia_filegroup(
name = "mac_ganesh_gl_non_arc_srcs",
srcs = [
"mac/GaneshGLWindowContext_mac.mm",
"mac/MacWindowGLUtils.h",
],
)
skia_filegroup(
name = "common_metal_non_arc_srcs",
srcs = [
"MetalWindowContext.h",
"MetalWindowContext.mm",
],
)
skia_filegroup(
name = "public_mac_ganesh_metal_hdrs",
srcs = [
"mac/GaneshMetalWindowContext_mac.h",
],
)
skia_filegroup(
name = "mac_ganesh_metal_non_arc_srcs",
srcs = [
"mac/GaneshMetalWindowContext_mac.mm",
],
)
skia_filegroup(
name = "common_vulkan_srcs",
srcs = [
"VulkanWindowContext.cpp",
"VulkanWindowContext.h",
],
)
skia_filegroup(
name = "public_unix_ganesh_vulkan_hdrs",
srcs = [
"unix/GaneshVulkanWindowContext_unix.h",
],
)
skia_filegroup(
name = "unix_ganesh_vulkan_srcs",
srcs = [
"unix/GaneshVulkanWindowContext_unix.cpp",
],
)
skia_filegroup(
name = "public_graphite_hdrs",
srcs = [
"GraphiteDisplayParams.h",
],
)
skia_filegroup(
name = "common_graphite_vulkan_srcs",
srcs = [
"GraphiteNativeVulkanWindowContext.cpp",
"GraphiteNativeVulkanWindowContext.h",
],
)
skia_filegroup(
name = "common_graphite_dawn_hdrs",
srcs = [
"GraphiteDawnWindowContext.h",
],
)
skia_filegroup(
name = "common_graphite_dawn_srcs",
srcs = [
"GraphiteDawnWindowContext.cpp",
],
)
skia_filegroup(
name = "public_unix_graphite_vulkan_hdrs",
srcs = [
"unix/GraphiteNativeVulkanWindowContext_unix.h",
],
)
skia_filegroup(
name = "public_unix_graphite_dawn_hdrs",
srcs = [
"unix/GraphiteDawnXlibWindowContext_unix.h",
],
)
skia_filegroup(
name = "unix_graphite_vulkan_srcs",
srcs = [
"unix/GraphiteNativeVulkanWindowContext_unix.cpp",
],
)
skia_filegroup(
name = "unix_graphite_dawn_srcs",
srcs = [
"unix/GraphiteDawnXlibWindowContext_unix.cpp",
],
)
skia_filegroup(
name = "common_graphite_metal_srcs",
srcs = [
"GraphiteNativeMetalWindowContext.h",
"GraphiteNativeMetalWindowContext.mm",
],
)
skia_filegroup(
name = "public_mac_graphite_metal_hdrs",
srcs = [
"mac/GraphiteNativeMetalWindowContext_mac.h",
],
)
skia_filegroup(
name = "mac_graphite_metal_srcs",
srcs = [
"mac/GraphiteNativeMetalWindowContext_mac.mm",
],
)
skia_filegroup(
name = "public_mac_graphite_dawn_hdrs",
srcs = [
"mac/GraphiteDawnMetalWindowContext_mac.h",
],
)
skia_filegroup(
name = "mac_graphite_dawn_srcs",
srcs = [
"mac/GraphiteDawnMetalWindowContext_mac.mm",
],
)
skia_filegroup(
name = "public_win_hdrs",
srcs = [
"win/WindowContextFactory_win.h",
],
)
skia_filegroup(
name = "common_win_srcs",
srcs = [
"win/RasterWindowContext_win.cpp",
],
)
skia_filegroup(
name = "win_ganesh_gl_srcs",
srcs = [
"win/GLWindowContext_win.cpp",
],
)
skia_filegroup(
name = "win_ganesh_vulkan_srcs",
srcs = [
"win/VulkanWindowContext_win.cpp",
],
)
skia_filegroup(
name = "win_graphite_vulkan_srcs",
srcs = [
"win/GraphiteVulkanWindowContext_win.cpp",
],
)
skia_filegroup(
name = "win_graphite_dawn_srcs",
srcs = [
"win/GraphiteDawnWindowContext_win.cpp",
],
)
skia_filegroup(
name = "win_ganesh_d3d_srcs",
srcs = [
"win/D3D12WindowContext_win.cpp",
],
)
skia_cc_library(
name = "window",
testonly = True,
visibility = ["//tools:__subpackages__"],
deps = select({
"@platforms//os:linux": [":window_linux"],
"@platforms//os:macos": [":window_mac"],
"@platforms//os:windows": [":window_win"],
}),
)
skia_cc_library(
name = "window_win",
testonly = True,
srcs = [
":common_ganesh_gl_srcs",
":common_graphite_dawn_srcs",
":common_graphite_vulkan_srcs",
":common_srcs",
":common_vulkan_srcs",
":common_win_srcs",
":win_ganesh_d3d_srcs",
":win_ganesh_gl_srcs",
":win_ganesh_vulkan_srcs",
":win_graphite_dawn_srcs",
":win_graphite_vulkan_srcs",
],
hdrs = [
":common_graphite_dawn_hdrs",
":public_graphite_hdrs",
":public_hdrs",
":public_win_hdrs",
"//tools/sk_app:hdrs",
],
linkopts = [
"gdi32.lib",
"OpenGL32.lib",
"user32.lib",
"d3d12.lib",
"dxgi.lib",
"d3dcompiler.lib",
],
visibility = ["//tools:__subpackages__"],
deps = [
"//:core",
"//tools:tool_utils",
"//tools/gpu/vk:testutils",
"//tools/skui",
"//tools/timer",
"//src/gpu/vk/vulkanmemoryallocator",
# Ganesh Support
"//src/gpu/ganesh:ganesh_TEST_UTIL",
"//src/gpu/ganesh/gl:ganesh_gl_TEST_UTIL",
"//src/gpu/ganesh/gl/win:win_factory_TEST_UTIL",
"//src/gpu/ganesh/vk:ganesh_vulkan_TEST_UTIL",
"//src/gpu/ganesh/d3d:ganesh_d3d_TEST_UTIL",
"//tools/ganesh:ganesh_gl_utils",
"//tools/ganesh:ganesh_d3d_utils",
# Graphite Support
"//tools/graphite:graphite_utils",
"//tools/graphite/dawn:graphite_dawn_testutils",
"//src/gpu/graphite:graphite_TEST_UTIL",
"//src/gpu/graphite/dawn:graphite_native_dawn_TEST_UTIL",
"//src/gpu/graphite/vk:graphite_native_vulkan_TEST_UTIL",
"@dawn",
"@d3d12allocator",
],
)
skia_cc_library(
name = "window_linux",
testonly = True,
srcs = [
":common_ganesh_gl_srcs",
":common_graphite_dawn_srcs",
":common_graphite_vulkan_srcs",
":common_srcs",
":common_unix_srcs",
":common_vulkan_srcs",
":unix_ganesh_gl_srcs",
":unix_ganesh_vulkan_srcs",
":unix_graphite_dawn_srcs",
":unix_graphite_vulkan_srcs",
],
hdrs = [
":common_graphite_dawn_hdrs",
":public_graphite_hdrs",
":public_hdrs",
":public_unix_ganesh_gl_hdrs",
":public_unix_ganesh_vulkan_hdrs",
":public_unix_graphite_dawn_hdrs",
":public_unix_graphite_vulkan_hdrs",
":public_unix_hdrs",
"//tools/sk_app:hdrs",
],
linkopts = [
"-lX11",
"-lxcb", # dep of X11
"-lXau", # dep of xcb
"-lXdmcp", # dep of xcb
"-lX11-xcb", # needed for Vulkan
],
deps = [
"//:core",
"//tools:tool_utils",
"//tools/gpu/vk:testutils",
"//tools/skui",
"//tools/timer",
"//src/gpu/vk/vulkanmemoryallocator",
# Ganesh Support
"//src/gpu/ganesh:ganesh_TEST_UTIL",
"//src/gpu/ganesh/gl:ganesh_gl_TEST_UTIL",
"//src/gpu/ganesh/gl/glx:glx_factory_TEST_UTIL",
"//src/gpu/ganesh/vk:ganesh_vulkan_TEST_UTIL",
# Graphite Support
"//tools/graphite:graphite_utils",
"//tools/graphite/dawn:graphite_dawn_testutils",
"//src/gpu/graphite:graphite_TEST_UTIL",
"//src/gpu/graphite/dawn:graphite_native_dawn_TEST_UTIL",
"//src/gpu/graphite/vk:graphite_native_vulkan_TEST_UTIL",
"@dawn",
],
)
skia_objc_library(
name = "window_mac",
testonly = True,
srcs = [
":common_ganesh_gl_srcs",
":common_graphite_dawn_srcs",
":common_srcs",
],
hdrs = [
":common_graphite_dawn_hdrs",
":public_graphite_hdrs",
":public_hdrs",
":public_mac_ganesh_gl_hdrs",
":public_mac_ganesh_metal_hdrs",
":public_mac_graphite_dawn_hdrs",
":public_mac_graphite_metal_hdrs",
":public_mac_hdrs",
],
non_arc_srcs = [
":common_mac_non_arc_srcs",
":mac_ganesh_gl_non_arc_srcs",
":mac_ganesh_metal_non_arc_srcs",
":common_graphite_metal_srcs",
":common_metal_non_arc_srcs",
":common_ganesh_gl_srcs",
":mac_graphite_metal_srcs",
":mac_graphite_dawn_srcs",
],
sdk_frameworks = [
"QuartzCore",
"Cocoa",
"Foundation",
],
deps = [
"//:core",
"//tools:tool_utils",
# Ganesh Support
"//src/gpu/ganesh/gl:ganesh_gl_TEST_UTIL",
"//src/gpu/ganesh/gl/mac:mac_factory_TEST_UTIL",
"//src/gpu/ganesh/mtl:ganesh_metal_TEST_UTIL",
# Graphite Support
"//tools/graphite:graphite_utils",
"//tools/graphite/dawn:graphite_dawn_testutils",
"//src/gpu/graphite:graphite_TEST_UTIL",
"//src/gpu/graphite/dawn:graphite_native_dawn_TEST_UTIL",
"//src/gpu/graphite/mtl:graphite_native_metal_TEST_UTIL",
"@dawn",
],
)