diff options
author | Rob Carr <racarr@google.com> | 2021-04-02 19:03:09 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2021-04-02 19:03:09 +0000 |
commit | 782102ccd57110b1979af962ea227a8d715e70c2 (patch) | |
tree | 762f2e76fcb7c21fa1331c8c00d650c40f735abf /native/android/surface_control.cpp | |
parent | 1da23870fd319beba054e17b3a11222ad3d1e3d2 (diff) | |
parent | f57c0163f9c6fe8596a56df52a98f3f912f40ef5 (diff) |
Merge "ASurfaceTransaction: Add setEnableBackpressure" into sc-dev
Diffstat (limited to 'native/android/surface_control.cpp')
-rw-r--r-- | native/android/surface_control.cpp | 14 |
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); +} |