blob: e8571e0ae937d61ebc13be636bb79e88f3c81a04 [file] [log] [blame]
Dan Willemsen3106c1c2016-10-03 23:56:51 -07001// Copyright 2010 The Android Open Source Project
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
Jiyong Park172bd722017-06-21 12:14:18 +090014cc_library_headers {
15 name: "libgui_headers",
16 vendor_available: true,
17 export_include_dirs: ["include"],
Lajos Molnar7aa71e72019-04-01 15:34:32 -070018
19 // we must build this module to get the required header as that is generated
Marco Nelissencb04dee2019-10-28 12:55:47 -070020 export_shared_lib_headers: [
21 "android.hidl.token@1.0-utils",
22 "android.hardware.graphics.bufferqueue@1.0",
23 "android.hardware.graphics.bufferqueue@2.0",
24 ],
25 shared_libs: [
26 "android.hidl.token@1.0-utils",
27 "android.hardware.graphics.bufferqueue@1.0",
28 "android.hardware.graphics.bufferqueue@2.0",
29 ],
Jooyung Han7bcb8932020-04-16 18:48:32 +090030 min_sdk_version: "29",
Jiyong Park172bd722017-06-21 12:14:18 +090031}
Dan Willemsen3106c1c2016-10-03 23:56:51 -070032
Pablo Gamito6ee484d2020-07-30 14:26:28 +000033filegroup {
34 name: "libgui_aidl",
35 srcs: ["aidl/**/*.aidl"],
36 path: "aidl/",
37}
38
Dan Willemsen3106c1c2016-10-03 23:56:51 -070039cc_library_shared {
40 name: "libgui",
Justin Yun0b9bc012021-01-05 17:39:05 +090041 vendor_available: true,
Justin Yun71d6c8852017-07-24 15:19:45 +090042 vndk: {
43 enabled: true,
Justin Yun0b9bc012021-01-05 17:39:05 +090044 private: true,
Justin Yun71d6c8852017-07-24 15:19:45 +090045 },
Jiyong Parka75d3d62018-04-09 12:16:30 +090046 double_loadable: true,
Dan Willemsen3106c1c2016-10-03 23:56:51 -070047
Chong Zhangdbfaf4d2019-05-03 10:33:18 -070048 defaults: ["libgui_bufferqueue-defaults"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -070049
50 srcs: [
Daichi Hironof474d3d2019-11-05 08:54:07 +090051 ":framework_native_aidl",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -100052 ":inputconstants_aidl",
Pablo Gamito6ee484d2020-07-30 14:26:28 +000053 ":libgui_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -070054 ":libgui_bufferqueue_sources",
55
Dan Willemsen3106c1c2016-10-03 23:56:51 -070056 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -070057 "BLASTBufferQueue.cpp",
Jiwen 'Steve' Caia2a27b22018-02-07 17:29:56 -080058 "BufferHubConsumer.cpp",
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -080059 "BufferHubProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070060 "BufferItemConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070061 "ConsumerBase.cpp",
62 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -070063 "DebugEGLImageTracker.cpp",
Alec Mouri77a53872019-10-28 16:44:36 -070064 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070065 "DisplayEventReceiver.cpp",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -100066 "FrameTimelineInfo.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070067 "GLConsumer.cpp",
Chong Zhang62493092020-01-15 16:04:47 -080068 "IConsumerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070069 "IDisplayEventConnection.cpp",
Chong Zhang62493092020-01-15 16:04:47 -080070 "IGraphicBufferConsumer.cpp",
71 "IGraphicBufferProducer.cpp",
72 "IProducerListener.cpp",
Dan Stoza84ab9372018-12-17 15:27:57 -080073 "IRegionSamplingListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070074 "ISurfaceComposer.cpp",
75 "ISurfaceComposerClient.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -070076 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -080077 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -080078 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070079 "LayerState.cpp",
Chong Zhang62493092020-01-15 16:04:47 -080080 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070081 "StreamSplitter.cpp",
chaviw0ef7caa2021-01-05 11:04:50 -080082 "ScreenCaptureResults.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070083 "Surface.cpp",
84 "SurfaceControl.cpp",
85 "SurfaceComposerClient.cpp",
86 "SyncFeatures.cpp",
Pablo Gamito6ee484d2020-07-30 14:26:28 +000087 "TransactionTracing.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -080088 "view/Surface.cpp",
Chong Zhang62493092020-01-15 16:04:47 -080089 "bufferqueue/1.0/B2HProducerListener.cpp",
90 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
91 "bufferqueue/2.0/B2HProducerListener.cpp",
92 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070093 ],
94
95 shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -080096 "android.frameworks.bufferhub@1.0",
Chong Zhang62493092020-01-15 16:04:47 -080097 "libbinder",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -070098 "libbufferhub",
Lloyd Pique3b745782018-08-31 17:34:40 -070099 "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui.
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800100 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800101 "libpdx_default_transport",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700102 ],
103
Chong Zhang62493092020-01-15 16:04:47 -0800104 export_shared_lib_headers: [
105 "libbinder",
Vishnu Naire798b472020-07-23 13:52:21 -0700106 "libinput",
Chong Zhang62493092020-01-15 16:04:47 -0800107 ],
108
Jiyong Parka75d3d62018-04-09 12:16:30 +0900109 // bufferhub is not used when building libgui for vendors
110 target: {
111 vendor: {
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800112 cflags: [
113 "-DNO_BUFFERHUB",
114 "-DNO_INPUT",
115 ],
Jiyong Parka75d3d62018-04-09 12:16:30 +0900116 exclude_srcs: [
117 "BufferHubConsumer.cpp",
118 "BufferHubProducer.cpp",
119 ],
120 exclude_shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -0800121 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700122 "libbufferhub",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900123 "libbufferhubqueue",
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800124 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800125 "libpdx_default_transport",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900126 ],
127 },
128 },
129
Mathias Agopian6a3c05b2017-04-27 20:06:55 -0700130 header_libs: [
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -0800131 "libdvr_headers",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900132 "libpdx_headers",
Mathias Agopian6a3c05b2017-04-27 20:06:55 -0700133 ],
Daichi Hironof474d3d2019-11-05 08:54:07 +0900134
135 aidl: {
136 export_aidl_headers: true,
Yi Kongccc1c7c2021-02-22 17:44:17 +0800137 },
138
139 pgo: {
140 sampling: true,
141 profile_file: "libgui/libgui.profdata",
142 },
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700143}
144
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700145// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700146// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700147cc_library_static {
148 name: "libgui_bufferqueue_static",
149 vendor_available: true,
Jooyung Han54042e02020-05-13 16:04:07 +0900150 apex_available: [
151 "//apex_available:platform",
152 "com.android.media.swcodec",
153 ],
154 min_sdk_version: "29",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700155
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700156 cflags: [
157 "-DNO_BUFFERHUB",
Chong Zhang62493092020-01-15 16:04:47 -0800158 "-DNO_BINDER",
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700159 ],
160
161 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700162
163 srcs: [
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000164 ":inputconstants_aidl",
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000165 ":libgui_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700166 ":libgui_bufferqueue_sources",
167 ],
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700168}
169
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700170filegroup {
171 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700172 srcs: [
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700173 "BatchBufferOps.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700174 "BufferItem.cpp",
175 "BufferQueue.cpp",
176 "BufferQueueConsumer.cpp",
177 "BufferQueueCore.cpp",
178 "BufferQueueProducer.cpp",
179 "BufferQueueThreadState.cpp",
180 "BufferSlot.cpp",
181 "FrameTimestamps.cpp",
182 "GLConsumerUtils.cpp",
183 "HdrMetadata.cpp",
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700184 "IGraphicBufferProducerFlattenables.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700185 "bufferqueue/1.0/Conversion.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700186 "bufferqueue/1.0/H2BProducerListener.cpp",
187 "bufferqueue/1.0/WProducerListener.cpp",
188 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700189 "bufferqueue/2.0/H2BProducerListener.cpp",
190 "bufferqueue/2.0/types.cpp",
191 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700192}
193
194// Common build config shared by libgui and libgui_bufferqueue_static.
195cc_defaults {
196 name: "libgui_bufferqueue-defaults",
197
198 clang: true,
199 cflags: [
200 "-Wall",
201 "-Werror",
202 ],
203
204 cppflags: [
205 "-Wextra",
206 "-DDEBUG_ONLY_CODE=0",
207 ],
208
209 product_variables: {
210 eng: {
211 cppflags: [
212 "-UDEBUG_ONLY_CODE",
213 "-DDEBUG_ONLY_CODE=1",
214 ],
215 },
216 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700217
David Stevens7347f0b2020-01-15 20:19:22 +0900218 whole_static_libs: [
219 "LibGuiProperties",
220 ],
221
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700222 shared_libs: [
223 "android.hardware.graphics.bufferqueue@1.0",
224 "android.hardware.graphics.bufferqueue@2.0",
225 "android.hardware.graphics.common@1.1",
226 "android.hardware.graphics.common@1.2",
227 "android.hidl.token@1.0-utils",
228 "libbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700229 "libcutils",
230 "libEGL",
231 "libGLESv2",
232 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700233 "liblog",
234 "libnativewindow",
235 "libsync",
236 "libui",
237 "libutils",
238 "libvndksupport",
239 ],
240
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800241 static_libs: [
242 "libbinderthreadstateutils",
243 ],
244
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700245 header_libs: [
246 "libgui_headers",
247 "libnativebase_headers",
248 ],
249
Ady Abraham62f216c2020-10-13 19:07:23 -0700250 include_dirs: [
251 "frameworks/native/include",
252 ],
253
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700254 export_shared_lib_headers: [
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700255 "libEGL",
256 "libnativewindow",
257 "libui",
258 "android.hardware.graphics.bufferqueue@1.0",
259 "android.hardware.graphics.bufferqueue@2.0",
260 "android.hardware.graphics.common@1.1",
261 "android.hardware.graphics.common@1.2",
262 "android.hidl.token@1.0-utils",
263 ],
264
265 export_header_lib_headers: [
266 "libgui_headers",
267 ],
268
269 export_include_dirs: [
270 "include",
271 ],
272}
273
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700274// GMocks for use by external code
275cc_library_static {
276 name: "libgui_mocks",
277 vendor_available: false,
278
279 defaults: ["libgui_bufferqueue-defaults"],
280 static_libs: [
281 "libgtest",
282 "libgmock",
283 ],
284
285 srcs: [
286 "mock/GraphicBufferConsumer.cpp",
287 "mock/GraphicBufferProducer.cpp",
288 ],
289}
290
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700291subdirs = ["tests"]