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} 9 10cc_defaults { 11 name: "libcompositionengine_defaults", 12 defaults: [ 13 "android.hardware.graphics.composer3-ndk_shared", 14 "librenderengine_deps", 15 "surfaceflinger_defaults", 16 ], 17 cflags: [ 18 "-DLOG_TAG=\"CompositionEngine\"", 19 "-DATRACE_TAG=ATRACE_TAG_GRAPHICS", 20 ], 21 shared_libs: [ 22 "android.hardware.graphics.allocator@2.0", 23 "android.hardware.graphics.composer@2.1", 24 "android.hardware.graphics.composer@2.2", 25 "android.hardware.graphics.composer@2.3", 26 "android.hardware.graphics.composer@2.4", 27 "android.hardware.power@1.0", 28 "android.hardware.power@1.3", 29 "android.hardware.power-V4-cpp", 30 "libbase", 31 "libcutils", 32 "libgui", 33 "liblayers_proto", 34 "liblog", 35 "libnativewindow", 36 "libprotobuf-cpp-lite", 37 "libSurfaceFlingerProp", 38 "libtimestats", 39 "libui", 40 "libutils", 41 ], 42 static_libs: [ 43 "libmath", 44 "librenderengine", 45 "libtonemap", 46 "libaidlcommonsupport", 47 "libprocessgroup", 48 "libcgrouprc", 49 "libjsoncpp", 50 "libcgrouprc_format", 51 ], 52 header_libs: [ 53 "android.hardware.graphics.composer@2.1-command-buffer", 54 "android.hardware.graphics.composer@2.2-command-buffer", 55 "android.hardware.graphics.composer@2.3-command-buffer", 56 "android.hardware.graphics.composer@2.4-command-buffer", 57 "android.hardware.graphics.composer3-command-buffer", 58 "libsurfaceflinger_headers", 59 ], 60} 61 62cc_library { 63 name: "libcompositionengine", 64 defaults: ["libcompositionengine_defaults"], 65 srcs: [ 66 "src/planner/CachedSet.cpp", 67 "src/planner/Flattener.cpp", 68 "src/planner/LayerState.cpp", 69 "src/planner/Planner.cpp", 70 "src/planner/Predictor.cpp", 71 "src/planner/TexturePool.cpp", 72 "src/ClientCompositionRequestCache.cpp", 73 "src/CompositionEngine.cpp", 74 "src/Display.cpp", 75 "src/DisplayColorProfile.cpp", 76 "src/DisplaySurface.cpp", 77 "src/DumpHelpers.cpp", 78 "src/HwcAsyncWorker.cpp", 79 "src/HwcBufferCache.cpp", 80 "src/LayerFECompositionState.cpp", 81 "src/Output.cpp", 82 "src/OutputCompositionState.cpp", 83 "src/OutputLayer.cpp", 84 "src/OutputLayerCompositionState.cpp", 85 "src/RenderSurface.cpp", 86 ], 87 local_include_dirs: ["include"], 88 export_include_dirs: ["include"], 89} 90 91cc_library { 92 name: "libcompositionengine_mocks", 93 defaults: ["libcompositionengine_defaults"], 94 srcs: [ 95 "mock/CompositionEngine.cpp", 96 "mock/Display.cpp", 97 "mock/DisplayColorProfile.cpp", 98 "mock/DisplaySurface.cpp", 99 "mock/LayerFE.cpp", 100 "mock/NativeWindow.cpp", 101 "mock/Output.cpp", 102 "mock/OutputLayer.cpp", 103 "mock/RenderSurface.cpp", 104 ], 105 static_libs: [ 106 "libgtest", 107 "libgmock", 108 "libcompositionengine", 109 ], 110 local_include_dirs: ["include"], 111 export_include_dirs: ["include"], 112} 113 114cc_test { 115 name: "libcompositionengine_test", 116 test_suites: ["device-tests"], 117 defaults: ["libcompositionengine_defaults"], 118 srcs: [ 119 "tests/planner/CachedSetTest.cpp", 120 "tests/planner/FlattenerTest.cpp", 121 "tests/planner/LayerStateTest.cpp", 122 "tests/planner/PredictorTest.cpp", 123 "tests/planner/TexturePoolTest.cpp", 124 "tests/CompositionEngineTest.cpp", 125 "tests/DisplayColorProfileTest.cpp", 126 "tests/DisplayTest.cpp", 127 "tests/HwcBufferCacheTest.cpp", 128 "tests/MockHWC2.cpp", 129 "tests/MockHWComposer.cpp", 130 "tests/MockPowerAdvisor.cpp", 131 "tests/OutputLayerTest.cpp", 132 "tests/OutputTest.cpp", 133 "tests/ProjectionSpaceTest.cpp", 134 "tests/RenderSurfaceTest.cpp", 135 ], 136 static_libs: [ 137 "libcompositionengine", 138 "libcompositionengine_mocks", 139 "libgui_mocks", 140 "librenderengine_mocks", 141 "libgmock", 142 "libgtest", 143 ], 144 // For some reason, libvulkan isn't picked up from librenderengine 145 // Probably ASAN related? 146 shared_libs: [ 147 "libvulkan", 148 ], 149 sanitize: { 150 // By using the address sanitizer, we not only uncover any issues 151 // with the test, but also any issues with the code under test. 152 // 153 // Note: If you get an runtime link error like: 154 // 155 // CANNOT LINK EXECUTABLE "/data/local/tmp/libcompositionengine_test": library "libclang_rt.asan-aarch64-android.so" not found 156 // 157 // it is because the address sanitizer shared objects are not installed 158 // by default in the system image. 159 // 160 // You can either "make dist tests" before flashing, or set this 161 // option to false temporarily. 162 address: true, 163 }, 164} 165