summaryrefslogtreecommitdiff
path: root/native/android/surface_control.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'native/android/surface_control.cpp')
-rw-r--r--native/android/surface_control.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/native/android/surface_control.cpp b/native/android/surface_control.cpp
index 80cf663978a9..e0f637959cfb 100644
--- a/native/android/surface_control.cpp
+++ b/native/android/surface_control.cpp
@@ -656,3 +656,17 @@ void ASurfaceTransaction_setFrameRateWithChangeStrategy(ASurfaceTransaction* aSu
sp<SurfaceControl> surfaceControl = ASurfaceControl_to_SurfaceControl(aSurfaceControl);
transaction->setFrameRate(surfaceControl, frameRate, compatibility, changeFrameRateStrategy);
}
+
+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);
+}