1 cc_defaults { 2 name: "libcompositionengine_defaults", 3 defaults: ["surfaceflinger_defaults"], 4 cflags: [ 5 "-DLOG_TAG=\"CompositionEngine\"", 6 ], 7 shared_libs: [ 8 "android.frameworks.vr.composer (a] 1.0", 9 "android.hardware.graphics.allocator (a] 2.0", 10 "android.hardware.graphics.composer (a] 2.1", 11 "android.hardware.graphics.composer (a] 2.2", 12 "android.hardware.graphics.composer (a] 2.3", 13 "android.hardware.power (a] 1.0", 14 "android.hardware.power (a] 1.3", 15 "libbase", 16 "libcutils", 17 "libgui", 18 "liblayers_proto", 19 "liblog", 20 "libnativewindow", 21 "libsync", 22 "libtimestats_proto", 23 "libui", 24 "libutils", 25 ], 26 static_libs: [ 27 "libmath", 28 "librenderengine", 29 "libtrace_proto", 30 ], 31 header_libs: [ 32 "android.hardware.graphics.composer (a] 2.1-command-buffer", 33 "android.hardware.graphics.composer (a] 2.2-command-buffer", 34 "android.hardware.graphics.composer (a] 2.3-command-buffer", 35 "libsurfaceflinger_headers", 36 ], 37 } 38 39 cc_library { 40 name: "libcompositionengine", 41 defaults: ["libcompositionengine_defaults"], 42 srcs: [ 43 "src/CompositionEngine.cpp", 44 "src/Display.cpp", 45 "src/DisplayColorProfile.cpp", 46 "src/DisplaySurface.cpp", 47 "src/DumpHelpers.cpp", 48 "src/HwcBufferCache.cpp", 49 "src/Layer.cpp", 50 "src/LayerCompositionState.cpp", 51 "src/Output.cpp", 52 "src/OutputCompositionState.cpp", 53 "src/OutputLayer.cpp", 54 "src/OutputLayerCompositionState.cpp", 55 "src/RenderSurface.cpp", 56 ], 57 local_include_dirs: ["include"], 58 export_include_dirs: ["include"], 59 } 60 61 cc_library { 62 name: "libcompositionengine_mocks", 63 defaults: ["libcompositionengine_defaults"], 64 srcs: [ 65 "mock/CompositionEngine.cpp", 66 "mock/Display.cpp", 67 "mock/DisplayColorProfile.cpp", 68 "mock/DisplaySurface.cpp", 69 "mock/Layer.cpp", 70 "mock/LayerFE.cpp", 71 "mock/NativeWindow.cpp", 72 "mock/Output.cpp", 73 "mock/OutputLayer.cpp", 74 "mock/RenderSurface.cpp", 75 ], 76 static_libs: [ 77 "libgtest", 78 "libgmock", 79 "libcompositionengine", 80 ], 81 local_include_dirs: ["include"], 82 export_include_dirs: ["include"], 83 } 84 85 cc_test { 86 name: "libcompositionengine_test", 87 test_suites: ["device-tests"], 88 defaults: ["libcompositionengine_defaults"], 89 srcs: [ 90 "tests/CompositionEngineTest.cpp", 91 "tests/DisplayColorProfileTest.cpp", 92 "tests/DisplayTest.cpp", 93 "tests/HwcBufferCacheTest.cpp", 94 "tests/LayerTest.cpp", 95 "tests/MockHWC2.cpp", 96 "tests/MockHWComposer.cpp", 97 "tests/OutputTest.cpp", 98 "tests/OutputLayerTest.cpp", 99 "tests/RenderSurfaceTest.cpp", 100 ], 101 static_libs: [ 102 "libcompositionengine", 103 "libcompositionengine_mocks", 104 "librenderengine_mocks", 105 "libgmock", 106 "libgtest", 107 ], 108 sanitize: { 109 // By using the address sanitizer, we not only uncover any issues 110 // with the test, but also any issues with the code under test. 111 // 112 // Note: If you get an runtime link error like: 113 // 114 // CANNOT LINK EXECUTABLE "/data/local/tmp/libcompositionengine_test": library "libclang_rt.asan-aarch64-android.so" not found 115 // 116 // it is because the address sanitizer shared objects are not installed 117 // by default in the system image. 118 // 119 // You can either "make dist tests" before flashing, or set this 120 // option to false temporarily. 121 address: true, 122 }, 123 } 124