• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
14cc_library_headers {
15    name: "libgui_headers",
16    vendor_available: true,
17    export_include_dirs: ["include"],
18
19    // we must build this module to get the required header as that is generated
20    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    ],
30    min_sdk_version: "29",
31}
32
33cc_library_shared {
34    name: "libgui",
35    vendor_available: false,
36    vndk: {
37        enabled: true,
38    },
39    double_loadable: true,
40
41    defaults: ["libgui_bufferqueue-defaults"],
42
43    srcs: [
44        ":framework_native_aidl",
45        ":libgui_bufferqueue_sources",
46
47        "BitTube.cpp",
48        "BLASTBufferQueue.cpp",
49        "BufferHubConsumer.cpp",
50        "BufferHubProducer.cpp",
51        "BufferItemConsumer.cpp",
52        "ConsumerBase.cpp",
53        "CpuConsumer.cpp",
54        "DebugEGLImageTracker.cpp",
55        "DisplayEventDispatcher.cpp",
56        "DisplayEventReceiver.cpp",
57        "GLConsumer.cpp",
58        "GuiConfig.cpp",
59        "IConsumerListener.cpp",
60        "IDisplayEventConnection.cpp",
61        "IGraphicBufferConsumer.cpp",
62        "IGraphicBufferProducer.cpp",
63        "IProducerListener.cpp",
64        "IRegionSamplingListener.cpp",
65        "ISurfaceComposer.cpp",
66        "ISurfaceComposerClient.cpp",
67        "ITransactionCompletedListener.cpp",
68        "LayerDebugInfo.cpp",
69        "LayerMetadata.cpp",
70        "LayerState.cpp",
71        "OccupancyTracker.cpp",
72        "StreamSplitter.cpp",
73        "Surface.cpp",
74        "SurfaceControl.cpp",
75        "SurfaceComposerClient.cpp",
76        "SyncFeatures.cpp",
77        "view/Surface.cpp",
78        "bufferqueue/1.0/B2HProducerListener.cpp",
79        "bufferqueue/1.0/H2BGraphicBufferProducer.cpp",
80        "bufferqueue/2.0/B2HProducerListener.cpp",
81        "bufferqueue/2.0/H2BGraphicBufferProducer.cpp",
82    ],
83
84    shared_libs: [
85        "android.frameworks.bufferhub@1.0",
86        "libbinder",
87        "libbufferhub",
88        "libbufferhubqueue", // TODO(b/70046255): Remove this once BufferHub is integrated into libgui.
89        "libinput",
90        "libpdx_default_transport",
91    ],
92
93    export_shared_lib_headers: [
94        "libbinder",
95    ],
96
97    // bufferhub is not used when building libgui for vendors
98    target: {
99        vendor: {
100            cflags: [
101                "-DNO_BUFFERHUB",
102                "-DNO_INPUT",
103            ],
104            exclude_srcs: [
105                "BufferHubConsumer.cpp",
106                "BufferHubProducer.cpp",
107            ],
108            exclude_shared_libs: [
109                "android.frameworks.bufferhub@1.0",
110                "libbufferhub",
111                "libbufferhubqueue",
112                "libinput",
113                "libpdx_default_transport",
114            ],
115        },
116    },
117
118    header_libs: [
119        "libdvr_headers",
120        "libpdx_headers",
121    ],
122
123    aidl: {
124        export_aidl_headers: true,
125    }
126}
127
128// Used by media codec services exclusively as a static lib for
129// core bufferqueue support only.
130cc_library_static {
131    name: "libgui_bufferqueue_static",
132    vendor_available: true,
133    apex_available: [
134        "//apex_available:platform",
135        "com.android.media.swcodec",
136    ],
137    min_sdk_version: "29",
138
139    cflags: [
140        "-DNO_BUFFERHUB",
141        "-DNO_BINDER",
142    ],
143
144    defaults: ["libgui_bufferqueue-defaults"],
145
146    srcs: [
147        ":libgui_bufferqueue_sources",
148    ],
149}
150
151filegroup {
152    name: "libgui_bufferqueue_sources",
153    srcs: [
154        "BufferItem.cpp",
155        "BufferQueue.cpp",
156        "BufferQueueConsumer.cpp",
157        "BufferQueueCore.cpp",
158        "BufferQueueProducer.cpp",
159        "BufferQueueThreadState.cpp",
160        "BufferSlot.cpp",
161        "FrameTimestamps.cpp",
162        "GLConsumerUtils.cpp",
163        "HdrMetadata.cpp",
164        "QueueBufferInputOutput.cpp",
165        "bufferqueue/1.0/Conversion.cpp",
166        "bufferqueue/1.0/H2BProducerListener.cpp",
167        "bufferqueue/1.0/WProducerListener.cpp",
168        "bufferqueue/2.0/B2HGraphicBufferProducer.cpp",
169        "bufferqueue/2.0/H2BProducerListener.cpp",
170        "bufferqueue/2.0/types.cpp",
171    ],
172}
173
174// Common build config shared by libgui and libgui_bufferqueue_static.
175cc_defaults {
176    name: "libgui_bufferqueue-defaults",
177
178    clang: true,
179    cflags: [
180        "-Wall",
181        "-Werror",
182    ],
183
184    cppflags: [
185        "-Wextra",
186        "-DDEBUG_ONLY_CODE=0",
187    ],
188
189    product_variables: {
190        eng: {
191            cppflags: [
192                "-UDEBUG_ONLY_CODE",
193                "-DDEBUG_ONLY_CODE=1",
194            ],
195        },
196    },
197
198    whole_static_libs: [
199        "LibGuiProperties",
200    ],
201
202    shared_libs: [
203        "android.hardware.graphics.bufferqueue@1.0",
204        "android.hardware.graphics.bufferqueue@2.0",
205        "android.hardware.graphics.common@1.1",
206        "android.hardware.graphics.common@1.2",
207        "android.hidl.token@1.0-utils",
208        "libbase",
209        "libcutils",
210        "libEGL",
211        "libGLESv2",
212        "libhidlbase",
213        "liblog",
214        "libnativewindow",
215        "libsync",
216        "libui",
217        "libutils",
218        "libvndksupport",
219    ],
220
221    static_libs: [
222        "libbinderthreadstateutils",
223    ],
224
225    header_libs: [
226        "libgui_headers",
227        "libnativebase_headers",
228    ],
229
230    export_shared_lib_headers: [
231        "libEGL",
232        "libnativewindow",
233        "libui",
234        "android.hardware.graphics.bufferqueue@1.0",
235        "android.hardware.graphics.bufferqueue@2.0",
236        "android.hardware.graphics.common@1.1",
237        "android.hardware.graphics.common@1.2",
238        "android.hidl.token@1.0-utils",
239    ],
240
241    export_header_lib_headers: [
242        "libgui_headers",
243    ],
244
245    export_include_dirs: [
246        "include",
247    ],
248}
249
250// GMocks for use by external code
251cc_library_static {
252    name: "libgui_mocks",
253    vendor_available: false,
254
255    defaults: ["libgui_bufferqueue-defaults"],
256    static_libs: [
257        "libgtest",
258        "libgmock",
259    ],
260
261    srcs: [
262        "mock/GraphicBufferConsumer.cpp",
263        "mock/GraphicBufferProducer.cpp",
264    ],
265}
266
267subdirs = ["tests"]
268