blob: 4d7c8dc133a6632b481ba385d7092da8c91df82b [file] [log] [blame]
Lloyd Pique70d91362018-10-18 16:02:55 -07001cc_defaults {
2 name: "libcompositionengine_defaults",
3 defaults: ["surfaceflinger_defaults"],
4 cflags: [
5 "-DLOG_TAG=\"CompositionEngine\"",
Lloyd Pique05b67b92019-09-25 13:16:44 -07006 "-DATRACE_TAG=ATRACE_TAG_GRAPHICS",
Lloyd Pique70d91362018-10-18 16:02:55 -07007 ],
Lloyd Pique441d5042018-10-18 16:49:51 -07008 shared_libs: [
9 "android.hardware.graphics.allocator@2.0",
10 "android.hardware.graphics.composer@2.1",
11 "android.hardware.graphics.composer@2.2",
12 "android.hardware.graphics.composer@2.3",
Dominik Laskowski25a4e7d2019-09-20 14:50:10 -070013 "android.hardware.graphics.composer@2.4",
Lloyd Pique441d5042018-10-18 16:49:51 -070014 "android.hardware.power@1.0",
15 "android.hardware.power@1.3",
16 "libbase",
17 "libcutils",
18 "libgui",
19 "liblayers_proto",
20 "liblog",
Lloyd Pique31cb2942018-10-19 17:23:03 -070021 "libnativewindow",
Alec Mourie4034bb2019-11-19 12:45:54 -080022 "libprotobuf-cpp-lite",
Dan Stoza269dc4d2021-01-15 15:07:43 -080023 "libSurfaceFlingerProp",
Yiwei Zhangd7927052020-01-13 16:05:01 -080024 "libtimestats",
Lloyd Pique441d5042018-10-18 16:49:51 -070025 "libui",
26 "libutils",
27 ],
28 static_libs: [
29 "libmath",
30 "librenderengine",
31 "libtrace_proto",
32 ],
33 header_libs: [
Lloyd Pique37c2c9b2018-12-04 17:25:10 -080034 "android.hardware.graphics.composer@2.1-command-buffer",
35 "android.hardware.graphics.composer@2.2-command-buffer",
36 "android.hardware.graphics.composer@2.3-command-buffer",
Peiyong Linafa0f572020-01-13 16:35:02 -080037 "android.hardware.graphics.composer@2.4-command-buffer",
Lloyd Pique441d5042018-10-18 16:49:51 -070038 "libsurfaceflinger_headers",
39 ],
Lloyd Pique70d91362018-10-18 16:02:55 -070040}
41
42cc_library {
43 name: "libcompositionengine",
44 defaults: ["libcompositionengine_defaults"],
45 srcs: [
Dan Stoza269dc4d2021-01-15 15:07:43 -080046 "src/planner/LayerState.cpp",
47 "src/planner/Planner.cpp",
Vishnu Nair9b079a22020-01-21 14:36:08 -080048 "src/ClientCompositionRequestCache.cpp",
Lloyd Pique70d91362018-10-18 16:02:55 -070049 "src/CompositionEngine.cpp",
Lloyd Pique45a165a2018-10-19 11:54:47 -070050 "src/Display.cpp",
Lloyd Pique3d0c02e2018-10-19 18:38:12 -070051 "src/DisplayColorProfile.cpp",
Lloyd Pique542307f2018-10-19 13:24:08 -070052 "src/DisplaySurface.cpp",
Lloyd Pique32cbe282018-10-19 13:09:22 -070053 "src/DumpHelpers.cpp",
Lloyd Pique76ed7032018-12-04 17:24:28 -080054 "src/HwcBufferCache.cpp",
Lloyd Pique9755fb72019-03-26 14:44:40 -070055 "src/LayerFECompositionState.cpp",
Lloyd Pique32cbe282018-10-19 13:09:22 -070056 "src/Output.cpp",
57 "src/OutputCompositionState.cpp",
Lloyd Piquecc01a452018-12-04 17:24:00 -080058 "src/OutputLayer.cpp",
Lloyd Pique37c2c9b2018-12-04 17:25:10 -080059 "src/OutputLayerCompositionState.cpp",
Lloyd Pique31cb2942018-10-19 17:23:03 -070060 "src/RenderSurface.cpp",
Lloyd Pique70d91362018-10-18 16:02:55 -070061 ],
62 local_include_dirs: ["include"],
63 export_include_dirs: ["include"],
64}
65
66cc_library {
67 name: "libcompositionengine_mocks",
68 defaults: ["libcompositionengine_defaults"],
69 srcs: [
70 "mock/CompositionEngine.cpp",
Lloyd Pique45a165a2018-10-19 11:54:47 -070071 "mock/Display.cpp",
Lloyd Pique3d0c02e2018-10-19 18:38:12 -070072 "mock/DisplayColorProfile.cpp",
Lloyd Pique542307f2018-10-19 13:24:08 -070073 "mock/DisplaySurface.cpp",
Lloyd Piquefeb73d72018-12-04 17:23:44 -080074 "mock/LayerFE.cpp",
chaviw8beb4142019-04-11 13:09:05 -070075 "mock/NativeWindow.cpp",
Lloyd Pique32cbe282018-10-19 13:09:22 -070076 "mock/Output.cpp",
Lloyd Piquecc01a452018-12-04 17:24:00 -080077 "mock/OutputLayer.cpp",
Lloyd Pique31cb2942018-10-19 17:23:03 -070078 "mock/RenderSurface.cpp",
Lloyd Pique70d91362018-10-18 16:02:55 -070079 ],
80 static_libs: [
81 "libgtest",
82 "libgmock",
83 "libcompositionengine",
84 ],
85 local_include_dirs: ["include"],
86 export_include_dirs: ["include"],
87}
88
89cc_test {
90 name: "libcompositionengine_test",
91 test_suites: ["device-tests"],
92 defaults: ["libcompositionengine_defaults"],
93 srcs: [
94 "tests/CompositionEngineTest.cpp",
Lloyd Pique3d0c02e2018-10-19 18:38:12 -070095 "tests/DisplayColorProfileTest.cpp",
Lloyd Pique45a165a2018-10-19 11:54:47 -070096 "tests/DisplayTest.cpp",
Lloyd Pique76ed7032018-12-04 17:24:28 -080097 "tests/HwcBufferCacheTest.cpp",
Lloyd Pique35d58242018-12-18 16:33:25 -080098 "tests/MockHWC2.cpp",
Lloyd Pique441d5042018-10-18 16:49:51 -070099 "tests/MockHWComposer.cpp",
Lloyd Pique688abd42019-02-15 15:42:24 -0800100 "tests/MockPowerAdvisor.cpp",
Lloyd Piquecc01a452018-12-04 17:24:00 -0800101 "tests/OutputLayerTest.cpp",
Marin Shalamanov68933fb2020-09-10 17:58:12 +0200102 "tests/OutputTest.cpp",
103 "tests/ProjectionSpaceTest.cpp",
Lloyd Pique31cb2942018-10-19 17:23:03 -0700104 "tests/RenderSurfaceTest.cpp",
Lloyd Pique70d91362018-10-18 16:02:55 -0700105 ],
106 static_libs: [
107 "libcompositionengine",
108 "libcompositionengine_mocks",
Lloyd Piqueaad4ebf2019-10-03 17:58:30 -0700109 "libgui_mocks",
Lloyd Piqueb97e04f2018-10-18 17:07:05 -0700110 "librenderengine_mocks",
Lloyd Pique70d91362018-10-18 16:02:55 -0700111 "libgmock",
112 "libgtest",
113 ],
114 sanitize: {
115 // By using the address sanitizer, we not only uncover any issues
116 // with the test, but also any issues with the code under test.
117 //
118 // Note: If you get an runtime link error like:
119 //
120 // CANNOT LINK EXECUTABLE "/data/local/tmp/libcompositionengine_test": library "libclang_rt.asan-aarch64-android.so" not found
121 //
122 // it is because the address sanitizer shared objects are not installed
123 // by default in the system image.
124 //
125 // You can either "make dist tests" before flashing, or set this
126 // option to false temporarily.
Stephen Hinesd3e75892020-08-19 08:52:56 -0700127 address: true,
Lloyd Pique70d91362018-10-18 16:02:55 -0700128 },
129}