Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2018 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | /** |
| 18 | * @addtogroup NativeActivity Native Activity |
| 19 | * @{ |
| 20 | */ |
| 21 | |
| 22 | /** |
| 23 | * @file surface_control.h |
| 24 | */ |
| 25 | |
| 26 | #ifndef ANDROID_SURFACE_CONTROL_H |
| 27 | #define ANDROID_SURFACE_CONTROL_H |
| 28 | |
| 29 | #include <sys/cdefs.h> |
| 30 | |
Marissa Wall | 3ff826c | 2019-02-07 11:58:25 -0800 | [diff] [blame] | 31 | #include <android/data_space.h> |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 32 | #include <android/hardware_buffer.h> |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 33 | #include <android/hdr_metadata.h> |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 34 | #include <android/native_window.h> |
| 35 | |
| 36 | __BEGIN_DECLS |
| 37 | |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 38 | struct ASurfaceControl; |
| 39 | |
| 40 | /** |
Elliott Hughes | 733bf99 | 2019-03-08 11:25:28 -0800 | [diff] [blame] | 41 | * The SurfaceControl API can be used to provide a hierarchy of surfaces for |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 42 | * composition to the system compositor. ASurfaceControl represents a content node in |
Elliott Hughes | 733bf99 | 2019-03-08 11:25:28 -0800 | [diff] [blame] | 43 | * this hierarchy. |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 44 | */ |
| 45 | typedef struct ASurfaceControl ASurfaceControl; |
| 46 | |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 47 | /** |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 48 | * Creates an ASurfaceControl with either ANativeWindow or an ASurfaceControl as its parent. |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 49 | * \a debug_name is a debug name associated with this surface. It can be used to |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 50 | * identify this surface in the SurfaceFlinger's layer tree. It must not be |
| 51 | * null. |
| 52 | * |
| 53 | * The caller takes ownership of the ASurfaceControl returned and must release it |
| 54 | * using ASurfaceControl_release below. |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 55 | * |
| 56 | * Available since API level 29. |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 57 | */ |
| 58 | ASurfaceControl* ASurfaceControl_createFromWindow(ANativeWindow* parent, const char* debug_name) |
| 59 | __INTRODUCED_IN(29); |
| 60 | |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 61 | /** |
| 62 | * See ASurfaceControl_createFromWindow. |
| 63 | * |
| 64 | * Available since API level 29. |
| 65 | */ |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 66 | ASurfaceControl* ASurfaceControl_create(ASurfaceControl* parent, const char* debug_name) |
| 67 | __INTRODUCED_IN(29); |
| 68 | |
| 69 | /** |
Huihong Luo | db5778e | 2021-01-28 14:48:59 -0800 | [diff] [blame] | 70 | * Acquires a reference on the given ASurfaceControl object. This prevents the object |
| 71 | * from being deleted until the reference is removed. |
| 72 | * |
| 73 | * To release the reference, use the ASurfaceControl_release function. |
| 74 | * |
| 75 | * Available since API level 31. |
| 76 | */ |
| 77 | void ASurfaceControl_acquire(ASurfaceControl* surface_control) __INTRODUCED_IN(31); |
| 78 | |
| 79 | /** |
| 80 | * Removes a reference that was previously acquired with one of the following functions: |
| 81 | * ASurfaceControl_createFromWindow |
| 82 | * ASurfaceControl_create |
| 83 | * ANativeWindow_acquire |
| 84 | * The surface and its children may remain on display as long as their parent remains on display. |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 85 | * |
| 86 | * Available since API level 29. |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 87 | */ |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 88 | void ASurfaceControl_release(ASurfaceControl* surface_control) __INTRODUCED_IN(29); |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 89 | |
| 90 | struct ASurfaceTransaction; |
| 91 | |
| 92 | /** |
| 93 | * ASurfaceTransaction is a collection of updates to the surface tree that must |
| 94 | * be applied atomically. |
| 95 | */ |
| 96 | typedef struct ASurfaceTransaction ASurfaceTransaction; |
| 97 | |
| 98 | /** |
| 99 | * The caller takes ownership of the transaction and must release it using |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 100 | * ASurfaceTransaction_delete() below. |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 101 | * |
| 102 | * Available since API level 29. |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 103 | */ |
| 104 | ASurfaceTransaction* ASurfaceTransaction_create() __INTRODUCED_IN(29); |
| 105 | |
| 106 | /** |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 107 | * Destroys the \a transaction object. |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 108 | * |
| 109 | * Available since API level 29. |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 110 | */ |
| 111 | void ASurfaceTransaction_delete(ASurfaceTransaction* transaction) __INTRODUCED_IN(29); |
| 112 | |
| 113 | /** |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 114 | * Applies the updates accumulated in \a transaction. |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 115 | * |
| 116 | * Note that the transaction is guaranteed to be applied atomically. The |
| 117 | * transactions which are applied on the same thread are also guaranteed to be |
| 118 | * applied in order. |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 119 | * |
| 120 | * Available since API level 29. |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 121 | */ |
| 122 | void ASurfaceTransaction_apply(ASurfaceTransaction* transaction) __INTRODUCED_IN(29); |
| 123 | |
| 124 | /** |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 125 | * An opaque handle returned during a callback that can be used to query general stats and stats for |
| 126 | * surfaces which were either removed or for which buffers were updated after this transaction was |
| 127 | * applied. |
| 128 | */ |
| 129 | typedef struct ASurfaceTransactionStats ASurfaceTransactionStats; |
| 130 | |
| 131 | /** |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 132 | * Since the transactions are applied asynchronously, the |
| 133 | * ASurfaceTransaction_OnComplete callback can be used to be notified when a frame |
| 134 | * including the updates in a transaction was presented. |
| 135 | * |
Robert Carr | 1108579 | 2021-05-12 14:35:35 -0700 | [diff] [blame] | 136 | * Buffers which are replaced or removed from the scene in the transaction invoking |
| 137 | * this callback may be reused after this point. |
| 138 | * |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 139 | * \param context Optional context provided by the client that is passed into |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 140 | * the callback. |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 141 | * |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 142 | * \param stats Opaque handle that can be passed to ASurfaceTransactionStats functions to query |
Elliott Hughes | 733bf99 | 2019-03-08 11:25:28 -0800 | [diff] [blame] | 143 | * information about the transaction. The handle is only valid during the callback. |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 144 | * |
| 145 | * THREADING |
| 146 | * The transaction completed callback can be invoked on any thread. |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 147 | * |
| 148 | * Available since API level 29. |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 149 | */ |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 150 | typedef void (*ASurfaceTransaction_OnComplete)(void* context, ASurfaceTransactionStats* stats) |
| 151 | __INTRODUCED_IN(29); |
| 152 | |
Vishnu Nair | fc46c1e | 2021-04-21 08:31:32 -0700 | [diff] [blame] | 153 | |
| 154 | /** |
| 155 | * The ASurfaceTransaction_OnCommit callback is invoked when transaction is applied and the updates |
| 156 | * are ready to be presented. This callback will be invoked before the |
| 157 | * ASurfaceTransaction_OnComplete callback. |
| 158 | * |
Robert Carr | 1108579 | 2021-05-12 14:35:35 -0700 | [diff] [blame] | 159 | * This callback does not mean buffers have been released! It simply means that any new |
| 160 | * transactions applied will not overwrite the transaction for which we are receiving |
| 161 | * a callback and instead will be included in the next frame. If you are trying to avoid |
| 162 | * dropping frames (overwriting transactions), and unable to use timestamps (Which provide |
| 163 | * a more efficient solution), then this method provides a method to pace your transaction |
| 164 | * application. |
| 165 | * |
Vishnu Nair | fc46c1e | 2021-04-21 08:31:32 -0700 | [diff] [blame] | 166 | * \param context Optional context provided by the client that is passed into the callback. |
| 167 | * |
| 168 | * \param stats Opaque handle that can be passed to ASurfaceTransactionStats functions to query |
| 169 | * information about the transaction. The handle is only valid during the callback. |
| 170 | * Present and release fences are not available for this callback. Querying them using |
| 171 | * ASurfaceTransactionStats_getPresentFenceFd and ASurfaceTransactionStats_getPreviousReleaseFenceFd |
| 172 | * will result in failure. |
| 173 | * |
| 174 | * THREADING |
| 175 | * The transaction committed callback can be invoked on any thread. |
| 176 | * |
| 177 | * Available since API level 31. |
| 178 | */ |
| 179 | typedef void (*ASurfaceTransaction_OnCommit)(void* context, ASurfaceTransactionStats* stats) |
| 180 | __INTRODUCED_IN(31); |
| 181 | |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 182 | /** |
| 183 | * Returns the timestamp of when the frame was latched by the framework. Once a frame is |
| 184 | * latched by the framework, it is presented at the following hardware vsync. |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 185 | * |
| 186 | * Available since API level 29. |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 187 | */ |
| 188 | int64_t ASurfaceTransactionStats_getLatchTime(ASurfaceTransactionStats* surface_transaction_stats) |
| 189 | __INTRODUCED_IN(29); |
| 190 | |
| 191 | /** |
| 192 | * Returns a sync fence that signals when the transaction has been presented. |
| 193 | * The recipient of the callback takes ownership of the fence and is responsible for closing |
Marissa Wall | 183c44c | 2019-04-08 12:58:50 -0700 | [diff] [blame] | 194 | * it. If a device does not support present fences, a -1 will be returned. |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 195 | * |
Vishnu Nair | fc46c1e | 2021-04-21 08:31:32 -0700 | [diff] [blame] | 196 | * This query is not valid for ASurfaceTransaction_OnCommit callback. |
| 197 | * |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 198 | * Available since API level 29. |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 199 | */ |
| 200 | int ASurfaceTransactionStats_getPresentFenceFd(ASurfaceTransactionStats* surface_transaction_stats) |
| 201 | __INTRODUCED_IN(29); |
| 202 | |
| 203 | /** |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 204 | * \a outASurfaceControls returns an array of ASurfaceControl pointers that were updated during the |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 205 | * transaction. Stats for the surfaces can be queried through ASurfaceTransactionStats functions. |
| 206 | * When the client is done using the array, it must release it by calling |
| 207 | * ASurfaceTransactionStats_releaseASurfaceControls. |
| 208 | * |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 209 | * Available since API level 29. |
| 210 | * |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 211 | * \a outASurfaceControlsSize returns the size of the ASurfaceControls array. |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 212 | */ |
| 213 | void ASurfaceTransactionStats_getASurfaceControls(ASurfaceTransactionStats* surface_transaction_stats, |
| 214 | ASurfaceControl*** outASurfaceControls, |
| 215 | size_t* outASurfaceControlsSize) |
| 216 | __INTRODUCED_IN(29); |
| 217 | /** |
| 218 | * Releases the array of ASurfaceControls that were returned by |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 219 | * ASurfaceTransactionStats_getASurfaceControls(). |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 220 | * |
| 221 | * Available since API level 29. |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 222 | */ |
| 223 | void ASurfaceTransactionStats_releaseASurfaceControls(ASurfaceControl** surface_controls) |
| 224 | __INTRODUCED_IN(29); |
| 225 | |
| 226 | /** |
| 227 | * Returns the timestamp of when the CURRENT buffer was acquired. A buffer is considered |
| 228 | * acquired when its acquire_fence_fd has signaled. A buffer cannot be latched or presented until |
| 229 | * it is acquired. If no acquire_fence_fd was provided, this timestamp will be set to -1. |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 230 | * |
| 231 | * Available since API level 29. |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 232 | */ |
| 233 | int64_t ASurfaceTransactionStats_getAcquireTime(ASurfaceTransactionStats* surface_transaction_stats, |
| 234 | ASurfaceControl* surface_control) |
| 235 | __INTRODUCED_IN(29); |
| 236 | |
| 237 | /** |
| 238 | * The returns the fence used to signal the release of the PREVIOUS buffer set on |
| 239 | * this surface. If this fence is valid (>=0), the PREVIOUS buffer has not yet been released and the |
| 240 | * fence will signal when the PREVIOUS buffer has been released. If the fence is -1 , the PREVIOUS |
| 241 | * buffer is already released. The recipient of the callback takes ownership of the |
| 242 | * previousReleaseFenceFd and is responsible for closing it. |
| 243 | * |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 244 | * Each time a buffer is set through ASurfaceTransaction_setBuffer() on a transaction |
| 245 | * which is applied, the framework takes a ref on this buffer. The framework treats the |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 246 | * addition of a buffer to a particular surface as a unique ref. When a transaction updates or |
| 247 | * removes a buffer from a surface, or removes the surface itself from the tree, this ref is |
| 248 | * guaranteed to be released in the OnComplete callback for this transaction. The |
| 249 | * ASurfaceControlStats provided in the callback for this surface may contain an optional fence |
| 250 | * which must be signaled before the ref is assumed to be released. |
| 251 | * |
| 252 | * The client must ensure that all pending refs on a buffer are released before attempting to reuse |
| 253 | * this buffer, otherwise synchronization errors may occur. |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 254 | * |
Vishnu Nair | fc46c1e | 2021-04-21 08:31:32 -0700 | [diff] [blame] | 255 | * This query is not valid for ASurfaceTransaction_OnCommit callback. |
| 256 | * |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 257 | * Available since API level 29. |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 258 | */ |
| 259 | int ASurfaceTransactionStats_getPreviousReleaseFenceFd( |
| 260 | ASurfaceTransactionStats* surface_transaction_stats, |
| 261 | ASurfaceControl* surface_control) |
| 262 | __INTRODUCED_IN(29); |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 263 | |
| 264 | /** |
| 265 | * Sets the callback that will be invoked when the updates from this transaction |
| 266 | * are presented. For details on the callback semantics and data, see the |
| 267 | * comments on the ASurfaceTransaction_OnComplete declaration above. |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 268 | * |
| 269 | * Available since API level 29. |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 270 | */ |
| 271 | void ASurfaceTransaction_setOnComplete(ASurfaceTransaction* transaction, void* context, |
| 272 | ASurfaceTransaction_OnComplete func) __INTRODUCED_IN(29); |
| 273 | |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 274 | /** |
Vishnu Nair | fc46c1e | 2021-04-21 08:31:32 -0700 | [diff] [blame] | 275 | * Sets the callback that will be invoked when the updates from this transaction are applied and are |
| 276 | * ready to be presented. This callback will be invoked before the ASurfaceTransaction_OnComplete |
| 277 | * callback. |
| 278 | * |
| 279 | * Available since API level 31. |
| 280 | */ |
| 281 | void ASurfaceTransaction_setOnCommit(ASurfaceTransaction* transaction, void* context, |
| 282 | ASurfaceTransaction_OnCommit func) __INTRODUCED_IN(31); |
| 283 | |
| 284 | /** |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 285 | * Reparents the \a surface_control from its old parent to the \a new_parent surface control. |
| 286 | * Any children of the reparented \a surface_control will remain children of the \a surface_control. |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 287 | * |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 288 | * The \a new_parent can be null. Surface controls with a null parent do not appear on the display. |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 289 | * |
| 290 | * Available since API level 29. |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 291 | */ |
| 292 | void ASurfaceTransaction_reparent(ASurfaceTransaction* transaction, |
| 293 | ASurfaceControl* surface_control, ASurfaceControl* new_parent) |
| 294 | __INTRODUCED_IN(29); |
| 295 | |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 296 | /** |
| 297 | * Parameter for ASurfaceTransaction_setVisibility(). |
| 298 | */ |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 299 | enum { |
| 300 | ASURFACE_TRANSACTION_VISIBILITY_HIDE = 0, |
| 301 | ASURFACE_TRANSACTION_VISIBILITY_SHOW = 1, |
| 302 | }; |
| 303 | /** |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 304 | * Updates the visibility of \a surface_control. If show is set to |
| 305 | * ASURFACE_TRANSACTION_VISIBILITY_HIDE, the \a surface_control and all surfaces in its subtree will |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 306 | * be hidden. |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 307 | * |
| 308 | * Available since API level 29. |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 309 | */ |
| 310 | void ASurfaceTransaction_setVisibility(ASurfaceTransaction* transaction, |
| 311 | ASurfaceControl* surface_control, int8_t visibility) |
| 312 | __INTRODUCED_IN(29); |
| 313 | |
| 314 | /** |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 315 | * Updates the z order index for \a surface_control. Note that the z order for a surface |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 316 | * is relative to other surfaces which are siblings of this surface. The behavior of sibilings with |
| 317 | * the same z order is undefined. |
| 318 | * |
| 319 | * Z orders may be from MIN_INT32 to MAX_INT32. A layer's default z order index is 0. |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 320 | * |
| 321 | * Available since API level 29. |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 322 | */ |
| 323 | void ASurfaceTransaction_setZOrder(ASurfaceTransaction* transaction, |
| 324 | ASurfaceControl* surface_control, int32_t z_order) |
| 325 | __INTRODUCED_IN(29); |
| 326 | |
| 327 | /** |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 328 | * Updates the AHardwareBuffer displayed for \a surface_control. If not -1, the |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 329 | * acquire_fence_fd should be a file descriptor that is signaled when all pending work |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 330 | * for the buffer is complete and the buffer can be safely read. |
| 331 | * |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 332 | * The frameworks takes ownership of the \a acquire_fence_fd passed and is responsible |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 333 | * for closing it. |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 334 | * |
Ady Abraham | 38605fc | 2021-03-29 20:33:42 +0000 | [diff] [blame] | 335 | * Note that the buffer must be allocated with AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE |
| 336 | * as the surface control might be composited using the GPU. |
| 337 | * |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 338 | * Available since API level 29. |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 339 | */ |
| 340 | void ASurfaceTransaction_setBuffer(ASurfaceTransaction* transaction, |
| 341 | ASurfaceControl* surface_control, AHardwareBuffer* buffer, |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 342 | int acquire_fence_fd = -1) __INTRODUCED_IN(29); |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 343 | |
| 344 | /** |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 345 | * Updates the color for \a surface_control. This will make the background color for the |
| 346 | * ASurfaceControl visible in transparent regions of the surface. Colors \a r, \a g, |
| 347 | * and \a b must be within the range that is valid for \a dataspace. \a dataspace and \a alpha |
Valerie Hau | ed54efa | 2019-01-11 20:03:14 -0800 | [diff] [blame] | 348 | * will be the dataspace and alpha set for the background color layer. |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 349 | * |
| 350 | * Available since API level 29. |
Valerie Hau | ed54efa | 2019-01-11 20:03:14 -0800 | [diff] [blame] | 351 | */ |
| 352 | void ASurfaceTransaction_setColor(ASurfaceTransaction* transaction, |
| 353 | ASurfaceControl* surface_control, float r, float g, float b, |
| 354 | float alpha, ADataSpace dataspace) |
| 355 | __INTRODUCED_IN(29); |
| 356 | |
| 357 | /** |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 358 | * \param source The sub-rect within the buffer's content to be rendered inside the surface's area |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 359 | * The surface's source rect is clipped by the bounds of its current buffer. The source rect's width |
| 360 | * and height must be > 0. |
| 361 | * |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 362 | * \param destination Specifies the rect in the parent's space where this surface will be drawn. The post |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 363 | * source rect bounds are scaled to fit the destination rect. The surface's destination rect is |
| 364 | * clipped by the bounds of its parent. The destination rect's width and height must be > 0. |
| 365 | * |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 366 | * \param transform The transform applied after the source rect is applied to the buffer. This parameter |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 367 | * should be set to 0 for no transform. To specify a transfrom use the NATIVE_WINDOW_TRANSFORM_* |
| 368 | * enum. |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 369 | * |
| 370 | * Available since API level 29. |
chaviw | 1f5e740 | 2021-04-29 09:15:20 -0500 | [diff] [blame] | 371 | * |
| 372 | * @deprecated Use setCrop, setPosition, setBufferTransform, and setScale instead. Those functions |
| 373 | * provide well defined behavior and allows for more control by the apps. It also allows the caller |
| 374 | * to set different properties at different times, instead of having to specify all the desired |
| 375 | * properties at once. |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 376 | */ |
| 377 | void ASurfaceTransaction_setGeometry(ASurfaceTransaction* transaction, |
| 378 | ASurfaceControl* surface_control, const ARect& source, |
| 379 | const ARect& destination, int32_t transform) |
| 380 | __INTRODUCED_IN(29); |
| 381 | |
Vasiliy Telezhnikov | fb3ab5b | 2021-03-13 20:00:26 -0500 | [diff] [blame] | 382 | /** |
chaviw | be8d009 | 2021-03-29 18:49:46 -0500 | [diff] [blame] | 383 | * Bounds the surface and its children to the bounds specified. The crop and buffer size will be |
| 384 | * used to determine the bounds of the surface. If no crop is specified and the surface has no |
| 385 | * buffer, the surface bounds is only constrained by the size of its parent bounds. |
| 386 | * |
| 387 | * \param crop The bounds of the crop to apply. |
Vasiliy Telezhnikov | fb3ab5b | 2021-03-13 20:00:26 -0500 | [diff] [blame] | 388 | * |
| 389 | * Available since API level 31. |
| 390 | */ |
chaviw | be8d009 | 2021-03-29 18:49:46 -0500 | [diff] [blame] | 391 | void ASurfaceTransaction_setCrop(ASurfaceTransaction* transaction, |
| 392 | ASurfaceControl* surface_control, const ARect& crop) |
Vasiliy Telezhnikov | fb3ab5b | 2021-03-13 20:00:26 -0500 | [diff] [blame] | 393 | __INTRODUCED_IN(31); |
| 394 | |
| 395 | /** |
chaviw | be8d009 | 2021-03-29 18:49:46 -0500 | [diff] [blame] | 396 | * Specifies the position in the parent's space where the surface will be drawn. |
| 397 | * |
| 398 | * \param x The x position to render the surface. |
| 399 | * \param y The y position to render the surface. |
Vasiliy Telezhnikov | fb3ab5b | 2021-03-13 20:00:26 -0500 | [diff] [blame] | 400 | * |
| 401 | * Available since API level 31. |
| 402 | */ |
| 403 | void ASurfaceTransaction_setPosition(ASurfaceTransaction* transaction, |
chaviw | be8d009 | 2021-03-29 18:49:46 -0500 | [diff] [blame] | 404 | ASurfaceControl* surface_control, int32_t x, int32_t y) |
Vasiliy Telezhnikov | fb3ab5b | 2021-03-13 20:00:26 -0500 | [diff] [blame] | 405 | __INTRODUCED_IN(31); |
| 406 | |
| 407 | /** |
| 408 | * \param transform The transform applied after the source rect is applied to the buffer. This |
chaviw | be8d009 | 2021-03-29 18:49:46 -0500 | [diff] [blame] | 409 | * parameter should be set to 0 for no transform. To specify a transform use the |
Vasiliy Telezhnikov | fb3ab5b | 2021-03-13 20:00:26 -0500 | [diff] [blame] | 410 | * NATIVE_WINDOW_TRANSFORM_* enum. |
| 411 | * |
| 412 | * Available since API level 31. |
| 413 | */ |
chaviw | be8d009 | 2021-03-29 18:49:46 -0500 | [diff] [blame] | 414 | void ASurfaceTransaction_setBufferTransform(ASurfaceTransaction* transaction, |
Vasiliy Telezhnikov | fb3ab5b | 2021-03-13 20:00:26 -0500 | [diff] [blame] | 415 | ASurfaceControl* surface_control, int32_t transform) |
| 416 | __INTRODUCED_IN(31); |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 417 | |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 418 | /** |
chaviw | be8d009 | 2021-03-29 18:49:46 -0500 | [diff] [blame] | 419 | * Sets an x and y scale of a surface with (0, 0) as the centerpoint of the scale. |
| 420 | * |
| 421 | * \param xScale The scale in the x direction. Must be greater than 0. |
| 422 | * \param yScale The scale in the y direction. Must be greater than 0. |
| 423 | * |
| 424 | * Available since API level 31. |
| 425 | */ |
| 426 | void ASurfaceTransaction_setScale(ASurfaceTransaction* transaction, |
| 427 | ASurfaceControl* surface_control, float xScale, float yScale) |
| 428 | __INTRODUCED_IN(31); |
| 429 | /** |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 430 | * Parameter for ASurfaceTransaction_setBufferTransparency(). |
| 431 | */ |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 432 | enum { |
| 433 | ASURFACE_TRANSACTION_TRANSPARENCY_TRANSPARENT = 0, |
| 434 | ASURFACE_TRANSACTION_TRANSPARENCY_TRANSLUCENT = 1, |
| 435 | ASURFACE_TRANSACTION_TRANSPARENCY_OPAQUE = 2, |
| 436 | }; |
| 437 | /** |
| 438 | * Updates whether the content for the buffer associated with this surface is |
| 439 | * completely opaque. If true, every pixel of content inside the buffer must be |
| 440 | * opaque or visual errors can occur. |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 441 | * |
| 442 | * Available since API level 29. |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 443 | */ |
| 444 | void ASurfaceTransaction_setBufferTransparency(ASurfaceTransaction* transaction, |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 445 | ASurfaceControl* surface_control, |
| 446 | int8_t transparency) |
| 447 | __INTRODUCED_IN(29); |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 448 | |
| 449 | /** |
| 450 | * Updates the region for the content on this surface updated in this |
| 451 | * transaction. If unspecified, the complete surface is assumed to be damaged. |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 452 | * |
| 453 | * Available since API level 29. |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 454 | */ |
| 455 | void ASurfaceTransaction_setDamageRegion(ASurfaceTransaction* transaction, |
| 456 | ASurfaceControl* surface_control, const ARect rects[], |
| 457 | uint32_t count) __INTRODUCED_IN(29); |
| 458 | |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 459 | /** |
| 460 | * Specifies a desiredPresentTime for the transaction. The framework will try to present |
| 461 | * the transaction at or after the time specified. |
| 462 | * |
| 463 | * Transactions will not be presented until all of their acquire fences have signaled even if the |
| 464 | * app requests an earlier present time. |
| 465 | * |
| 466 | * If an earlier transaction has a desired present time of x, and a later transaction has a desired |
| 467 | * present time that is before x, the later transaction will not preempt the earlier transaction. |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 468 | * |
| 469 | * Available since API level 29. |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 470 | */ |
| 471 | void ASurfaceTransaction_setDesiredPresentTime(ASurfaceTransaction* transaction, |
| 472 | int64_t desiredPresentTime) __INTRODUCED_IN(29); |
| 473 | |
| 474 | /** |
| 475 | * Sets the alpha for the buffer. It uses a premultiplied blending. |
| 476 | * |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 477 | * The \a alpha must be between 0.0 and 1.0. |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 478 | * |
| 479 | * Available since API level 29. |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 480 | */ |
| 481 | void ASurfaceTransaction_setBufferAlpha(ASurfaceTransaction* transaction, |
| 482 | ASurfaceControl* surface_control, float alpha) |
| 483 | __INTRODUCED_IN(29); |
| 484 | |
Marissa Wall | 3ff826c | 2019-02-07 11:58:25 -0800 | [diff] [blame] | 485 | /** |
| 486 | * Sets the data space of the surface_control's buffers. |
| 487 | * |
| 488 | * If no data space is set, the surface control defaults to ADATASPACE_SRGB. |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 489 | * |
| 490 | * Available since API level 29. |
Marissa Wall | 3ff826c | 2019-02-07 11:58:25 -0800 | [diff] [blame] | 491 | */ |
| 492 | void ASurfaceTransaction_setBufferDataSpace(ASurfaceTransaction* transaction, |
| 493 | ASurfaceControl* surface_control, ADataSpace data_space) |
| 494 | __INTRODUCED_IN(29); |
| 495 | |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 496 | /** |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 497 | * SMPTE ST 2086 "Mastering Display Color Volume" static metadata |
| 498 | * |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 499 | * When \a metadata is set to null, the framework does not use any smpte2086 metadata when rendering |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 500 | * the surface's buffer. |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 501 | * |
| 502 | * Available since API level 29. |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 503 | */ |
| 504 | void ASurfaceTransaction_setHdrMetadata_smpte2086(ASurfaceTransaction* transaction, |
| 505 | ASurfaceControl* surface_control, |
| 506 | struct AHdrMetadata_smpte2086* metadata) |
| 507 | __INTRODUCED_IN(29); |
| 508 | |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 509 | /** |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 510 | * Sets the CTA 861.3 "HDR Static Metadata Extension" static metadata on a surface. |
| 511 | * |
Marin Shalamanov | 110c6bc | 2020-11-16 17:57:59 +0100 | [diff] [blame] | 512 | * When \a metadata is set to null, the framework does not use any cta861.3 metadata when rendering |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 513 | * the surface's buffer. |
Elliott Hughes | 3d70e53 | 2019-10-29 08:59:39 -0700 | [diff] [blame] | 514 | * |
| 515 | * Available since API level 29. |
Marissa Wall | 80d94ad | 2019-01-18 16:04:36 -0800 | [diff] [blame] | 516 | */ |
| 517 | void ASurfaceTransaction_setHdrMetadata_cta861_3(ASurfaceTransaction* transaction, |
| 518 | ASurfaceControl* surface_control, |
| 519 | struct AHdrMetadata_cta861_3* metadata) |
| 520 | __INTRODUCED_IN(29); |
| 521 | |
Steven Thomas | 15b6f9c | 2020-03-26 13:44:28 -0700 | [diff] [blame] | 522 | /** |
Marin Shalamanov | c598677 | 2021-03-16 16:09:49 +0100 | [diff] [blame] | 523 | * Same as ASurfaceTransaction_setFrameRateWithChangeStrategy(transaction, surface_control, |
| 524 | * frameRate, compatibility, ANATIVEWINDOW_CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS). |
Steven Thomas | 6d88a48 | 2019-12-02 22:00:47 -0800 | [diff] [blame] | 525 | * |
Marin Shalamanov | c598677 | 2021-03-16 16:09:49 +0100 | [diff] [blame] | 526 | * See ASurfaceTransaction_setFrameRateWithChangeStrategy(). |
Steven Thomas | 62a4cf8 | 2020-01-31 12:04:03 -0800 | [diff] [blame] | 527 | * |
Steven Thomas | 6d88a48 | 2019-12-02 22:00:47 -0800 | [diff] [blame] | 528 | * Available since API level 30. |
| 529 | */ |
| 530 | void ASurfaceTransaction_setFrameRate(ASurfaceTransaction* transaction, |
Steven Thomas | 62a4cf8 | 2020-01-31 12:04:03 -0800 | [diff] [blame] | 531 | ASurfaceControl* surface_control, float frameRate, |
| 532 | int8_t compatibility) __INTRODUCED_IN(30); |
Steven Thomas | 6d88a48 | 2019-12-02 22:00:47 -0800 | [diff] [blame] | 533 | |
Marin Shalamanov | 4608442 | 2020-10-13 12:33:42 +0200 | [diff] [blame] | 534 | /** |
| 535 | * Sets the intended frame rate for \a surface_control. |
| 536 | * |
| 537 | * On devices that are capable of running the display at different refresh rates, the system may |
| 538 | * choose a display refresh rate to better match this surface's frame rate. Usage of this API won't |
| 539 | * directly affect the application's frame production pipeline. However, because the system may |
| 540 | * change the display refresh rate, calls to this function may result in changes to Choreographer |
| 541 | * callback timings, and changes to the time interval at which the system releases buffers back to |
| 542 | * the application. |
| 543 | * |
Marin Shalamanov | a308b9d | 2021-05-05 13:43:28 +0200 | [diff] [blame] | 544 | * You can register for changes in the refresh rate using |
| 545 | * \a AChoreographer_registerRefreshRateCallback. |
| 546 | * |
Marin Shalamanov | 4608442 | 2020-10-13 12:33:42 +0200 | [diff] [blame] | 547 | * \param frameRate is the intended frame rate of this surface, in frames per second. 0 is a special |
| 548 | * value that indicates the app will accept the system's choice for the display frame rate, which is |
| 549 | * the default behavior if this function isn't called. The frameRate param does <em>not</em> need to |
| 550 | * be a valid refresh rate for this device's display - e.g., it's fine to pass 30fps to a device |
| 551 | * that can only run the display at 60fps. |
| 552 | * |
| 553 | * \param compatibility The frame rate compatibility of this surface. The compatibility value may |
| 554 | * influence the system's choice of display frame rate. To specify a compatibility use the |
Marin Shalamanov | 293ac2c | 2021-04-26 14:13:04 +0200 | [diff] [blame] | 555 | * ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_* enum. This parameter is ignored when frameRate is 0. |
Marin Shalamanov | 4608442 | 2020-10-13 12:33:42 +0200 | [diff] [blame] | 556 | * |
Marin Shalamanov | 293ac2c | 2021-04-26 14:13:04 +0200 | [diff] [blame] | 557 | * \param changeFrameRateStrategy Whether display refresh rate transitions caused by this |
| 558 | * surface should be seamless. A seamless transition is one that doesn't have any visual |
| 559 | * interruptions, such as a black screen for a second or two. See the |
| 560 | * ANATIVEWINDOW_CHANGE_FRAME_RATE_* values. This parameter is ignored when frameRate is 0. |
Marin Shalamanov | 4608442 | 2020-10-13 12:33:42 +0200 | [diff] [blame] | 561 | * |
| 562 | * Available since API level 31. |
| 563 | */ |
Marin Shalamanov | c598677 | 2021-03-16 16:09:49 +0100 | [diff] [blame] | 564 | void ASurfaceTransaction_setFrameRateWithChangeStrategy(ASurfaceTransaction* transaction, |
Marin Shalamanov | 4608442 | 2020-10-13 12:33:42 +0200 | [diff] [blame] | 565 | ASurfaceControl* surface_control, float frameRate, |
Marin Shalamanov | c598677 | 2021-03-16 16:09:49 +0100 | [diff] [blame] | 566 | int8_t compatibility, int8_t changeFrameRateStrategy) |
Marin Shalamanov | 4608442 | 2020-10-13 12:33:42 +0200 | [diff] [blame] | 567 | __INTRODUCED_IN(31); |
| 568 | |
Robert Carr | f08168d | 2021-03-24 15:49:18 -0700 | [diff] [blame] | 569 | /** |
| 570 | * Indicate whether to enable backpressure for buffer submission to a given SurfaceControl. |
| 571 | * |
| 572 | * By default backpressure is disabled, which means submitting a buffer prior to receiving |
| 573 | * a callback for the previous buffer could lead to that buffer being "dropped". In cases |
| 574 | * where you are selecting for latency, this may be a desirable behavior! We had a new buffer |
| 575 | * ready, why shouldn't we show it? |
| 576 | * |
| 577 | * When back pressure is enabled, each buffer will be required to be presented |
| 578 | * before it is released and the callback delivered |
| 579 | * (absent the whole SurfaceControl being removed). |
| 580 | * |
| 581 | * Most apps are likely to have some sort of backpressure internally, e.g. you are |
| 582 | * waiting on the callback from frame N-2 before starting frame N. In high refresh |
| 583 | * rate scenarios there may not be much time between SurfaceFlinger completing frame |
| 584 | * N-1 (and therefore releasing buffer N-2) and beginning frame N. This means |
| 585 | * your app may not have enough time to respond in the callback. Using this flag |
| 586 | * and pushing buffers earlier for server side queuing will be advantageous |
| 587 | * in such cases. |
| 588 | * |
| 589 | * \param transaction The transaction in which to make the change. |
| 590 | * \param surface_control The ASurfaceControl on which to control buffer backpressure behavior. |
| 591 | * \param enableBackPressure Whether to enable back pressure. |
| 592 | */ |
| 593 | void ASurfaceTransaction_setEnableBackPressure(ASurfaceTransaction* transaction, |
| 594 | ASurfaceControl* surface_control, |
| 595 | bool enableBackPressure) |
| 596 | __INTRODUCED_IN(31); |
| 597 | |
Rachel Lee | ed511ef | 2021-10-11 15:09:51 -0700 | [diff] [blame^] | 598 | /** |
| 599 | * Sets the frame timeline to use. |
| 600 | * |
| 601 | * \param vsyncId The vsync ID received from AChoreographer, setting the frame's present target to |
| 602 | * the corresponding expected present time and deadline from the frame to be rendered. |
| 603 | */ |
| 604 | void ASurfaceTransaction_setFrameTimeline(ASurfaceTransaction* transaction, |
| 605 | int64_t vsyncId) __INTRODUCED_IN(33); |
| 606 | |
Marissa Wall | 53da7e3 | 2018-09-25 15:59:38 -0700 | [diff] [blame] | 607 | __END_DECLS |
| 608 | |
| 609 | #endif // ANDROID_SURFACE_CONTROL_H |
Marin Shalamanov | 574c58d | 2021-03-18 15:10:02 +0100 | [diff] [blame] | 610 | |
| 611 | /** @} */ |