blob: 702bd332b6db22525abf63467f5231b0574ea92a [file] [log] [blame]
Bob Badour3306e492021-02-25 15:35:37 -08001package {
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}
9
Lloyd Pique70d91362018-10-18 16:02:55 -070010cc_defaults {
11 name: "libcompositionengine_defaults",
Sally Qi6920a2f2022-08-26 10:40:05 -070012 defaults: [
13 "android.hardware.graphics.composer3-ndk_shared",
Nolan Scobie8ef7e142022-10-14 10:52:43 -040014 "librenderengine_deps",
Devin Moorea1889802023-05-22 21:29:09 +000015 "libtimestats_deps",
Sally Qi6920a2f2022-08-26 10:40:05 -070016 "surfaceflinger_defaults",
17 ],
Lloyd Pique70d91362018-10-18 16:02:55 -070018 cflags: [
19 "-DLOG_TAG=\"CompositionEngine\"",
Lloyd Pique05b67b92019-09-25 13:16:44 -070020 "-DATRACE_TAG=ATRACE_TAG_GRAPHICS",
Lloyd Pique70d91362018-10-18 16:02:55 -070021 ],
Lloyd Pique441d5042018-10-18 16:49:51 -070022 shared_libs: [
23 "android.hardware.graphics.allocator@2.0",
24 "android.hardware.graphics.composer@2.1",
25 "android.hardware.graphics.composer@2.2",
26 "android.hardware.graphics.composer@2.3",
Dominik Laskowski25a4e7d2019-09-20 14:50:10 -070027 "android.hardware.graphics.composer@2.4",
Lloyd Pique441d5042018-10-18 16:49:51 -070028 "android.hardware.power@1.0",
29 "android.hardware.power@1.3",
Matt Buckleyb10b7062022-11-01 21:01:06 +000030 "android.hardware.power-V4-cpp",
Lloyd Pique441d5042018-10-18 16:49:51 -070031 "libbase",
32 "libcutils",
33 "libgui",
Lloyd Pique441d5042018-10-18 16:49:51 -070034 "liblog",
Lloyd Pique31cb2942018-10-19 17:23:03 -070035 "libnativewindow",
Alec Mourie4034bb2019-11-19 12:45:54 -080036 "libprotobuf-cpp-lite",
Dan Stoza269dc4d2021-01-15 15:07:43 -080037 "libSurfaceFlingerProp",
Lloyd Pique441d5042018-10-18 16:49:51 -070038 "libui",
39 "libutils",
40 ],
41 static_libs: [
Devin Moorea1889802023-05-22 21:29:09 +000042 "liblayers_proto",
Lloyd Pique441d5042018-10-18 16:49:51 -070043 "libmath",
44 "librenderengine",
Devin Moorea1889802023-05-22 21:29:09 +000045 "libtimestats",
Alec Mouri465b2962021-10-08 16:22:21 -070046 "libtonemap",
Ady Abrahame7385f72021-09-05 00:54:25 -070047 "libaidlcommonsupport",
Vishnu Naira3140382022-02-24 14:07:11 -080048 "libprocessgroup",
49 "libcgrouprc",
50 "libjsoncpp",
51 "libcgrouprc_format",
Lloyd Pique441d5042018-10-18 16:49:51 -070052 ],
53 header_libs: [
Lloyd Pique37c2c9b2018-12-04 17:25:10 -080054 "android.hardware.graphics.composer@2.1-command-buffer",
55 "android.hardware.graphics.composer@2.2-command-buffer",
56 "android.hardware.graphics.composer@2.3-command-buffer",
Peiyong Linafa0f572020-01-13 16:35:02 -080057 "android.hardware.graphics.composer@2.4-command-buffer",
Ady Abrahame7385f72021-09-05 00:54:25 -070058 "android.hardware.graphics.composer3-command-buffer",
Lloyd Pique441d5042018-10-18 16:49:51 -070059 "libsurfaceflinger_headers",
60 ],
Lloyd Pique70d91362018-10-18 16:02:55 -070061}
62
63cc_library {
64 name: "libcompositionengine",
65 defaults: ["libcompositionengine_defaults"],
66 srcs: [
Dan Stoza6166c312021-01-15 16:34:05 -080067 "src/planner/CachedSet.cpp",
68 "src/planner/Flattener.cpp",
Dan Stoza269dc4d2021-01-15 15:07:43 -080069 "src/planner/LayerState.cpp",
70 "src/planner/Planner.cpp",
Dan Stoza47437bb2021-01-15 16:21:07 -080071 "src/planner/Predictor.cpp",
Alec Mouridf6201b2021-06-01 16:20:42 -070072 "src/planner/TexturePool.cpp",
Vishnu Nair9b079a22020-01-21 14:36:08 -080073 "src/ClientCompositionRequestCache.cpp",
Lloyd Pique70d91362018-10-18 16:02:55 -070074 "src/CompositionEngine.cpp",
Lloyd Pique45a165a2018-10-19 11:54:47 -070075 "src/Display.cpp",
Lloyd Pique3d0c02e2018-10-19 18:38:12 -070076 "src/DisplayColorProfile.cpp",
Lloyd Pique542307f2018-10-19 13:24:08 -070077 "src/DisplaySurface.cpp",
Lloyd Pique32cbe282018-10-19 13:09:22 -070078 "src/DumpHelpers.cpp",
Vishnu Naira3140382022-02-24 14:07:11 -080079 "src/HwcAsyncWorker.cpp",
Lloyd Pique76ed7032018-12-04 17:24:28 -080080 "src/HwcBufferCache.cpp",
Lloyd Pique9755fb72019-03-26 14:44:40 -070081 "src/LayerFECompositionState.cpp",
Lloyd Pique32cbe282018-10-19 13:09:22 -070082 "src/Output.cpp",
83 "src/OutputCompositionState.cpp",
Lloyd Piquecc01a452018-12-04 17:24:00 -080084 "src/OutputLayer.cpp",
Lloyd Pique37c2c9b2018-12-04 17:25:10 -080085 "src/OutputLayerCompositionState.cpp",
Lloyd Pique31cb2942018-10-19 17:23:03 -070086 "src/RenderSurface.cpp",
Lloyd Pique70d91362018-10-18 16:02:55 -070087 ],
88 local_include_dirs: ["include"],
89 export_include_dirs: ["include"],
90}
91
92cc_library {
93 name: "libcompositionengine_mocks",
94 defaults: ["libcompositionengine_defaults"],
95 srcs: [
96 "mock/CompositionEngine.cpp",
Lloyd Pique45a165a2018-10-19 11:54:47 -070097 "mock/Display.cpp",
Lloyd Pique3d0c02e2018-10-19 18:38:12 -070098 "mock/DisplayColorProfile.cpp",
Lloyd Pique542307f2018-10-19 13:24:08 -070099 "mock/DisplaySurface.cpp",
Lloyd Piquefeb73d72018-12-04 17:23:44 -0800100 "mock/LayerFE.cpp",
chaviw8beb4142019-04-11 13:09:05 -0700101 "mock/NativeWindow.cpp",
Lloyd Pique32cbe282018-10-19 13:09:22 -0700102 "mock/Output.cpp",
Lloyd Piquecc01a452018-12-04 17:24:00 -0800103 "mock/OutputLayer.cpp",
Lloyd Pique31cb2942018-10-19 17:23:03 -0700104 "mock/RenderSurface.cpp",
Lloyd Pique70d91362018-10-18 16:02:55 -0700105 ],
106 static_libs: [
107 "libgtest",
108 "libgmock",
109 "libcompositionengine",
110 ],
111 local_include_dirs: ["include"],
112 export_include_dirs: ["include"],
113}
114
115cc_test {
116 name: "libcompositionengine_test",
117 test_suites: ["device-tests"],
118 defaults: ["libcompositionengine_defaults"],
119 srcs: [
Ady Abrahamcf027d62021-03-02 18:48:57 -0800120 "tests/planner/CachedSetTest.cpp",
Ady Abrahamb7db4102021-03-04 12:19:26 -0800121 "tests/planner/FlattenerTest.cpp",
Alec Mourieb920d92021-03-01 17:48:30 -0800122 "tests/planner/LayerStateTest.cpp",
Alec Mourif6a684b2021-03-09 13:00:18 -0800123 "tests/planner/PredictorTest.cpp",
Alec Mouridf6201b2021-06-01 16:20:42 -0700124 "tests/planner/TexturePoolTest.cpp",
Lloyd Pique70d91362018-10-18 16:02:55 -0700125 "tests/CompositionEngineTest.cpp",
Lloyd Pique3d0c02e2018-10-19 18:38:12 -0700126 "tests/DisplayColorProfileTest.cpp",
Lloyd Pique45a165a2018-10-19 11:54:47 -0700127 "tests/DisplayTest.cpp",
Lloyd Pique76ed7032018-12-04 17:24:28 -0800128 "tests/HwcBufferCacheTest.cpp",
Lloyd Pique35d58242018-12-18 16:33:25 -0800129 "tests/MockHWC2.cpp",
Lloyd Pique441d5042018-10-18 16:49:51 -0700130 "tests/MockHWComposer.cpp",
Lloyd Pique688abd42019-02-15 15:42:24 -0800131 "tests/MockPowerAdvisor.cpp",
Lloyd Piquecc01a452018-12-04 17:24:00 -0800132 "tests/OutputLayerTest.cpp",
Marin Shalamanov68933fb2020-09-10 17:58:12 +0200133 "tests/OutputTest.cpp",
134 "tests/ProjectionSpaceTest.cpp",
Lloyd Pique31cb2942018-10-19 17:23:03 -0700135 "tests/RenderSurfaceTest.cpp",
Lloyd Pique70d91362018-10-18 16:02:55 -0700136 ],
137 static_libs: [
138 "libcompositionengine",
139 "libcompositionengine_mocks",
Lloyd Piqueaad4ebf2019-10-03 17:58:30 -0700140 "libgui_mocks",
Lloyd Piqueb97e04f2018-10-18 17:07:05 -0700141 "librenderengine_mocks",
Lloyd Pique70d91362018-10-18 16:02:55 -0700142 "libgmock",
143 "libgtest",
144 ],
Ian Elliott1f0911e2022-09-09 16:31:47 -0600145 // For some reason, libvulkan isn't picked up from librenderengine
146 // Probably ASAN related?
147 shared_libs: [
148 "libvulkan",
149 ],
Lloyd Pique70d91362018-10-18 16:02:55 -0700150 sanitize: {
151 // By using the address sanitizer, we not only uncover any issues
152 // with the test, but also any issues with the code under test.
153 //
154 // Note: If you get an runtime link error like:
155 //
156 // CANNOT LINK EXECUTABLE "/data/local/tmp/libcompositionengine_test": library "libclang_rt.asan-aarch64-android.so" not found
157 //
158 // it is because the address sanitizer shared objects are not installed
159 // by default in the system image.
160 //
161 // You can either "make dist tests" before flashing, or set this
162 // option to false temporarily.
Stephen Hinesd3e75892020-08-19 08:52:56 -0700163 address: true,
Lloyd Pique70d91362018-10-18 16:02:55 -0700164 },
165}