Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 1 | // 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 Badour | 3306e49 | 2021-02-25 15:35:37 -0800 | [diff] [blame^] | 14 | package { |
| 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 Park | 172bd72 | 2017-06-21 12:14:18 +0900 | [diff] [blame] | 23 | cc_library_headers { |
| 24 | name: "libgui_headers", |
| 25 | vendor_available: true, |
| 26 | export_include_dirs: ["include"], |
Lajos Molnar | 7aa71e7 | 2019-04-01 15:34:32 -0700 | [diff] [blame] | 27 | |
| 28 | // we must build this module to get the required header as that is generated |
Marco Nelissen | cb04dee | 2019-10-28 12:55:47 -0700 | [diff] [blame] | 29 | 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 Han | 7bcb893 | 2020-04-16 18:48:32 +0900 | [diff] [blame] | 39 | min_sdk_version: "29", |
Jiyong Park | 172bd72 | 2017-06-21 12:14:18 +0900 | [diff] [blame] | 40 | } |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 41 | |
Pablo Gamito | 6ee484d | 2020-07-30 14:26:28 +0000 | [diff] [blame] | 42 | filegroup { |
| 43 | name: "libgui_aidl", |
| 44 | srcs: ["aidl/**/*.aidl"], |
| 45 | path: "aidl/", |
| 46 | } |
| 47 | |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 48 | cc_library_shared { |
| 49 | name: "libgui", |
Justin Yun | 0b9bc01 | 2021-01-05 17:39:05 +0900 | [diff] [blame] | 50 | vendor_available: true, |
Justin Yun | 71d6c885 | 2017-07-24 15:19:45 +0900 | [diff] [blame] | 51 | vndk: { |
| 52 | enabled: true, |
Justin Yun | 0b9bc01 | 2021-01-05 17:39:05 +0900 | [diff] [blame] | 53 | private: true, |
Justin Yun | 71d6c885 | 2017-07-24 15:19:45 +0900 | [diff] [blame] | 54 | }, |
Jiyong Park | a75d3d6 | 2018-04-09 12:16:30 +0900 | [diff] [blame] | 55 | double_loadable: true, |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 56 | |
Chong Zhang | dbfaf4d | 2019-05-03 10:33:18 -0700 | [diff] [blame] | 57 | defaults: ["libgui_bufferqueue-defaults"], |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 58 | |
| 59 | srcs: [ |
Daichi Hirono | f474d3d | 2019-11-05 08:54:07 +0900 | [diff] [blame] | 60 | ":framework_native_aidl", |
Siarhei Vishniakou | fc434ac | 2021-01-13 10:28:00 -1000 | [diff] [blame] | 61 | ":inputconstants_aidl", |
Pablo Gamito | 6ee484d | 2020-07-30 14:26:28 +0000 | [diff] [blame] | 62 | ":libgui_aidl", |
Lloyd Pique | 1ebe090 | 2019-10-04 14:47:13 -0700 | [diff] [blame] | 63 | ":libgui_bufferqueue_sources", |
| 64 | |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 65 | "BitTube.cpp", |
Robert Carr | 78c25dd | 2019-08-15 14:10:33 -0700 | [diff] [blame] | 66 | "BLASTBufferQueue.cpp", |
Jiwen 'Steve' Cai | a2a27b2 | 2018-02-07 17:29:56 -0800 | [diff] [blame] | 67 | "BufferHubConsumer.cpp", |
Jiwen 'Steve' Cai | 0f95084 | 2018-01-16 17:05:54 -0800 | [diff] [blame] | 68 | "BufferHubProducer.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 69 | "BufferItemConsumer.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 70 | "ConsumerBase.cpp", |
| 71 | "CpuConsumer.cpp", |
Ady Abraham | a3b08ef | 2019-07-15 18:43:10 -0700 | [diff] [blame] | 72 | "DebugEGLImageTracker.cpp", |
Alec Mouri | 77a5387 | 2019-10-28 16:44:36 -0700 | [diff] [blame] | 73 | "DisplayEventDispatcher.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 74 | "DisplayEventReceiver.cpp", |
Siarhei Vishniakou | fc434ac | 2021-01-13 10:28:00 -1000 | [diff] [blame] | 75 | "FrameTimelineInfo.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 76 | "GLConsumer.cpp", |
Chong Zhang | 6249309 | 2020-01-15 16:04:47 -0800 | [diff] [blame] | 77 | "IConsumerListener.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 78 | "IDisplayEventConnection.cpp", |
Chong Zhang | 6249309 | 2020-01-15 16:04:47 -0800 | [diff] [blame] | 79 | "IGraphicBufferConsumer.cpp", |
| 80 | "IGraphicBufferProducer.cpp", |
| 81 | "IProducerListener.cpp", |
Dan Stoza | 84ab937 | 2018-12-17 15:27:57 -0800 | [diff] [blame] | 82 | "IRegionSamplingListener.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 83 | "ISurfaceComposer.cpp", |
| 84 | "ISurfaceComposerClient.cpp", |
Marissa Wall | 7a9b6ff | 2018-08-21 17:26:20 -0700 | [diff] [blame] | 85 | "ITransactionCompletedListener.cpp", |
Kalle Raita | a099a24 | 2017-01-11 11:17:29 -0800 | [diff] [blame] | 86 | "LayerDebugInfo.cpp", |
Evan Rosky | 1f6d6d5 | 2018-12-06 10:47:26 -0800 | [diff] [blame] | 87 | "LayerMetadata.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 88 | "LayerState.cpp", |
Chong Zhang | 6249309 | 2020-01-15 16:04:47 -0800 | [diff] [blame] | 89 | "OccupancyTracker.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 90 | "StreamSplitter.cpp", |
chaviw | 0ef7caa | 2021-01-05 11:04:50 -0800 | [diff] [blame] | 91 | "ScreenCaptureResults.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 92 | "Surface.cpp", |
| 93 | "SurfaceControl.cpp", |
| 94 | "SurfaceComposerClient.cpp", |
| 95 | "SyncFeatures.cpp", |
Pablo Gamito | 6ee484d | 2020-07-30 14:26:28 +0000 | [diff] [blame] | 96 | "TransactionTracing.cpp", |
Mathias Agopian | 05debe1 | 2017-02-08 17:04:18 -0800 | [diff] [blame] | 97 | "view/Surface.cpp", |
Chong Zhang | 6249309 | 2020-01-15 16:04:47 -0800 | [diff] [blame] | 98 | "bufferqueue/1.0/B2HProducerListener.cpp", |
| 99 | "bufferqueue/1.0/H2BGraphicBufferProducer.cpp", |
| 100 | "bufferqueue/2.0/B2HProducerListener.cpp", |
| 101 | "bufferqueue/2.0/H2BGraphicBufferProducer.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 102 | ], |
| 103 | |
| 104 | shared_libs: [ |
Fan Xu | 021776e | 2018-12-05 13:34:48 -0800 | [diff] [blame] | 105 | "android.frameworks.bufferhub@1.0", |
Chong Zhang | 6249309 | 2020-01-15 16:04:47 -0800 | [diff] [blame] | 106 | "libbinder", |
Jiwen 'Steve' Cai | 57ae3ee | 2018-05-03 17:51:52 -0700 | [diff] [blame] | 107 | "libbufferhub", |
Lloyd Pique | 3b74578 | 2018-08-31 17:34:40 -0700 | [diff] [blame] | 108 | "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui. |
Pawin Vongmasa | e672cd0 | 2019-02-14 16:01:29 -0800 | [diff] [blame] | 109 | "libinput", |
Pawin Vongmasa | e672cd0 | 2019-02-14 16:01:29 -0800 | [diff] [blame] | 110 | "libpdx_default_transport", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 111 | ], |
| 112 | |
Chong Zhang | 6249309 | 2020-01-15 16:04:47 -0800 | [diff] [blame] | 113 | export_shared_lib_headers: [ |
| 114 | "libbinder", |
Vishnu Nair | e798b47 | 2020-07-23 13:52:21 -0700 | [diff] [blame] | 115 | "libinput", |
Chong Zhang | 6249309 | 2020-01-15 16:04:47 -0800 | [diff] [blame] | 116 | ], |
| 117 | |
Jiyong Park | a75d3d6 | 2018-04-09 12:16:30 +0900 | [diff] [blame] | 118 | // bufferhub is not used when building libgui for vendors |
| 119 | target: { |
| 120 | vendor: { |
Jayant Chowdhary | ad9fe27 | 2019-03-07 22:36:06 -0800 | [diff] [blame] | 121 | cflags: [ |
| 122 | "-DNO_BUFFERHUB", |
| 123 | "-DNO_INPUT", |
| 124 | ], |
Jiyong Park | a75d3d6 | 2018-04-09 12:16:30 +0900 | [diff] [blame] | 125 | exclude_srcs: [ |
| 126 | "BufferHubConsumer.cpp", |
| 127 | "BufferHubProducer.cpp", |
| 128 | ], |
| 129 | exclude_shared_libs: [ |
Fan Xu | 021776e | 2018-12-05 13:34:48 -0800 | [diff] [blame] | 130 | "android.frameworks.bufferhub@1.0", |
Jiwen 'Steve' Cai | 57ae3ee | 2018-05-03 17:51:52 -0700 | [diff] [blame] | 131 | "libbufferhub", |
Jiyong Park | a75d3d6 | 2018-04-09 12:16:30 +0900 | [diff] [blame] | 132 | "libbufferhubqueue", |
Jayant Chowdhary | ad9fe27 | 2019-03-07 22:36:06 -0800 | [diff] [blame] | 133 | "libinput", |
Pawin Vongmasa | e672cd0 | 2019-02-14 16:01:29 -0800 | [diff] [blame] | 134 | "libpdx_default_transport", |
Jiyong Park | a75d3d6 | 2018-04-09 12:16:30 +0900 | [diff] [blame] | 135 | ], |
| 136 | }, |
| 137 | }, |
| 138 | |
Mathias Agopian | 6a3c05b | 2017-04-27 20:06:55 -0700 | [diff] [blame] | 139 | header_libs: [ |
Jiwen 'Steve' Cai | 0f95084 | 2018-01-16 17:05:54 -0800 | [diff] [blame] | 140 | "libdvr_headers", |
Jiyong Park | a75d3d6 | 2018-04-09 12:16:30 +0900 | [diff] [blame] | 141 | "libpdx_headers", |
Mathias Agopian | 6a3c05b | 2017-04-27 20:06:55 -0700 | [diff] [blame] | 142 | ], |
Daichi Hirono | f474d3d | 2019-11-05 08:54:07 +0900 | [diff] [blame] | 143 | |
| 144 | aidl: { |
| 145 | export_aidl_headers: true, |
Yi Kong | ccc1c7c | 2021-02-22 17:44:17 +0800 | [diff] [blame] | 146 | }, |
| 147 | |
| 148 | pgo: { |
| 149 | sampling: true, |
| 150 | profile_file: "libgui/libgui.profdata", |
| 151 | }, |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 152 | } |
| 153 | |
Chong Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 154 | // Used by media codec services exclusively as a static lib for |
Chong Zhang | dbfaf4d | 2019-05-03 10:33:18 -0700 | [diff] [blame] | 155 | // core bufferqueue support only. |
Chong Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 156 | cc_library_static { |
| 157 | name: "libgui_bufferqueue_static", |
| 158 | vendor_available: true, |
Jooyung Han | 54042e0 | 2020-05-13 16:04:07 +0900 | [diff] [blame] | 159 | apex_available: [ |
| 160 | "//apex_available:platform", |
| 161 | "com.android.media.swcodec", |
| 162 | ], |
| 163 | min_sdk_version: "29", |
Chong Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 164 | |
Chong Zhang | dbfaf4d | 2019-05-03 10:33:18 -0700 | [diff] [blame] | 165 | cflags: [ |
| 166 | "-DNO_BUFFERHUB", |
Chong Zhang | 6249309 | 2020-01-15 16:04:47 -0800 | [diff] [blame] | 167 | "-DNO_BINDER", |
Chong Zhang | dbfaf4d | 2019-05-03 10:33:18 -0700 | [diff] [blame] | 168 | ], |
| 169 | |
| 170 | defaults: ["libgui_bufferqueue-defaults"], |
Lloyd Pique | 1ebe090 | 2019-10-04 14:47:13 -0700 | [diff] [blame] | 171 | |
| 172 | srcs: [ |
Siarhei Vishniakou | fc434ac | 2021-01-13 10:28:00 -1000 | [diff] [blame] | 173 | ":inputconstants_aidl", |
Pablo Gamito | 6ee484d | 2020-07-30 14:26:28 +0000 | [diff] [blame] | 174 | ":libgui_aidl", |
Lloyd Pique | 1ebe090 | 2019-10-04 14:47:13 -0700 | [diff] [blame] | 175 | ":libgui_bufferqueue_sources", |
| 176 | ], |
Chong Zhang | dbfaf4d | 2019-05-03 10:33:18 -0700 | [diff] [blame] | 177 | } |
| 178 | |
Lloyd Pique | 1ebe090 | 2019-10-04 14:47:13 -0700 | [diff] [blame] | 179 | filegroup { |
| 180 | name: "libgui_bufferqueue_sources", |
Chong Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 181 | srcs: [ |
Yin-Chia Yeh | 64ee5f5 | 2020-01-02 17:53:18 +0700 | [diff] [blame] | 182 | "BatchBufferOps.cpp", |
Chong Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 183 | "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 Yeh | 64ee5f5 | 2020-01-02 17:53:18 +0700 | [diff] [blame] | 193 | "IGraphicBufferProducerFlattenables.cpp", |
Chong Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 194 | "bufferqueue/1.0/Conversion.cpp", |
Chong Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 195 | "bufferqueue/1.0/H2BProducerListener.cpp", |
| 196 | "bufferqueue/1.0/WProducerListener.cpp", |
| 197 | "bufferqueue/2.0/B2HGraphicBufferProducer.cpp", |
Chong Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 198 | "bufferqueue/2.0/H2BProducerListener.cpp", |
| 199 | "bufferqueue/2.0/types.cpp", |
| 200 | ], |
Lloyd Pique | 1ebe090 | 2019-10-04 14:47:13 -0700 | [diff] [blame] | 201 | } |
| 202 | |
| 203 | // Common build config shared by libgui and libgui_bufferqueue_static. |
| 204 | cc_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 Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 226 | |
David Stevens | 7347f0b | 2020-01-15 20:19:22 +0900 | [diff] [blame] | 227 | whole_static_libs: [ |
| 228 | "LibGuiProperties", |
| 229 | ], |
| 230 | |
Chong Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 231 | 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 Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 238 | "libcutils", |
| 239 | "libEGL", |
| 240 | "libGLESv2", |
| 241 | "libhidlbase", |
Chong Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 242 | "liblog", |
| 243 | "libnativewindow", |
| 244 | "libsync", |
| 245 | "libui", |
| 246 | "libutils", |
| 247 | "libvndksupport", |
| 248 | ], |
| 249 | |
Steven Moreland | 2b3f3cd | 2020-01-31 14:56:45 -0800 | [diff] [blame] | 250 | static_libs: [ |
| 251 | "libbinderthreadstateutils", |
| 252 | ], |
| 253 | |
Chong Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 254 | header_libs: [ |
| 255 | "libgui_headers", |
| 256 | "libnativebase_headers", |
| 257 | ], |
| 258 | |
Ady Abraham | 62f216c | 2020-10-13 19:07:23 -0700 | [diff] [blame] | 259 | include_dirs: [ |
| 260 | "frameworks/native/include", |
| 261 | ], |
| 262 | |
Chong Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 263 | export_shared_lib_headers: [ |
Chong Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 264 | "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 Pique | 1ebe090 | 2019-10-04 14:47:13 -0700 | [diff] [blame] | 283 | // GMocks for use by external code |
| 284 | cc_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 Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 300 | subdirs = ["tests"] |