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