1package {
2    // See: http://go/android-license-faq
3    // A large-scale-change added 'default_applicable_licenses' to import
4    // all of the 'license_kinds' from "frameworks_native_license"
5    // to get the below license kinds:
6    //   SPDX-license-identifier-Apache-2.0
7    default_applicable_licenses: ["frameworks_native_license"],
8    default_team: "trendy_team_android_core_graphics_stack",
9}
10
11cc_defaults {
12    name: "renderengine_defaults",
13    cflags: [
14        "-DLOG_TAG=\"RenderEngine\"",
15        "-Wall",
16        "-Werror",
17        "-Wthread-safety",
18        "-Wunused",
19        "-Wunreachable-code",
20    ],
21}
22
23cc_defaults {
24    name: "librenderengine_defaults",
25    defaults: [
26        "android.hardware.graphics.composer3-ndk_shared",
27        "renderengine_defaults",
28    ],
29    cflags: [
30        "-DGL_GLEXT_PROTOTYPES",
31        "-DEGL_EGLEXT_PROTOTYPES",
32    ],
33    shared_libs: [
34        "libbase",
35        "libcutils",
36        "libEGL",
37        "libGLESv1_CM",
38        "libGLESv2",
39        "libgui",
40        "liblog",
41        "libnativewindow",
42        "libprocessgroup",
43        "libsync",
44        "libui",
45        "libutils",
46        "libvulkan",
47    ],
48
49    static_libs: [
50        "libshaders",
51        "libtonemap",
52        "libsurfaceflinger_common",
53        "libsurfaceflingerflags",
54    ],
55    local_include_dirs: ["include"],
56    export_include_dirs: ["include"],
57}
58
59// Needed by FlagManager to access a #define.
60cc_library_static {
61    name: "librenderengine_includes",
62    local_include_dirs: ["include"],
63    export_include_dirs: ["include"],
64}
65
66filegroup {
67    name: "librenderengine_sources",
68    srcs: [
69        "ExternalTexture.cpp",
70        "RenderEngine.cpp",
71    ],
72}
73
74filegroup {
75    name: "librenderengine_threaded_sources",
76    srcs: [
77        "threaded/RenderEngineThreaded.cpp",
78    ],
79}
80
81filegroup {
82    name: "librenderengine_skia_sources",
83    srcs: [
84        "skia/AutoBackendTexture.cpp",
85        "skia/Cache.cpp",
86        "skia/ColorSpaces.cpp",
87        "skia/GaneshVkRenderEngine.cpp",
88        "skia/GraphiteVkRenderEngine.cpp",
89        "skia/GLExtensions.cpp",
90        "skia/SkiaRenderEngine.cpp",
91        "skia/SkiaGLRenderEngine.cpp",
92        "skia/SkiaVkRenderEngine.cpp",
93        "skia/VulkanInterface.cpp",
94        "skia/compat/GaneshBackendTexture.cpp",
95        "skia/compat/GaneshGpuContext.cpp",
96        "skia/compat/GraphiteBackendTexture.cpp",
97        "skia/compat/GraphiteGpuContext.cpp",
98        "skia/debug/CaptureTimer.cpp",
99        "skia/debug/CommonPool.cpp",
100        "skia/debug/SkiaCapture.cpp",
101        "skia/debug/SkiaMemoryReporter.cpp",
102        "skia/filters/BlurFilter.cpp",
103        "skia/filters/GaussianBlurFilter.cpp",
104        "skia/filters/KawaseBlurFilter.cpp",
105        "skia/filters/LinearEffect.cpp",
106        "skia/filters/MouriMap.cpp",
107        "skia/filters/StretchShaderFactory.cpp",
108    ],
109}
110
111// Used to consolidate and simplify pulling Skia & Skia deps into targets that depend on
112// librenderengine. This allows shared deps to be deduplicated (e.g. Perfetto), which doesn't seem
113// possible if libskia_renderengine is just pulled into librenderengine via whole_static_libs.
114cc_defaults {
115    name: "librenderengine_deps",
116    defaults: ["skia_renderengine_deps"],
117    static_libs: ["libskia_renderengine"],
118}
119
120// Note: if compilation fails when adding librenderengine as a dependency, try adding
121// librenderengine_deps to the defaults field of your dependent target.
122cc_library_static {
123    name: "librenderengine",
124    defaults: [
125        "librenderengine_defaults",
126        "librenderengine_deps",
127    ],
128    double_loadable: true,
129    cflags: [
130        "-fvisibility=hidden",
131        "-Werror=format",
132        "-Wno-unused-parameter",
133    ],
134    srcs: [
135        ":librenderengine_sources",
136        ":librenderengine_threaded_sources",
137        ":librenderengine_skia_sources",
138    ],
139    header_libs: [
140        "libtonemap_headers",
141    ],
142    include_dirs: [
143        "external/skia/src/gpu",
144    ],
145    lto: {
146        thin: true,
147    },
148}
149
150cc_library_static {
151    name: "librenderengine_mocks",
152    defaults: ["librenderengine_defaults"],
153    srcs: [
154        "mock/RenderEngine.cpp",
155    ],
156    static_libs: [
157        "libgtest",
158        "libgmock",
159    ],
160    local_include_dirs: ["include"],
161    export_include_dirs: ["include"],
162}
163