xref: /aosp_15_r20/external/skia/src/gpu/ganesh/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
9# In separate groups for exporting to sksl.gni:skslc_deps.
10SKSLC_FILES = [
11    "GrMemoryPool.cpp",
12    "GrMemoryPool.h",
13]
14
15split_srcs_and_hdrs(
16    name = "core_skslc",
17    files = SKSLC_FILES,
18)
19
20CORE_FILES = [
21    "ClipStack.cpp",
22    "ClipStack.h",
23    "Device.cpp",
24    "Device_drawTexture.cpp",
25    "Device.h",
26    "GrAppliedClip.h",
27    "GrAttachment.cpp",
28    "GrAttachment.h",
29    "GrAuditTrail.cpp",
30    "GrAuditTrail.h",
31    "GrAutoLocaleSetter.h",
32    "GrBackendSemaphore.cpp",
33    "GrBackendSemaphorePriv.h",
34    "GrBackendSurface.cpp",
35    "GrBackendSurfacePriv.h",
36    "GrBackendTextureImageGenerator.cpp",
37    "GrBackendTextureImageGenerator.h",
38    "GrBackendUtils.cpp",
39    "GrBackendUtils.h",
40    "GrBaseContextPriv.h",
41    "GrBlurUtils.cpp",
42    "GrBlurUtils.h",
43    "GrBuffer.h",
44    "GrBufferAllocPool.cpp",
45    "GrBufferAllocPool.h",
46    "GrBufferTransferRenderTask.cpp",
47    "GrBufferTransferRenderTask.h",
48    "GrBufferUpdateRenderTask.cpp",
49    "GrBufferUpdateRenderTask.h",
50    "GrCaps.cpp",
51    "GrCaps.h",
52    "GrCanvas.cpp",
53    "GrCanvas.h",
54    "GrClientMappedBufferManager.cpp",
55    "GrClientMappedBufferManager.h",
56    "GrClip.h",
57    "GrColor.h",
58    "GrColorInfo.cpp",
59    "GrColorInfo.h",
60    "GrColorSpaceXform.cpp",
61    "GrColorSpaceXform.h",
62    "GrContextThreadSafeProxy.cpp",
63    "GrContextThreadSafeProxyPriv.h",
64    "GrContext_Base.cpp",
65    "GrCopyRenderTask.cpp",
66    "GrCopyRenderTask.h",
67    "GrCpuBuffer.h",
68    "GrDDLContext.cpp",
69    "GrDDLTask.cpp",
70    "GrDDLTask.h",
71    "GrDataUtils.cpp",
72    "GrDataUtils.h",
73    "GrDefaultGeoProcFactory.cpp",
74    "GrDefaultGeoProcFactory.h",
75    "GrDeferredProxyUploader.h",
76    "GrDeferredUpload.h",
77    "GrDeferredDisplayList.cpp",
78    "GrDeferredDisplayListPriv.h",
79    "GrDeferredDisplayListRecorder.cpp",
80    "GrDirectContext.cpp",
81    "GrDirectContextPriv.cpp",
82    "GrDirectContextPriv.h",
83    "GrDistanceFieldGenFromVector.cpp",
84    "GrDistanceFieldGenFromVector.h",
85    "GrDrawIndirectCommand.h",
86    "GrDrawOpAtlas.cpp",
87    "GrDrawOpAtlas.h",
88    "GrDrawOpTest.cpp",
89    "GrDrawOpTest.h",
90    "GrDrawingManager.cpp",
91    "GrDrawingManager.h",
92    "GrDriverBugWorkarounds.cpp",
93    "GrDstProxyView.h",
94    "GrDynamicAtlas.cpp",
95    "GrDynamicAtlas.h",
96    "GrEagerVertexAllocator.cpp",
97    "GrEagerVertexAllocator.h",
98    "GrFPArgs.h",
99    "GrFixedClip.cpp",
100    "GrFixedClip.h",
101    "GrFragmentProcessor.cpp",
102    "GrFragmentProcessor.h",
103    "GrFragmentProcessors.cpp",
104    "GrFragmentProcessors.h",
105    "GrGeometryProcessor.cpp",
106    "GrGeometryProcessor.h",
107    "GrGpu.cpp",
108    "GrGpu.h",
109    "GrGpuBuffer.cpp",
110    "GrGpuBuffer.h",
111    "GrGpuResource.cpp",
112    "GrGpuResource.h",
113    "GrGpuResourceCacheAccess.h",
114    "GrGpuResourcePriv.h",
115    "GrHashMapWithCache.h",
116    "GrImageContext.cpp",
117    "GrImageContextPriv.h",
118    "GrImageInfo.cpp",
119    "GrImageInfo.h",
120    "GrManagedResource.cpp",
121    "GrManagedResource.h",
122    "GrMeshBuffers.cpp",
123    "GrMeshBuffers.h",
124    "GrMeshDrawTarget.cpp",
125    "GrMeshDrawTarget.h",
126    "GrNativeRect.h",
127    "GrNonAtomicRef.h",
128    "GrOnFlushResourceProvider.cpp",
129    "GrOnFlushResourceProvider.h",
130    "GrOpFlushState.cpp",
131    "GrOpFlushState.h",
132    "GrOpsRenderPass.cpp",
133    "GrOpsRenderPass.h",
134    "GrOpsTypes.h",
135    "GrPaint.cpp",
136    "GrPaint.h",
137    "GrPersistentCacheUtils.cpp",
138    "GrPersistentCacheUtils.h",
139    "GrPipeline.cpp",
140    "GrPipeline.h",
141    "GrPixmap.h",
142    "GrProcessor.cpp",
143    "GrProcessor.h",
144    "GrProcessorAnalysis.cpp",
145    "GrProcessorAnalysis.h",
146    "GrProcessorSet.cpp",
147    "GrProcessorSet.h",
148    "GrProcessorUnitTest.cpp",
149    "GrProcessorUnitTest.h",
150    "GrProgramDesc.cpp",
151    "GrProgramDesc.h",
152    "GrProgramInfo.cpp",
153    "GrProgramInfo.h",
154    "GrPromiseImageTexture.cpp",
155    "GrProxyProvider.cpp",
156    "GrProxyProvider.h",
157    "GrRecordingContext.cpp",
158    "GrRecordingContextPriv.cpp",
159    "GrRecordingContextPriv.h",
160    "GrRenderTarget.cpp",
161    "GrRenderTarget.h",
162    "GrRenderTargetProxy.cpp",
163    "GrRenderTargetProxy.h",
164    "GrRenderTask.cpp",
165    "GrRenderTask.h",
166    "GrRenderTaskCluster.cpp",
167    "GrRenderTaskCluster.h",
168    "GrResourceAllocator.cpp",
169    "GrResourceAllocator.h",
170    "GrResourceCache.cpp",
171    "GrResourceCache.h",
172    "GrResourceHandle.h",
173    "GrResourceProvider.cpp",
174    "GrResourceProvider.h",
175    "GrResourceProviderPriv.h",
176    "GrRingBuffer.cpp",
177    "GrRingBuffer.h",
178    "GrSPIRVUniformHandler.cpp",
179    "GrSPIRVUniformHandler.h",
180    "GrSPIRVVaryingHandler.cpp",
181    "GrSPIRVVaryingHandler.h",
182    "GrSWMaskHelper.cpp",
183    "GrSWMaskHelper.h",
184    "GrSamplerState.h",
185    "GrScissorState.h",
186    "GrSemaphore.h",
187    "GrShaderCaps.cpp",
188    "GrShaderCaps.h",
189    "GrShaderVar.cpp",
190    "GrShaderVar.h",
191    "GrSimpleMesh.h",
192    "GrStagingBufferManager.cpp",
193    "GrStagingBufferManager.h",
194    "GrStencilSettings.cpp",
195    "GrStencilSettings.h",
196    "GrStyle.cpp",
197    "GrStyle.h",
198    "GrSurface.cpp",
199    "GrSurface.h",
200    "GrSurfaceCharacterization.cpp",
201    "GrSurfaceProxy.cpp",
202    "GrSurfaceProxy.h",
203    "GrSurfaceProxyPriv.h",
204    "GrSurfaceProxyView.cpp",
205    "GrSurfaceProxyView.h",
206    "GrTestUtils.cpp",
207    "GrTestUtils.h",
208    "GrTTopoSort.h",
209    "GrTexture.cpp",
210    "GrTexture.h",
211    "GrTextureProxy.cpp",
212    "GrTextureProxy.h",
213    "GrTextureProxyCacheAccess.h",
214    "GrTextureProxyPriv.h",
215    "GrTextureRenderTargetProxy.cpp",
216    "GrTextureRenderTargetProxy.h",
217    "GrTextureResolveManager.h",
218    "GrTextureResolveRenderTask.cpp",
219    "GrTextureResolveRenderTask.h",
220    "GrThreadSafeCache.cpp",
221    "GrThreadSafeCache.h",
222    "GrThreadSafePipelineBuilder.cpp",
223    "GrThreadSafePipelineBuilder.h",
224    "GrTracing.h",
225    "GrTransferFromRenderTask.cpp",
226    "GrTransferFromRenderTask.h",
227    "GrUniformDataManager.cpp",
228    "GrUniformDataManager.h",
229    "GrUserStencilSettings.h",
230    "GrUtil.cpp",
231    "GrUtil.h",
232    "GrVertexChunkArray.cpp",
233    "GrVertexChunkArray.h",
234    "GrWaitRenderTask.cpp",
235    "GrWaitRenderTask.h",
236    "GrWindowRectangles.h",
237    "GrWindowRectsState.h",
238    "GrWritePixelsRenderTask.cpp",
239    "GrWritePixelsRenderTask.h",
240    "GrXferProcessor.cpp",
241    "GrXferProcessor.h",
242    "GrYUVABackendTextures.cpp",
243    "GrYUVATextureProxies.cpp",
244    "GrYUVATextureProxies.h",
245    "PathRenderer.cpp",
246    "PathRenderer.h",
247    "PathRendererChain.cpp",
248    "PathRendererChain.h",
249    "SkGr.cpp",
250    "SkGr.h",
251    "StencilClip.h",
252    "StencilMaskHelper.cpp",
253    "StencilMaskHelper.h",
254    "SurfaceContext.cpp",
255    "SurfaceContext.h",
256    "SurfaceDrawContext.cpp",
257    "SurfaceDrawContext.h",
258    "SurfaceFillContext.cpp",
259    "SurfaceFillContext.h",
260    "TestFormatColorTypeCombination.h",
261]
262
263split_srcs_and_hdrs(
264    name = "core",
265    files = CORE_FILES,
266)
267
268skia_filegroup(
269    name = "android_srcs",
270    srcs = [
271        "GrAHardwareBufferImageGenerator.cpp",
272        "GrAHardwareBufferImageGenerator.h",
273        "GrAHardwareBufferUtils.cpp",
274    ],
275)
276
277skia_cc_library(
278    name = "ganesh",
279    srcs = [
280        ":core_skslc_srcs",
281        ":core_srcs",
282        "//src/gpu/ganesh/effects:effects_srcs",
283        "//src/gpu/ganesh/geometry:geometry_srcs",
284        "//src/gpu/ganesh/glsl:glsl_srcs",
285        "//src/gpu/ganesh/gradients:gradient_srcs",
286        "//src/gpu/ganesh/image:image_srcs",
287        "//src/gpu/ganesh/ops:ops_srcs",
288        "//src/gpu/ganesh/surface:surface_srcs",
289        "//src/gpu/ganesh/tessellate:tessellate_srcs",
290        "//src/gpu/ganesh/text:srcs",
291        "//src/text/gpu:gpu_srcs",
292        # TODO(kjlubick, egdaniel) Remove this coupling
293        "//src/gpu/ganesh/mock:mock_srcs",
294    ],
295    hdrs = [
296        ":core_hdrs",
297        ":core_skslc_hdrs",
298        "//include/android:private_hdrs",
299        "//include/gpu:shared_gpu_hdrs",
300        "//include/gpu/ganesh:ganesh_hdrs",
301        "//include/private/gpu/ganesh:private_hdrs",
302        "//include/private/chromium:ganesh_private_hdrs",
303        "//src/gpu/ganesh/effects:effects_hdrs",
304        "//src/gpu/ganesh/geometry:geometry_hdrs",
305        "//src/gpu/ganesh/glsl:glsl_hdrs",
306        "//src/gpu/ganesh/gradients:gradient_hdrs",
307        "//src/gpu/ganesh/image:image_hdrs",
308        "//src/gpu/ganesh/ops:ops_hdrs",
309        "//src/gpu/ganesh/surface:surface_hdrs",
310        "//src/gpu/ganesh/tessellate:tessellate_hdrs",
311        "//src/gpu/ganesh/text:private_hdrs",
312        "//src/text/gpu:gpu_hdrs",
313        # TODO(kjlubick, egdaniel) Remove this coupling
314        "//src/gpu/ganesh/mock:mock_hdrs",
315        "//include/gpu/ganesh/mock:public_hdrs",
316    ],
317    defines = ["SK_GANESH"],
318    features = ["layering_check"],
319    local_defines = ["SK_USE_LEGACY_GANESH_TEXT_APIS"],
320    visibility = [
321        "//src/gpu/ganesh:__subpackages__",
322        "//tools/debugger:__pkg__",
323        "//tools/flags:__pkg__",
324    ],
325    deps = [
326        "//:core",
327        "//modules/skcms",
328        "//src/base",
329        "//src/core:core_priv",
330        "//src/gpu",
331        "//src/sksl/codegen:gpu",
332    ],
333)
334
335# TODO(lovisolo, kjlubick): Do this with a macro.
336skia_cc_library(
337    name = "ganesh_TEST_UTIL",
338    testonly = True,
339    srcs = [
340        ":core_skslc_srcs",
341        ":core_srcs",
342        "//src/gpu/ganesh/effects:effects_srcs",
343        "//src/gpu/ganesh/geometry:geometry_srcs",
344        "//src/gpu/ganesh/glsl:glsl_srcs",
345        "//src/gpu/ganesh/gradients:gradient_srcs",
346        "//src/gpu/ganesh/image:image_srcs",
347        "//src/gpu/ganesh/ops:ops_srcs",
348        "//src/gpu/ganesh/surface:surface_srcs",
349        "//src/gpu/ganesh/tessellate:tessellate_srcs",
350        "//src/gpu/ganesh/text:srcs",
351        "//src/text/gpu:gpu_srcs",
352        "//src/utils:shader_utils_srcs",
353        # TODO(kjlubick, egdaniel) Remove this coupling
354        "//src/gpu/ganesh/mock:mock_srcs",
355    ],
356    hdrs = [
357        ":core_hdrs",
358        ":core_skslc_hdrs",
359        "//include/android:private_hdrs",
360        "//include/gpu:shared_gpu_hdrs",
361        "//include/gpu/ganesh:ganesh_hdrs",
362        "//include/private/gpu/ganesh:private_hdrs",
363        "//include/private/chromium:ganesh_private_hdrs",
364        "//src/gpu/ganesh/effects:effects_hdrs",
365        "//src/gpu/ganesh/geometry:geometry_hdrs",
366        "//src/gpu/ganesh/glsl:glsl_hdrs",
367        "//src/gpu/ganesh/gradients:gradient_hdrs",
368        "//src/gpu/ganesh/image:image_hdrs",
369        "//src/gpu/ganesh/ops:ops_hdrs",
370        "//src/gpu/ganesh/surface:surface_hdrs",
371        "//src/gpu/ganesh/tessellate:tessellate_hdrs",
372        "//src/gpu/ganesh/text:private_hdrs",
373        "//src/text/gpu:gpu_hdrs",
374        "//src/utils:shader_utils_hdrs",
375        # TODO(kjlubick, egdaniel) Remove this coupling
376        "//src/gpu/ganesh/mock:mock_hdrs",
377        "//include/gpu/ganesh/mock:public_hdrs",
378    ],
379    defines = [
380        "GPU_TEST_UTILS",
381        "SK_GANESH",
382    ],
383    features = ["layering_check"],
384    local_defines = ["SK_USE_LEGACY_GANESH_TEXT_APIS"],
385    visibility = [
386        "//src/gpu/ganesh:__subpackages__",
387        "//tools:__subpackages__",
388    ],
389    deps = [
390        "//:core",
391        "//modules/skcms",
392        "//src/base",
393        "//src/core:core_priv",
394        "//src/gpu",
395        "//src/sksl/codegen:gpu",
396    ],
397)
398
399generate_cpp_files_for_headers(
400    name = "headers_to_compile",
401    headers = [
402        "GrAppliedClip.h",
403        "GrAutoLocaleSetter.h",
404        "GrBackendSemaphorePriv.h",
405        "GrBackendSurfacePriv.h",
406        "GrBaseContextPriv.h",
407        "GrClip.h",
408        "GrCpuBuffer.h",
409        "GrDeferredUpload.h",
410        "GrDrawIndirectCommand.h",
411        "GrDstProxyView.h",
412        "GrFPArgs.h",
413        "GrGpuResourceCacheAccess.h",
414        "GrGpuResourcePriv.h",
415        "GrNativeRect.h",
416        "GrNonAtomicRef.h",
417        "GrOpsTypes.h",
418        "GrPixmap.h",
419        "GrSimpleMesh.h",
420        "GrSurfaceProxyPriv.h",
421        "GrTextureProxyCacheAccess.h",
422        "GrTextureProxyPriv.h",
423        "GrTracing.h",
424        "GrTTopoSort.h",
425        "GrUserStencilSettings.h",
426        "GrWindowRectangles.h",
427        "GrWaitRenderTask.h",
428
429        # Trips an assertion in IWYU
430        # /tmp/iwyu/iwyu.cc:2003: Assertion failed:
431        #   TODO(csilvers): for objc and clang lang extensions
432        # "GrColor.h",
433    ],
434)
435