diff options
author | 2021-01-27 22:02:11 -0800 | |
---|---|---|
committer | 2021-01-28 11:54:57 -0800 | |
commit | f6eddb6b42a9548f1298e899ea06a7a042182783 (patch) | |
tree | 3c3cfcc5c4589cc80069a25de8a362f7f5434599 /libs/gui/LayerState.cpp | |
parent | dd5bfa93b0c6633b7372c87fc8d7a83a73a5cd1c (diff) |
Enable backpressure for BufferStateLayer
The default behaviour of buffer state layer is to drop older
buffers if there are newer buffers that are ready to be presented.
When emulating BufferQueue behavior via the adapter, we want
to queue up buffers without any present timestamps. To solve this,
we introduce a layer state flag to keep the buffer in the transaction
queue if there is already a buffer that is ready to be applied.
Test: atest SurfaceViewBufferTests:BufferPresentationTests
Bug: 176967609
Change-Id: I33f6347bd1c7a2d80dc4214e596bb864abe8c6bf
Diffstat (limited to 'libs/gui/LayerState.cpp')
-rw-r--r-- | libs/gui/LayerState.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/libs/gui/LayerState.cpp b/libs/gui/LayerState.cpp index e5e10a0014..2946aaed37 100644 --- a/libs/gui/LayerState.cpp +++ b/libs/gui/LayerState.cpp @@ -183,12 +183,9 @@ status_t layer_state_t::read(const Parcel& input) SAFE_PARCEL(input.readUint32, &layerStack); SAFE_PARCEL(input.readFloat, &alpha); - uint32_t tmpUint32 = 0; - SAFE_PARCEL(input.readUint32, &tmpUint32); - flags = static_cast<uint8_t>(tmpUint32); + SAFE_PARCEL(input.readUint32, &flags); - SAFE_PARCEL(input.readUint32, &tmpUint32); - mask = static_cast<uint8_t>(tmpUint32); + SAFE_PARCEL(input.readUint32, &mask); SAFE_PARCEL(matrix.read, input); SAFE_PARCEL(input.read, crop_legacy); @@ -229,6 +226,7 @@ status_t layer_state_t::read(const Parcel& input) SAFE_PARCEL(input.read, *acquireFence); } + uint32_t tmpUint32 = 0; SAFE_PARCEL(input.readUint32, &tmpUint32); dataspace = static_cast<ui::Dataspace>(tmpUint32); |