xref: /aosp_15_r20/external/skia/src/gpu/ganesh/gl/BUILD.bazel (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1load("//bazel:skia_rules.bzl", "generate_cpp_files_for_headers", "skia_cc_library", "skia_filegroup", "split_srcs_and_hdrs")
2
3package(
4    default_applicable_licenses = ["//:license"],
5)
6
7licenses(["notice"])
8
9CORE_FILES = [
10    "GrGLAssembleGLESInterfaceAutogen.cpp",
11    "GrGLAssembleGLInterfaceAutogen.cpp",
12    "GrGLAssembleHelpers.cpp",
13    "GrGLAssembleInterface.cpp",
14    "GrGLAssembleWebGLInterfaceAutogen.cpp",
15    "GrGLAttachment.cpp",
16    "GrGLAttachment.h",
17    "GrGLBuffer.cpp",
18    "GrGLBuffer.h",
19    "GrGLCaps.cpp",
20    "GrGLCaps.h",
21    "GrGLContext.cpp",
22    "GrGLContext.h",
23    "GrGLCoreFunctions.h",
24    "GrGLDefines.h",
25    "GrGLDirectContext.cpp",
26    "GrGLExtensions.cpp",
27    "GrGLBackendSurface.cpp",
28    "GrGLBackendSurfacePriv.h",
29    "GrGLFinishCallbacks.cpp",
30    "GrGLFinishCallbacks.h",
31    "GrGLGLSL.cpp",
32    "GrGLGLSL.h",
33    "GrGLGpu.cpp",
34    "GrGLGpu.h",
35    "GrGLGpuProgramCache.cpp",
36    "GrGLInterfaceAutogen.cpp",
37    "GrGLOpsRenderPass.cpp",
38    "GrGLOpsRenderPass.h",
39    "GrGLProgram.cpp",
40    "GrGLProgram.h",
41    "GrGLProgramDataManager.cpp",
42    "GrGLProgramDataManager.h",
43    "GrGLRenderTarget.cpp",
44    "GrGLRenderTarget.h",
45    "GrGLSemaphore.cpp",
46    "GrGLSemaphore.h",
47    "GrGLTexture.cpp",
48    "GrGLTexture.h",
49    "GrGLTextureRenderTarget.cpp",
50    "GrGLTextureRenderTarget.h",
51    "GrGLTypesPriv.cpp",
52    "GrGLTypesPriv.h",
53    "GrGLUniformHandler.cpp",
54    "GrGLUniformHandler.h",
55    "GrGLUtil.cpp",
56    "GrGLUtil.h",
57    "GrGLVaryingHandler.h",
58    "GrGLVertexArray.cpp",
59    "GrGLVertexArray.h",
60]
61
62split_srcs_and_hdrs(
63    name = "core",
64    files = CORE_FILES,
65)
66
67# In own group for mapping to //gn/gpu.gni:skia_null_gpu_sources.
68skia_filegroup(
69    name = "native_interface_none",
70    srcs = ["GrGLMakeNativeInterface_none.cpp"],
71)
72
73skia_filegroup(
74    name = "android_srcs",
75    srcs = ["AHardwareBufferGL.cpp"],
76)
77
78skia_cc_library(
79    name = "ganesh_gl",
80    srcs = [
81        ":core_hdrs",
82        ":core_srcs",
83        "//src/gpu/ganesh/gl/builders:builder_hdrs",
84        "//src/gpu/ganesh/gl/builders:builder_srcs",
85    ],
86    hdrs = [
87        "//include/gpu:shared_gpu_hdrs",
88        "//include/gpu/ganesh:ganesh_hdrs",
89        "//include/gpu/ganesh/gl:public_hdrs",
90    ],
91    defines = [
92        "SK_DISABLE_LEGACY_GL_MAKE_NATIVE_INTERFACE",
93        "SK_GL",
94    ],
95    features = ["layering_check"],
96    visibility = ["//:__pkg__"],
97    deps = [
98        "//:core",
99        "//src/base",
100        "//src/core:core_priv",
101        "//src/gpu",
102        "//src/gpu/ganesh",
103        "//src/sksl/codegen:glsl",
104    ],
105)
106
107skia_cc_library(
108    name = "ganesh_gl_TEST_UTIL",
109    testonly = True,
110    srcs = [
111        ":core_hdrs",
112        ":core_srcs",
113        "//src/gpu/ganesh/gl/builders:builder_hdrs",
114        "//src/gpu/ganesh/gl/builders:builder_srcs",
115    ],
116    hdrs = [
117        "//include/gpu:shared_gpu_hdrs",
118        "//include/gpu/ganesh:ganesh_hdrs",
119        "//include/gpu/ganesh/gl:public_hdrs",
120    ],
121    defines = [
122        "SK_DISABLE_LEGACY_GL_MAKE_NATIVE_INTERFACE",
123        "GPU_TEST_UTILS",
124        "SK_GL",
125    ],
126    features = ["layering_check"],
127    visibility = [
128        "//modules/skottie:__pkg__",
129        "//src/gpu/ganesh/gl:__subpackages__",
130        "//tools:__subpackages__",
131    ],
132    deps = [
133        "//:core",
134        "//src/base",
135        "//src/core:core_priv",
136        "//src/gpu",
137        "//src/gpu/ganesh:ganesh_TEST_UTIL",
138        "//src/sksl/codegen:glsl",
139    ],
140)
141
142generate_cpp_files_for_headers(
143    name = "headers_to_compile",
144    headers = [
145        "GrGLBackendSurfacePriv.h",
146    ],
147)
148