blob: dc91fc669c22c96f39981e44730b727caab1b3c4 [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.
Bob Badour3306e492021-02-25 15:35:37 -080014package {
15 // See: http://go/android-license-faq
16 // A large-scale-change added 'default_applicable_licenses' to import
17 // all of the 'license_kinds' from "frameworks_native_license"
18 // to get the below license kinds:
19 // SPDX-license-identifier-Apache-2.0
20 default_applicable_licenses: ["frameworks_native_license"],
21}
22
Jiyong Park172bd722017-06-21 12:14:18 +090023cc_library_headers {
24 name: "libgui_headers",
25 vendor_available: true,
26 export_include_dirs: ["include"],
Lajos Molnar7aa71e72019-04-01 15:34:32 -070027
28 // we must build this module to get the required header as that is generated
Marco Nelissencb04dee2019-10-28 12:55:47 -070029 export_shared_lib_headers: [
30 "android.hidl.token@1.0-utils",
31 "android.hardware.graphics.bufferqueue@1.0",
32 "android.hardware.graphics.bufferqueue@2.0",
33 ],
34 shared_libs: [
35 "android.hidl.token@1.0-utils",
36 "android.hardware.graphics.bufferqueue@1.0",
37 "android.hardware.graphics.bufferqueue@2.0",
38 ],
Jooyung Han7bcb8932020-04-16 18:48:32 +090039 min_sdk_version: "29",
Jiyong Park172bd722017-06-21 12:14:18 +090040}
Dan Willemsen3106c1c2016-10-03 23:56:51 -070041
Pablo Gamito6ee484d2020-07-30 14:26:28 +000042filegroup {
43 name: "libgui_aidl",
44 srcs: ["aidl/**/*.aidl"],
45 path: "aidl/",
46}
47
Dan Willemsen3106c1c2016-10-03 23:56:51 -070048cc_library_shared {
49 name: "libgui",
Justin Yun0b9bc012021-01-05 17:39:05 +090050 vendor_available: true,
Justin Yun71d6c8852017-07-24 15:19:45 +090051 vndk: {
52 enabled: true,
Justin Yun0b9bc012021-01-05 17:39:05 +090053 private: true,
Justin Yun71d6c8852017-07-24 15:19:45 +090054 },
Jiyong Parka75d3d62018-04-09 12:16:30 +090055 double_loadable: true,
Dan Willemsen3106c1c2016-10-03 23:56:51 -070056
Chong Zhangdbfaf4d2019-05-03 10:33:18 -070057 defaults: ["libgui_bufferqueue-defaults"],
Dan Willemsen3106c1c2016-10-03 23:56:51 -070058
59 srcs: [
Daichi Hironof474d3d2019-11-05 08:54:07 +090060 ":framework_native_aidl",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -100061 ":inputconstants_aidl",
Pablo Gamito6ee484d2020-07-30 14:26:28 +000062 ":libgui_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -070063 ":libgui_bufferqueue_sources",
64
Dan Willemsen3106c1c2016-10-03 23:56:51 -070065 "BitTube.cpp",
Robert Carr78c25dd2019-08-15 14:10:33 -070066 "BLASTBufferQueue.cpp",
Jiwen 'Steve' Caia2a27b22018-02-07 17:29:56 -080067 "BufferHubConsumer.cpp",
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -080068 "BufferHubProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070069 "BufferItemConsumer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070070 "ConsumerBase.cpp",
71 "CpuConsumer.cpp",
Ady Abrahama3b08ef2019-07-15 18:43:10 -070072 "DebugEGLImageTracker.cpp",
Alec Mouri77a53872019-10-28 16:44:36 -070073 "DisplayEventDispatcher.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070074 "DisplayEventReceiver.cpp",
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -100075 "FrameTimelineInfo.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070076 "GLConsumer.cpp",
Chong Zhang62493092020-01-15 16:04:47 -080077 "IConsumerListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070078 "IDisplayEventConnection.cpp",
Chong Zhang62493092020-01-15 16:04:47 -080079 "IGraphicBufferConsumer.cpp",
80 "IGraphicBufferProducer.cpp",
81 "IProducerListener.cpp",
Dan Stoza84ab9372018-12-17 15:27:57 -080082 "IRegionSamplingListener.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070083 "ISurfaceComposer.cpp",
84 "ISurfaceComposerClient.cpp",
Marissa Wall7a9b6ff2018-08-21 17:26:20 -070085 "ITransactionCompletedListener.cpp",
Kalle Raitaa099a242017-01-11 11:17:29 -080086 "LayerDebugInfo.cpp",
Evan Rosky1f6d6d52018-12-06 10:47:26 -080087 "LayerMetadata.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070088 "LayerState.cpp",
Chong Zhang62493092020-01-15 16:04:47 -080089 "OccupancyTracker.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070090 "StreamSplitter.cpp",
chaviw0ef7caa2021-01-05 11:04:50 -080091 "ScreenCaptureResults.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -070092 "Surface.cpp",
93 "SurfaceControl.cpp",
94 "SurfaceComposerClient.cpp",
95 "SyncFeatures.cpp",
Pablo Gamito6ee484d2020-07-30 14:26:28 +000096 "TransactionTracing.cpp",
Mathias Agopian05debe12017-02-08 17:04:18 -080097 "view/Surface.cpp",
Chong Zhang62493092020-01-15 16:04:47 -080098 "bufferqueue/1.0/B2HProducerListener.cpp",
99 "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
100 "bufferqueue/2.0/B2HProducerListener.cpp",
101 "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700102 ],
103
104 shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -0800105 "android.frameworks.bufferhub@1.0",
Chong Zhang62493092020-01-15 16:04:47 -0800106 "libbinder",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700107 "libbufferhub",
Lloyd Pique3b745782018-08-31 17:34:40 -0700108 "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui.
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800109 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800110 "libpdx_default_transport",
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700111 ],
112
Chong Zhang62493092020-01-15 16:04:47 -0800113 export_shared_lib_headers: [
114 "libbinder",
Vishnu Naire798b472020-07-23 13:52:21 -0700115 "libinput",
Chong Zhang62493092020-01-15 16:04:47 -0800116 ],
117
Jiyong Parka75d3d62018-04-09 12:16:30 +0900118 // bufferhub is not used when building libgui for vendors
119 target: {
120 vendor: {
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800121 cflags: [
122 "-DNO_BUFFERHUB",
123 "-DNO_INPUT",
124 ],
Jiyong Parka75d3d62018-04-09 12:16:30 +0900125 exclude_srcs: [
126 "BufferHubConsumer.cpp",
127 "BufferHubProducer.cpp",
128 ],
129 exclude_shared_libs: [
Fan Xu021776e2018-12-05 13:34:48 -0800130 "android.frameworks.bufferhub@1.0",
Jiwen 'Steve' Cai57ae3ee2018-05-03 17:51:52 -0700131 "libbufferhub",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900132 "libbufferhubqueue",
Jayant Chowdharyad9fe272019-03-07 22:36:06 -0800133 "libinput",
Pawin Vongmasae672cd02019-02-14 16:01:29 -0800134 "libpdx_default_transport",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900135 ],
136 },
137 },
138
Mathias Agopian6a3c05b2017-04-27 20:06:55 -0700139 header_libs: [
Jiwen 'Steve' Cai0f950842018-01-16 17:05:54 -0800140 "libdvr_headers",
Jiyong Parka75d3d62018-04-09 12:16:30 +0900141 "libpdx_headers",
Mathias Agopian6a3c05b2017-04-27 20:06:55 -0700142 ],
Daichi Hironof474d3d2019-11-05 08:54:07 +0900143
144 aidl: {
145 export_aidl_headers: true,
Yi Kongccc1c7c2021-02-22 17:44:17 +0800146 },
147
148 pgo: {
149 sampling: true,
150 profile_file: "libgui/libgui.profdata",
151 },
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700152}
153
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700154// Used by media codec services exclusively as a static lib for
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700155// core bufferqueue support only.
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700156cc_library_static {
157 name: "libgui_bufferqueue_static",
158 vendor_available: true,
Jooyung Han54042e02020-05-13 16:04:07 +0900159 apex_available: [
160 "//apex_available:platform",
161 "com.android.media.swcodec",
162 ],
163 min_sdk_version: "29",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700164
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700165 cflags: [
166 "-DNO_BUFFERHUB",
Chong Zhang62493092020-01-15 16:04:47 -0800167 "-DNO_BINDER",
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700168 ],
169
170 defaults: ["libgui_bufferqueue-defaults"],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700171
172 srcs: [
Siarhei Vishniakoufc434ac2021-01-13 10:28:00 -1000173 ":inputconstants_aidl",
Pablo Gamito6ee484d2020-07-30 14:26:28 +0000174 ":libgui_aidl",
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700175 ":libgui_bufferqueue_sources",
176 ],
Chong Zhangdbfaf4d2019-05-03 10:33:18 -0700177}
178
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700179filegroup {
180 name: "libgui_bufferqueue_sources",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700181 srcs: [
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700182 "BatchBufferOps.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700183 "BufferItem.cpp",
184 "BufferQueue.cpp",
185 "BufferQueueConsumer.cpp",
186 "BufferQueueCore.cpp",
187 "BufferQueueProducer.cpp",
188 "BufferQueueThreadState.cpp",
189 "BufferSlot.cpp",
190 "FrameTimestamps.cpp",
191 "GLConsumerUtils.cpp",
192 "HdrMetadata.cpp",
Yin-Chia Yeh64ee5f52020-01-02 17:53:18 +0700193 "IGraphicBufferProducerFlattenables.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700194 "bufferqueue/1.0/Conversion.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700195 "bufferqueue/1.0/H2BProducerListener.cpp",
196 "bufferqueue/1.0/WProducerListener.cpp",
197 "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700198 "bufferqueue/2.0/H2BProducerListener.cpp",
199 "bufferqueue/2.0/types.cpp",
200 ],
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700201}
202
203// Common build config shared by libgui and libgui_bufferqueue_static.
204cc_defaults {
205 name: "libgui_bufferqueue-defaults",
206
207 clang: true,
208 cflags: [
209 "-Wall",
210 "-Werror",
211 ],
212
213 cppflags: [
214 "-Wextra",
215 "-DDEBUG_ONLY_CODE=0",
216 ],
217
218 product_variables: {
219 eng: {
220 cppflags: [
221 "-UDEBUG_ONLY_CODE",
222 "-DDEBUG_ONLY_CODE=1",
223 ],
224 },
225 },
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700226
David Stevens7347f0b2020-01-15 20:19:22 +0900227 whole_static_libs: [
228 "LibGuiProperties",
229 ],
230
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700231 shared_libs: [
232 "android.hardware.graphics.bufferqueue@1.0",
233 "android.hardware.graphics.bufferqueue@2.0",
234 "android.hardware.graphics.common@1.1",
235 "android.hardware.graphics.common@1.2",
236 "android.hidl.token@1.0-utils",
237 "libbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700238 "libcutils",
239 "libEGL",
240 "libGLESv2",
241 "libhidlbase",
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700242 "liblog",
243 "libnativewindow",
244 "libsync",
245 "libui",
246 "libutils",
247 "libvndksupport",
248 ],
249
Steven Moreland2b3f3cd2020-01-31 14:56:45 -0800250 static_libs: [
251 "libbinderthreadstateutils",
252 ],
253
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700254 header_libs: [
255 "libgui_headers",
256 "libnativebase_headers",
257 ],
258
Ady Abraham62f216c2020-10-13 19:07:23 -0700259 include_dirs: [
260 "frameworks/native/include",
261 ],
262
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700263 export_shared_lib_headers: [
Chong Zhang60fa4fd2019-04-19 10:00:27 -0700264 "libEGL",
265 "libnativewindow",
266 "libui",
267 "android.hardware.graphics.bufferqueue@1.0",
268 "android.hardware.graphics.bufferqueue@2.0",
269 "android.hardware.graphics.common@1.1",
270 "android.hardware.graphics.common@1.2",
271 "android.hidl.token@1.0-utils",
272 ],
273
274 export_header_lib_headers: [
275 "libgui_headers",
276 ],
277
278 export_include_dirs: [
279 "include",
280 ],
281}
282
Lloyd Pique1ebe0902019-10-04 14:47:13 -0700283// GMocks for use by external code
284cc_library_static {
285 name: "libgui_mocks",
286 vendor_available: false,
287
288 defaults: ["libgui_bufferqueue-defaults"],
289 static_libs: [
290 "libgtest",
291 "libgmock",
292 ],
293
294 srcs: [
295 "mock/GraphicBufferConsumer.cpp",
296 "mock/GraphicBufferProducer.cpp",
297 ],
298}
299
Dan Willemsen3106c1c2016-10-03 23:56:51 -0700300subdirs = ["tests"]