blob: e2f232429b6a747f67488dffc177d27b1df370f7 [file] [log] [blame]
Bob Badour2e671852021-02-12 21:26:48 -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",
12 defaults: ["surfaceflinger_defaults"],
13 cflags: [
14 "-DLOG_TAG=\"CompositionEngine\"",
Lloyd Pique05b67b92019-09-25 13:16:44 -070015 "-DATRACE_TAG=ATRACE_TAG_GRAPHICS",
Lloyd Pique70d91362018-10-18 16:02:55 -070016 ],
Lloyd Pique441d5042018-10-18 16:49:51 -070017 shared_libs: [
18 "android.hardware.graphics.allocator@2.0",
19 "android.hardware.graphics.composer@2.1",
20 "android.hardware.graphics.composer@2.2",
21 "android.hardware.graphics.composer@2.3",
Dominik Laskowski25a4e7d2019-09-20 14:50:10 -070022 "android.hardware.graphics.composer@2.4",
Lloyd Pique441d5042018-10-18 16:49:51 -070023 "android.hardware.power@1.0",
24 "android.hardware.power@1.3",
25 "libbase",
26 "libcutils",
27 "libgui",
28 "liblayers_proto",
29 "liblog",
Lloyd Pique31cb2942018-10-19 17:23:03 -070030 "libnativewindow",
Alec Mourie4034bb2019-11-19 12:45:54 -080031 "libprotobuf-cpp-lite",
Dan Stoza269dc4d2021-01-15 15:07:43 -080032 "libSurfaceFlingerProp",
Yiwei Zhangd7927052020-01-13 16:05:01 -080033 "libtimestats",
Lloyd Pique441d5042018-10-18 16:49:51 -070034 "libui",
35 "libutils",
36 ],
37 static_libs: [
38 "libmath",
39 "librenderengine",
40 "libtrace_proto",
41 ],
42 header_libs: [
Lloyd Pique37c2c9b2018-12-04 17:25:10 -080043 "android.hardware.graphics.composer@2.1-command-buffer",
44 "android.hardware.graphics.composer@2.2-command-buffer",
45 "android.hardware.graphics.composer@2.3-command-buffer",
Peiyong Linafa0f572020-01-13 16:35:02 -080046 "android.hardware.graphics.composer@2.4-command-buffer",
Lloyd Pique441d5042018-10-18 16:49:51 -070047 "libsurfaceflinger_headers",
48 ],
Lloyd Pique70d91362018-10-18 16:02:55 -070049}
50
51cc_library {
52 name: "libcompositionengine",
53 defaults: ["libcompositionengine_defaults"],
54 srcs: [
Dan Stoza269dc4d2021-01-15 15:07:43 -080055 "src/planner/LayerState.cpp",
56 "src/planner/Planner.cpp",
Dan Stoza47437bb2021-01-15 16:21:07 -080057 "src/planner/Predictor.cpp",
Vishnu Nair9b079a22020-01-21 14:36:08 -080058 "src/ClientCompositionRequestCache.cpp",
Lloyd Pique70d91362018-10-18 16:02:55 -070059 "src/CompositionEngine.cpp",
Lloyd Pique45a165a2018-10-19 11:54:47 -070060 "src/Display.cpp",
Lloyd Pique3d0c02e2018-10-19 18:38:12 -070061 "src/DisplayColorProfile.cpp",
Lloyd Pique542307f2018-10-19 13:24:08 -070062 "src/DisplaySurface.cpp",
Lloyd Pique32cbe282018-10-19 13:09:22 -070063 "src/DumpHelpers.cpp",
Lloyd Pique76ed7032018-12-04 17:24:28 -080064 "src/HwcBufferCache.cpp",
Lloyd Pique9755fb72019-03-26 14:44:40 -070065 "src/LayerFECompositionState.cpp",
Lloyd Pique32cbe282018-10-19 13:09:22 -070066 "src/Output.cpp",
67 "src/OutputCompositionState.cpp",
Lloyd Piquecc01a452018-12-04 17:24:00 -080068 "src/OutputLayer.cpp",
Lloyd Pique37c2c9b2018-12-04 17:25:10 -080069 "src/OutputLayerCompositionState.cpp",
Lloyd Pique31cb2942018-10-19 17:23:03 -070070 "src/RenderSurface.cpp",
Lloyd Pique70d91362018-10-18 16:02:55 -070071 ],
72 local_include_dirs: ["include"],
73 export_include_dirs: ["include"],
74}
75
76cc_library {
77 name: "libcompositionengine_mocks",
78 defaults: ["libcompositionengine_defaults"],
79 srcs: [
80 "mock/CompositionEngine.cpp",
Lloyd Pique45a165a2018-10-19 11:54:47 -070081 "mock/Display.cpp",
Lloyd Pique3d0c02e2018-10-19 18:38:12 -070082 "mock/DisplayColorProfile.cpp",
Lloyd Pique542307f2018-10-19 13:24:08 -070083 "mock/DisplaySurface.cpp",
Lloyd Piquefeb73d72018-12-04 17:23:44 -080084 "mock/LayerFE.cpp",
chaviw8beb4142019-04-11 13:09:05 -070085 "mock/NativeWindow.cpp",
Lloyd Pique32cbe282018-10-19 13:09:22 -070086 "mock/Output.cpp",
Lloyd Piquecc01a452018-12-04 17:24:00 -080087 "mock/OutputLayer.cpp",
Lloyd Pique31cb2942018-10-19 17:23:03 -070088 "mock/RenderSurface.cpp",
Lloyd Pique70d91362018-10-18 16:02:55 -070089 ],
90 static_libs: [
91 "libgtest",
92 "libgmock",
93 "libcompositionengine",
94 ],
95 local_include_dirs: ["include"],
96 export_include_dirs: ["include"],
97}
98
99cc_test {
100 name: "libcompositionengine_test",
101 test_suites: ["device-tests"],
102 defaults: ["libcompositionengine_defaults"],
103 srcs: [
104 "tests/CompositionEngineTest.cpp",
Lloyd Pique3d0c02e2018-10-19 18:38:12 -0700105 "tests/DisplayColorProfileTest.cpp",
Lloyd Pique45a165a2018-10-19 11:54:47 -0700106 "tests/DisplayTest.cpp",
Lloyd Pique76ed7032018-12-04 17:24:28 -0800107 "tests/HwcBufferCacheTest.cpp",
Lloyd Pique35d58242018-12-18 16:33:25 -0800108 "tests/MockHWC2.cpp",
Lloyd Pique441d5042018-10-18 16:49:51 -0700109 "tests/MockHWComposer.cpp",
Lloyd Pique688abd42019-02-15 15:42:24 -0800110 "tests/MockPowerAdvisor.cpp",
Lloyd Piquecc01a452018-12-04 17:24:00 -0800111 "tests/OutputLayerTest.cpp",
Marin Shalamanov68933fb2020-09-10 17:58:12 +0200112 "tests/OutputTest.cpp",
113 "tests/ProjectionSpaceTest.cpp",
Lloyd Pique31cb2942018-10-19 17:23:03 -0700114 "tests/RenderSurfaceTest.cpp",
Lloyd Pique70d91362018-10-18 16:02:55 -0700115 ],
116 static_libs: [
117 "libcompositionengine",
118 "libcompositionengine_mocks",
Lloyd Piqueaad4ebf2019-10-03 17:58:30 -0700119 "libgui_mocks",
Lloyd Piqueb97e04f2018-10-18 17:07:05 -0700120 "librenderengine_mocks",
Lloyd Pique70d91362018-10-18 16:02:55 -0700121 "libgmock",
122 "libgtest",
123 ],
124 sanitize: {
125 // By using the address sanitizer, we not only uncover any issues
126 // with the test, but also any issues with the code under test.
127 //
128 // Note: If you get an runtime link error like:
129 //
130 // CANNOT LINK EXECUTABLE "/data/local/tmp/libcompositionengine_test": library "libclang_rt.asan-aarch64-android.so" not found
131 //
132 // it is because the address sanitizer shared objects are not installed
133 // by default in the system image.
134 //
135 // You can either "make dist tests" before flashing, or set this
136 // option to false temporarily.
Stephen Hinesd3e75892020-08-19 08:52:56 -0700137 address: true,
Lloyd Pique70d91362018-10-18 16:02:55 -0700138 },
139}