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