• 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: "surfaceflinger_defaults",
12    cflags: [
13        "-Wall",
14        "-Werror",
15        "-Wextra",
16        "-Wformat",
17        "-Wthread-safety",
18        "-Wunused",
19        "-Wunreachable-code",
20        "-Wconversion",
21        "-DANDROID_UTILS_REF_BASE_DISABLE_IMPLICIT_CONSTRUCTION",
22    ],
23}
24
25cc_defaults {
26    name: "libsurfaceflinger_defaults",
27    defaults: [
28        "android.hardware.graphics.composer3-ndk_shared",
29        "librenderengine_deps",
30        "surfaceflinger_defaults",
31    ],
32    cflags: [
33        "-DLOG_TAG=\"SurfaceFlinger\"",
34        "-DGL_GLEXT_PROTOTYPES",
35        "-DEGL_EGLEXT_PROTOTYPES",
36    ],
37    shared_libs: [
38        "android.hardware.configstore-utils",
39        "android.hardware.configstore@1.0",
40        "android.hardware.configstore@1.1",
41        "android.hardware.graphics.allocator@2.0",
42        "android.hardware.graphics.allocator@3.0",
43        "android.hardware.graphics.common@1.2",
44        "android.hardware.common-V2-ndk",
45        "android.hardware.common.fmq-V1-ndk",
46        "android.hardware.graphics.composer@2.1",
47        "android.hardware.graphics.composer@2.2",
48        "android.hardware.graphics.composer@2.3",
49        "android.hardware.graphics.composer@2.4",
50        "android.hardware.power-V4-cpp",
51        "libbase",
52        "libbinder",
53        "libbinder_ndk",
54        "libcutils",
55        "libEGL",
56        "libfmq",
57        "libGLESv1_CM",
58        "libGLESv2",
59        "libgui",
60        "libhidlbase",
61        "liblayers_proto",
62        "liblog",
63        "libnativewindow",
64        "libpowermanager",
65        "libprocessgroup",
66        "libprotobuf-cpp-lite",
67        "libsync",
68        "libtimestats",
69        "libui",
70        "libinput",
71        "libutils",
72        "libSurfaceFlingerProp",
73        "server_configurable_flags",
74    ],
75    static_libs: [
76        "libaidlcommonsupport",
77        "libcompositionengine",
78        "libframetimeline",
79        "libgui_aidl_static",
80        "libperfetto_client_experimental",
81        "librenderengine",
82        "libscheduler",
83        "libserviceutils",
84        "libshaders",
85        "libtonemap",
86    ],
87    header_libs: [
88        "android.hardware.graphics.composer@2.1-command-buffer",
89        "android.hardware.graphics.composer@2.2-command-buffer",
90        "android.hardware.graphics.composer@2.3-command-buffer",
91        "android.hardware.graphics.composer@2.4-command-buffer",
92        "android.hardware.graphics.composer3-command-buffer",
93    ],
94    export_static_lib_headers: [
95        "libcompositionengine",
96        "librenderengine",
97        "libserviceutils",
98    ],
99    export_shared_lib_headers: [
100        "android.hardware.graphics.allocator@2.0",
101        "android.hardware.graphics.allocator@3.0",
102        "android.hardware.graphics.common@1.2",
103        "android.hardware.graphics.composer@2.1",
104        "android.hardware.graphics.composer@2.2",
105        "android.hardware.graphics.composer@2.3",
106        "android.hardware.graphics.composer@2.4",
107        "libpowermanager",
108        "libhidlbase",
109        "libtimestats",
110    ],
111    // TODO (marissaw): this library is not used by surfaceflinger. This is here so
112    // the library compiled in a way that is accessible to system partition when running
113    // IMapper's VTS.
114    required: ["libgralloctypes"],
115}
116
117cc_defaults {
118    name: "libsurfaceflinger_production_defaults",
119    defaults: ["libsurfaceflinger_defaults"],
120    lto: {
121        thin: true,
122    },
123    whole_program_vtables: true, // Requires ThinLTO
124    afdo: true,
125    // TODO(b/131771163): Fix broken fuzzer support with LTO.
126    sanitize: {
127        fuzzer: false,
128    },
129}
130
131cc_library_headers {
132    name: "libsurfaceflinger_headers",
133    export_include_dirs: ["."],
134    static_libs: ["libserviceutils"],
135    export_static_lib_headers: ["libserviceutils"],
136}
137
138filegroup {
139    name: "libsurfaceflinger_sources",
140    srcs: [
141        "BackgroundExecutor.cpp",
142        "Client.cpp",
143        "ClientCache.cpp",
144        "Display/DisplaySnapshot.cpp",
145        "DisplayDevice.cpp",
146        "DisplayHardware/AidlComposerHal.cpp",
147        "DisplayHardware/ComposerHal.cpp",
148        "DisplayHardware/FramebufferSurface.cpp",
149        "DisplayHardware/HWC2.cpp",
150        "DisplayHardware/HWComposer.cpp",
151        "DisplayHardware/HidlComposerHal.cpp",
152        "DisplayHardware/PowerAdvisor.cpp",
153        "DisplayHardware/VirtualDisplaySurface.cpp",
154        "DisplayRenderArea.cpp",
155        "Effects/Daltonizer.cpp",
156        "EventLog/EventLog.cpp",
157        "FrontEnd/LayerCreationArgs.cpp",
158        "FrontEnd/LayerHandle.cpp",
159        "FrontEnd/LayerSnapshot.cpp",
160        "FrontEnd/LayerSnapshotBuilder.cpp",
161        "FrontEnd/LayerHierarchy.cpp",
162        "FrontEnd/LayerLifecycleManager.cpp",
163        "FrontEnd/RequestedLayerState.cpp",
164        "FrontEnd/TransactionHandler.cpp",
165        "FlagManager.cpp",
166        "FpsReporter.cpp",
167        "FrameTracer/FrameTracer.cpp",
168        "FrameTracker.cpp",
169        "HdrLayerInfoReporter.cpp",
170        "WindowInfosListenerInvoker.cpp",
171        "Layer.cpp",
172        "LayerFE.cpp",
173        "LayerProtoHelper.cpp",
174        "LayerRenderArea.cpp",
175        "LayerVector.cpp",
176        "NativeWindowSurface.cpp",
177        "RefreshRateOverlay.cpp",
178        "RegionSamplingThread.cpp",
179        "RenderArea.cpp",
180        "Scheduler/EventThread.cpp",
181        "Scheduler/FrameRateOverrideMappings.cpp",
182        "Scheduler/OneShotTimer.cpp",
183        "Scheduler/LayerHistory.cpp",
184        "Scheduler/LayerInfo.cpp",
185        "Scheduler/MessageQueue.cpp",
186        "Scheduler/RefreshRateSelector.cpp",
187        "Scheduler/Scheduler.cpp",
188        "Scheduler/SmallAreaDetectionAllowMappings.cpp",
189        "Scheduler/VSyncDispatchTimerQueue.cpp",
190        "Scheduler/VSyncPredictor.cpp",
191        "Scheduler/VSyncReactor.cpp",
192        "Scheduler/VsyncConfiguration.cpp",
193        "Scheduler/VsyncModulator.cpp",
194        "Scheduler/VsyncSchedule.cpp",
195        "ScreenCaptureOutput.cpp",
196        "StartPropertySetThread.cpp",
197        "SurfaceFlinger.cpp",
198        "SurfaceFlingerDefaultFactory.cpp",
199        "Tracing/LayerTracing.cpp",
200        "Tracing/TransactionTracing.cpp",
201        "Tracing/TransactionProtoParser.cpp",
202        "TransactionCallbackInvoker.cpp",
203        "TunnelModeEnabledReporter.cpp",
204    ],
205}
206
207cc_defaults {
208    name: "libsurfaceflinger_binary",
209    defaults: [
210        "surfaceflinger_defaults",
211        "libsurfaceflinger_production_defaults",
212    ],
213    cflags: [
214        "-DLOG_TAG=\"SurfaceFlinger\"",
215    ],
216    shared_libs: [
217        "android.frameworks.displayservice@1.0",
218        "android.hardware.configstore-utils",
219        "android.hardware.configstore@1.0",
220        "android.hardware.graphics.allocator@2.0",
221        "android.hardware.graphics.allocator@3.0",
222        "libbinder",
223        "libcutils",
224        "libdisplayservicehidl",
225        "libhidlbase",
226        "liblog",
227        "libprocessgroup",
228        "libsync",
229        "libutils",
230    ],
231    static_libs: [
232        "libserviceutils",
233    ],
234}
235
236filegroup {
237    name: "surfaceflinger_binary_sources",
238    srcs: [
239        ":libsurfaceflinger_sources",
240        "main_surfaceflinger.cpp",
241    ],
242}
243
244cc_binary {
245    name: "surfaceflinger",
246    defaults: ["libsurfaceflinger_binary"],
247    init_rc: ["surfaceflinger.rc"],
248    srcs: [
249        ":surfaceflinger_binary_sources",
250        // Note: SurfaceFlingerFactory is not in the filegroup so that it
251        // can be easily replaced.
252        "SurfaceFlingerFactory.cpp",
253    ],
254    shared_libs: [
255        "libSurfaceFlingerProp",
256    ],
257
258    logtags: ["EventLog/EventLogTags.logtags"],
259}
260
261subdirs = [
262    "layerproto",
263    "tests",
264]
265
266cc_library_shared {
267    name: "libSurfaceFlingerProp",
268    srcs: [
269        "SurfaceFlingerProperties.cpp",
270    ],
271    shared_libs: [
272        "android.hardware.configstore-utils",
273        "android.hardware.configstore@1.0",
274        "android.hardware.configstore@1.1",
275        "android.hardware.graphics.common@1.2",
276        "libhidlbase",
277        "libui",
278        "libutils",
279        "liblog",
280    ],
281    static_libs: [
282        "libSurfaceFlingerProperties",
283    ],
284    export_shared_lib_headers: [
285        "android.hardware.graphics.common@1.2",
286        "libhidlbase",
287        "libui",
288    ],
289    export_static_lib_headers: [
290        "libSurfaceFlingerProperties",
291    ],
292}
293