diff options
author | Marin Shalamanov <shalamanov@google.com> | 2020-10-13 12:35:20 +0200 |
---|---|---|
committer | Marin Shalamanov <shalamanov@google.com> | 2020-11-17 11:53:14 +0100 |
commit | 41ffa8dd060015434131a6d4c2d248effe899202 (patch) | |
tree | f37baab45654b67d45a592b722f988402a7ca136 /native/android/surface_control.cpp | |
parent | 660f7cd8f10eeddc85ffd84be4376e7a3beb9d83 (diff) |
Add shouldBeSeamless param to Surface.setFrameRate
This CL adds a new parameter shouldBeSeamless to the existing
setFrameRate APIs. This parameter indicates whether the desired
refresh rate should be achieved only seamlessly or also switches
with visual interruptions for the user are allowed. The default
value of the new parameter is "true".
Test: atest SetFrameRateTest
Test: atest RefreshRateConfigsTest
Test: atest libsurfaceflinger_unittest
Bug: 161776961
Change-Id: Ic2446d278e4f57fe507d30a0a18ef7b85909da4b
Diffstat (limited to 'native/android/surface_control.cpp')
-rw-r--r-- | native/android/surface_control.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/native/android/surface_control.cpp b/native/android/surface_control.cpp index c503721319fb..189be800e018 100644 --- a/native/android/surface_control.cpp +++ b/native/android/surface_control.cpp @@ -560,9 +560,18 @@ void ASurfaceTransaction_setColor(ASurfaceTransaction* aSurfaceTransaction, void ASurfaceTransaction_setFrameRate(ASurfaceTransaction* aSurfaceTransaction, ASurfaceControl* aSurfaceControl, float frameRate, int8_t compatibility) { + ASurfaceTransaction_setFrameRateWithSeamlessness(aSurfaceTransaction, aSurfaceControl, + frameRate, compatibility, + /*shouldBeSeamless*/ true); +} + +void ASurfaceTransaction_setFrameRateWithSeamlessness(ASurfaceTransaction* aSurfaceTransaction, + ASurfaceControl* aSurfaceControl, + float frameRate, int8_t compatibility, + bool shouldBeSeamless) { CHECK_NOT_NULL(aSurfaceTransaction); CHECK_NOT_NULL(aSurfaceControl); Transaction* transaction = ASurfaceTransaction_to_Transaction(aSurfaceTransaction); sp<SurfaceControl> surfaceControl = ASurfaceControl_to_SurfaceControl(aSurfaceControl); - transaction->setFrameRate(surfaceControl, frameRate, compatibility); + transaction->setFrameRate(surfaceControl, frameRate, compatibility, shouldBeSeamless); } |