• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1load("//bazel:skia_rules.bzl", "exports_files_legacy", "select_multi", "skia_cc_deps", "skia_filegroup", "split_srcs_and_hdrs")
2load("//bazel:flags.bzl", "bool_flag", "selects", "string_flag_with_values")
3
4licenses(["notice"])
5
6exports_files_legacy()
7
8# In own group for exporting to //gn/gpu.gni:skia_shared_gpu_sources.
9SHARED_FILES = [
10    "AsyncReadTypes.h",
11    "AtlasTypes.cpp",
12    "AtlasTypes.h",
13    "Blend.cpp",
14    "Blend.h",
15    "BufferWriter.h",
16    "KeyBuilder.h",
17    "MutableTextureStateRef.h",
18    "Rectanizer.h",
19    "RectanizerPow2.cpp",
20    "RectanizerPow2.h",
21    "RectanizerSkyline.cpp",
22    "RectanizerSkyline.h",
23    "RefCntedCallback.h",
24    "ResourceKey.cpp",
25    "ResourceKey.h",
26    "SkBackingFit.h",
27    "Swizzle.cpp",
28    "Swizzle.h",
29]
30
31split_srcs_and_hdrs(
32    name = "shared",
33    files = SHARED_FILES,
34)
35
36CORE_FILES = [
37    "GrAHardwareBufferUtils.h",
38    "GrRectanizer.h",
39    "ShaderErrorHandler.cpp",
40    "SkRenderEngineAbortf.h",
41]
42
43split_srcs_and_hdrs(
44    name = "core",
45    files = CORE_FILES,
46)
47
48string_flag_with_values(
49    name = "gpu_backend",
50    multiple = True,
51    values = [
52        "gl_backend",
53        "vulkan_backend",
54        "dawn_backend",
55    ],
56)
57
58string_flag_with_values(
59    name = "with_gl_standard",
60    values = [
61        "gles_standard",
62        "gl_standard",
63        "webgl_standard",
64    ],
65)
66
67selects.config_setting_group(
68    name = "has_gpu_backend",
69    match_any = [
70        ":gl_backend",
71        ":dawn_backend",
72        ":vulkan_backend",
73    ],
74    visibility = ["//:__subpackages__"],
75)
76
77selects.config_setting_group(
78    name = "vulkan_with_vma",
79    match_all = [
80        ":vulkan_backend",
81        ":use_vulkan_memory_allocator_true",
82    ],
83    visibility = ["//:__subpackages__"],
84)
85
86bool_flag(
87    name = "use_vulkan_memory_allocator",
88    default = True,
89    public = False,  # Users should use :vulkan_with_vma
90)
91
92bool_flag(
93    name = "enable_gpu_test_utils",
94    default = False,
95)
96
97skia_filegroup(
98    name = "srcs",
99    srcs = [
100        ":core_srcs",
101        ":shared_srcs",
102        "//src/gpu/ganesh:srcs",
103        "//src/gpu/tessellate:srcs",
104    ] + select({
105        "//src/gpu:vulkan_backend": ["//src/gpu/vk:srcs"],
106        "//conditions:default": [],
107    }),
108    visibility = ["//src:__pkg__"],
109)
110
111skia_filegroup(
112    name = "private_hdrs",
113    srcs = [
114        ":core_hdrs",
115        ":shared_hdrs",
116        "//src/gpu/ganesh:private_hdrs",
117        "//src/gpu/tessellate:private_hdrs",
118    ] + select({
119        "//src/gpu:vulkan_backend": ["//src/gpu/vk:private_hdrs"],
120        "//conditions:default": [],
121    }),
122    visibility = ["//src:__pkg__"],
123)
124
125skia_cc_deps(
126    name = "deps",
127    visibility = ["//src:__pkg__"],
128    deps = [
129        "//src/gpu/ganesh:deps",
130    ] + select_multi(
131        {
132            "//src/gpu:vulkan_backend": ["//src/gpu/vk:deps"],
133        },
134    ),
135)
136