ASurfaceTransaction: Add setEnableBackpressure

Expose the backpressure flag to NDK. See comment in
header file for extensive discussion.

Bug: 177458703
Test: Need new CTS
Change-Id: I97cdaef5d499f57a270972f001517b8a520aa2fe
This commit is contained in:
Robert Carr
2021-03-24 15:48:25 -07:00
committed by Rob Carr
parent 0f97905040
commit f57c0163f9
2 changed files with 15 additions and 0 deletions

View File

@@ -655,3 +655,17 @@ void ASurfaceTransaction_setFrameRateWithSeamlessness(ASurfaceTransaction* aSurf
sp<SurfaceControl> surfaceControl = ASurfaceControl_to_SurfaceControl(aSurfaceControl);
transaction->setFrameRate(surfaceControl, frameRate, compatibility, shouldBeSeamless);
}
void ASurfaceTransaction_setEnableBackPressure(ASurfaceTransaction* aSurfaceTransaction,
ASurfaceControl* aSurfaceControl,
bool enableBackpressure) {
CHECK_NOT_NULL(aSurfaceControl);
CHECK_NOT_NULL(aSurfaceTransaction);
sp<SurfaceControl> surfaceControl = ASurfaceControl_to_SurfaceControl(aSurfaceControl);
Transaction* transaction = ASurfaceTransaction_to_Transaction(aSurfaceTransaction);
const uint32_t flags = enableBackpressure ?
layer_state_t::eEnableBackpressure : 0;
transaction->setFlags(surfaceControl, flags, layer_state_t::eEnableBackpressure);
}