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 | 3c53823 | 2021-02-12 21:26:48 -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 | |
| 42 | cc_library_shared { |
| 43 | name: "libgui", |
Justin Yun | 0b9bc01 | 2021-01-05 17:39:05 +0900 | [diff] [blame] | 44 | vendor_available: true, |
Justin Yun | 71d6c885 | 2017-07-24 15:19:45 +0900 | [diff] [blame] | 45 | vndk: { |
| 46 | enabled: true, |
Justin Yun | 0b9bc01 | 2021-01-05 17:39:05 +0900 | [diff] [blame] | 47 | private: true, |
Justin Yun | 71d6c885 | 2017-07-24 15:19:45 +0900 | [diff] [blame] | 48 | }, |
Jiyong Park | a75d3d6 | 2018-04-09 12:16:30 +0900 | [diff] [blame] | 49 | double_loadable: true, |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 50 | |
Chong Zhang | dbfaf4d | 2019-05-03 10:33:18 -0700 | [diff] [blame] | 51 | defaults: ["libgui_bufferqueue-defaults"], |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 52 | |
| 53 | srcs: [ |
Daichi Hirono | f474d3d | 2019-11-05 08:54:07 +0900 | [diff] [blame] | 54 | ":framework_native_aidl", |
Lloyd Pique | 1ebe090 | 2019-10-04 14:47:13 -0700 | [diff] [blame] | 55 | ":libgui_bufferqueue_sources", |
| 56 | |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 57 | "BitTube.cpp", |
Robert Carr | 78c25dd | 2019-08-15 14:10:33 -0700 | [diff] [blame] | 58 | "BLASTBufferQueue.cpp", |
Jiwen 'Steve' Cai | a2a27b2 | 2018-02-07 17:29:56 -0800 | [diff] [blame] | 59 | "BufferHubConsumer.cpp", |
Jiwen 'Steve' Cai | 0f95084 | 2018-01-16 17:05:54 -0800 | [diff] [blame] | 60 | "BufferHubProducer.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 61 | "BufferItemConsumer.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 62 | "ConsumerBase.cpp", |
| 63 | "CpuConsumer.cpp", |
Ady Abraham | a3b08ef | 2019-07-15 18:43:10 -0700 | [diff] [blame] | 64 | "DebugEGLImageTracker.cpp", |
Alec Mouri | 77a5387 | 2019-10-28 16:44:36 -0700 | [diff] [blame] | 65 | "DisplayEventDispatcher.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 66 | "DisplayEventReceiver.cpp", |
| 67 | "GLConsumer.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 68 | "GuiConfig.cpp", |
Chong Zhang | 6249309 | 2020-01-15 16:04:47 -0800 | [diff] [blame] | 69 | "IConsumerListener.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 70 | "IDisplayEventConnection.cpp", |
Chong Zhang | 6249309 | 2020-01-15 16:04:47 -0800 | [diff] [blame] | 71 | "IGraphicBufferConsumer.cpp", |
| 72 | "IGraphicBufferProducer.cpp", |
| 73 | "IProducerListener.cpp", |
Dan Stoza | 84ab937 | 2018-12-17 15:27:57 -0800 | [diff] [blame] | 74 | "IRegionSamplingListener.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 75 | "ISurfaceComposer.cpp", |
| 76 | "ISurfaceComposerClient.cpp", |
Marissa Wall | 7a9b6ff | 2018-08-21 17:26:20 -0700 | [diff] [blame] | 77 | "ITransactionCompletedListener.cpp", |
Kalle Raita | a099a24 | 2017-01-11 11:17:29 -0800 | [diff] [blame] | 78 | "LayerDebugInfo.cpp", |
Evan Rosky | 1f6d6d5 | 2018-12-06 10:47:26 -0800 | [diff] [blame] | 79 | "LayerMetadata.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 80 | "LayerState.cpp", |
Chong Zhang | 6249309 | 2020-01-15 16:04:47 -0800 | [diff] [blame] | 81 | "OccupancyTracker.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 82 | "StreamSplitter.cpp", |
| 83 | "Surface.cpp", |
| 84 | "SurfaceControl.cpp", |
| 85 | "SurfaceComposerClient.cpp", |
| 86 | "SyncFeatures.cpp", |
Mathias Agopian | 05debe1 | 2017-02-08 17:04:18 -0800 | [diff] [blame] | 87 | "view/Surface.cpp", |
Chong Zhang | 6249309 | 2020-01-15 16:04:47 -0800 | [diff] [blame] | 88 | "bufferqueue/1.0/B2HProducerListener.cpp", |
| 89 | "bufferqueue/1.0/H2BGraphicBufferProducer.cpp", |
| 90 | "bufferqueue/2.0/B2HProducerListener.cpp", |
| 91 | "bufferqueue/2.0/H2BGraphicBufferProducer.cpp", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 92 | ], |
| 93 | |
| 94 | shared_libs: [ |
Fan Xu | 021776e | 2018-12-05 13:34:48 -0800 | [diff] [blame] | 95 | "android.frameworks.bufferhub@1.0", |
Chong Zhang | 6249309 | 2020-01-15 16:04:47 -0800 | [diff] [blame] | 96 | "libbinder", |
Jiwen 'Steve' Cai | 57ae3ee | 2018-05-03 17:51:52 -0700 | [diff] [blame] | 97 | "libbufferhub", |
Lloyd Pique | 3b74578 | 2018-08-31 17:34:40 -0700 | [diff] [blame] | 98 | "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui. |
Pawin Vongmasa | e672cd0 | 2019-02-14 16:01:29 -0800 | [diff] [blame] | 99 | "libinput", |
Pawin Vongmasa | e672cd0 | 2019-02-14 16:01:29 -0800 | [diff] [blame] | 100 | "libpdx_default_transport", |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 101 | ], |
| 102 | |
Chong Zhang | 6249309 | 2020-01-15 16:04:47 -0800 | [diff] [blame] | 103 | export_shared_lib_headers: [ |
| 104 | "libbinder", |
| 105 | ], |
| 106 | |
Jiyong Park | a75d3d6 | 2018-04-09 12:16:30 +0900 | [diff] [blame] | 107 | // bufferhub is not used when building libgui for vendors |
| 108 | target: { |
| 109 | vendor: { |
Jayant Chowdhary | ad9fe27 | 2019-03-07 22:36:06 -0800 | [diff] [blame] | 110 | cflags: [ |
| 111 | "-DNO_BUFFERHUB", |
| 112 | "-DNO_INPUT", |
| 113 | ], |
Jiyong Park | a75d3d6 | 2018-04-09 12:16:30 +0900 | [diff] [blame] | 114 | exclude_srcs: [ |
| 115 | "BufferHubConsumer.cpp", |
| 116 | "BufferHubProducer.cpp", |
| 117 | ], |
| 118 | exclude_shared_libs: [ |
Fan Xu | 021776e | 2018-12-05 13:34:48 -0800 | [diff] [blame] | 119 | "android.frameworks.bufferhub@1.0", |
Jiwen 'Steve' Cai | 57ae3ee | 2018-05-03 17:51:52 -0700 | [diff] [blame] | 120 | "libbufferhub", |
Jiyong Park | a75d3d6 | 2018-04-09 12:16:30 +0900 | [diff] [blame] | 121 | "libbufferhubqueue", |
Jayant Chowdhary | ad9fe27 | 2019-03-07 22:36:06 -0800 | [diff] [blame] | 122 | "libinput", |
Pawin Vongmasa | e672cd0 | 2019-02-14 16:01:29 -0800 | [diff] [blame] | 123 | "libpdx_default_transport", |
Jiyong Park | a75d3d6 | 2018-04-09 12:16:30 +0900 | [diff] [blame] | 124 | ], |
| 125 | }, |
| 126 | }, |
| 127 | |
Mathias Agopian | 6a3c05b | 2017-04-27 20:06:55 -0700 | [diff] [blame] | 128 | header_libs: [ |
Jiwen 'Steve' Cai | 0f95084 | 2018-01-16 17:05:54 -0800 | [diff] [blame] | 129 | "libdvr_headers", |
Jiyong Park | a75d3d6 | 2018-04-09 12:16:30 +0900 | [diff] [blame] | 130 | "libpdx_headers", |
Mathias Agopian | 6a3c05b | 2017-04-27 20:06:55 -0700 | [diff] [blame] | 131 | ], |
Daichi Hirono | f474d3d | 2019-11-05 08:54:07 +0900 | [diff] [blame] | 132 | |
| 133 | aidl: { |
| 134 | export_aidl_headers: true, |
Yi Kong | ccc1c7c | 2021-02-22 17:44:17 +0800 | [diff] [blame^] | 135 | }, |
| 136 | |
| 137 | pgo: { |
| 138 | sampling: true, |
| 139 | profile_file: "libgui/libgui.profdata", |
| 140 | }, |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 141 | } |
| 142 | |
Chong Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 143 | // Used by media codec services exclusively as a static lib for |
Chong Zhang | dbfaf4d | 2019-05-03 10:33:18 -0700 | [diff] [blame] | 144 | // core bufferqueue support only. |
Chong Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 145 | cc_library_static { |
| 146 | name: "libgui_bufferqueue_static", |
| 147 | vendor_available: true, |
Jooyung Han | 54042e0 | 2020-05-13 16:04:07 +0900 | [diff] [blame] | 148 | apex_available: [ |
| 149 | "//apex_available:platform", |
| 150 | "com.android.media.swcodec", |
| 151 | ], |
| 152 | min_sdk_version: "29", |
Chong Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 153 | |
Chong Zhang | dbfaf4d | 2019-05-03 10:33:18 -0700 | [diff] [blame] | 154 | cflags: [ |
| 155 | "-DNO_BUFFERHUB", |
Chong Zhang | 6249309 | 2020-01-15 16:04:47 -0800 | [diff] [blame] | 156 | "-DNO_BINDER", |
Chong Zhang | dbfaf4d | 2019-05-03 10:33:18 -0700 | [diff] [blame] | 157 | ], |
| 158 | |
| 159 | defaults: ["libgui_bufferqueue-defaults"], |
Lloyd Pique | 1ebe090 | 2019-10-04 14:47:13 -0700 | [diff] [blame] | 160 | |
| 161 | srcs: [ |
| 162 | ":libgui_bufferqueue_sources", |
| 163 | ], |
Chong Zhang | dbfaf4d | 2019-05-03 10:33:18 -0700 | [diff] [blame] | 164 | } |
| 165 | |
Lloyd Pique | 1ebe090 | 2019-10-04 14:47:13 -0700 | [diff] [blame] | 166 | filegroup { |
| 167 | name: "libgui_bufferqueue_sources", |
Chong Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 168 | srcs: [ |
| 169 | "BufferItem.cpp", |
| 170 | "BufferQueue.cpp", |
| 171 | "BufferQueueConsumer.cpp", |
| 172 | "BufferQueueCore.cpp", |
| 173 | "BufferQueueProducer.cpp", |
| 174 | "BufferQueueThreadState.cpp", |
| 175 | "BufferSlot.cpp", |
| 176 | "FrameTimestamps.cpp", |
| 177 | "GLConsumerUtils.cpp", |
| 178 | "HdrMetadata.cpp", |
Chong Zhang | 6249309 | 2020-01-15 16:04:47 -0800 | [diff] [blame] | 179 | "QueueBufferInputOutput.cpp", |
Chong Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 180 | "bufferqueue/1.0/Conversion.cpp", |
Chong Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 181 | "bufferqueue/1.0/H2BProducerListener.cpp", |
| 182 | "bufferqueue/1.0/WProducerListener.cpp", |
| 183 | "bufferqueue/2.0/B2HGraphicBufferProducer.cpp", |
Chong Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 184 | "bufferqueue/2.0/H2BProducerListener.cpp", |
| 185 | "bufferqueue/2.0/types.cpp", |
| 186 | ], |
Lloyd Pique | 1ebe090 | 2019-10-04 14:47:13 -0700 | [diff] [blame] | 187 | } |
| 188 | |
| 189 | // Common build config shared by libgui and libgui_bufferqueue_static. |
| 190 | cc_defaults { |
| 191 | name: "libgui_bufferqueue-defaults", |
| 192 | |
| 193 | clang: true, |
| 194 | cflags: [ |
| 195 | "-Wall", |
| 196 | "-Werror", |
| 197 | ], |
| 198 | |
| 199 | cppflags: [ |
| 200 | "-Wextra", |
| 201 | "-DDEBUG_ONLY_CODE=0", |
| 202 | ], |
| 203 | |
| 204 | product_variables: { |
| 205 | eng: { |
| 206 | cppflags: [ |
| 207 | "-UDEBUG_ONLY_CODE", |
| 208 | "-DDEBUG_ONLY_CODE=1", |
| 209 | ], |
| 210 | }, |
| 211 | }, |
Chong Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 212 | |
David Stevens | 7347f0b | 2020-01-15 20:19:22 +0900 | [diff] [blame] | 213 | whole_static_libs: [ |
| 214 | "LibGuiProperties", |
| 215 | ], |
| 216 | |
Chong Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 217 | shared_libs: [ |
| 218 | "android.hardware.graphics.bufferqueue@1.0", |
| 219 | "android.hardware.graphics.bufferqueue@2.0", |
| 220 | "android.hardware.graphics.common@1.1", |
| 221 | "android.hardware.graphics.common@1.2", |
| 222 | "android.hidl.token@1.0-utils", |
| 223 | "libbase", |
Chong Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 224 | "libcutils", |
| 225 | "libEGL", |
| 226 | "libGLESv2", |
| 227 | "libhidlbase", |
Chong Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 228 | "liblog", |
| 229 | "libnativewindow", |
| 230 | "libsync", |
| 231 | "libui", |
| 232 | "libutils", |
| 233 | "libvndksupport", |
| 234 | ], |
| 235 | |
Steven Moreland | 2b3f3cd | 2020-01-31 14:56:45 -0800 | [diff] [blame] | 236 | static_libs: [ |
| 237 | "libbinderthreadstateutils", |
| 238 | ], |
| 239 | |
Chong Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 240 | header_libs: [ |
| 241 | "libgui_headers", |
| 242 | "libnativebase_headers", |
| 243 | ], |
| 244 | |
| 245 | export_shared_lib_headers: [ |
Chong Zhang | 60fa4fd | 2019-04-19 10:00:27 -0700 | [diff] [blame] | 246 | "libEGL", |
| 247 | "libnativewindow", |
| 248 | "libui", |
| 249 | "android.hardware.graphics.bufferqueue@1.0", |
| 250 | "android.hardware.graphics.bufferqueue@2.0", |
| 251 | "android.hardware.graphics.common@1.1", |
| 252 | "android.hardware.graphics.common@1.2", |
| 253 | "android.hidl.token@1.0-utils", |
| 254 | ], |
| 255 | |
| 256 | export_header_lib_headers: [ |
| 257 | "libgui_headers", |
| 258 | ], |
| 259 | |
| 260 | export_include_dirs: [ |
| 261 | "include", |
| 262 | ], |
| 263 | } |
| 264 | |
Lloyd Pique | 1ebe090 | 2019-10-04 14:47:13 -0700 | [diff] [blame] | 265 | // GMocks for use by external code |
| 266 | cc_library_static { |
| 267 | name: "libgui_mocks", |
| 268 | vendor_available: false, |
| 269 | |
| 270 | defaults: ["libgui_bufferqueue-defaults"], |
| 271 | static_libs: [ |
| 272 | "libgtest", |
| 273 | "libgmock", |
| 274 | ], |
| 275 | |
| 276 | srcs: [ |
| 277 | "mock/GraphicBufferConsumer.cpp", |
| 278 | "mock/GraphicBufferProducer.cpp", |
| 279 | ], |
| 280 | } |
| 281 | |
Dan Willemsen | 3106c1c | 2016-10-03 23:56:51 -0700 | [diff] [blame] | 282 | subdirs = ["tests"] |