diff options
author | Marin Shalamanov <shalamanov@google.com> | 2021-03-16 18:03:30 +0100 |
---|---|---|
committer | Marin Shalamanov <shalamanov@google.com> | 2021-03-24 21:34:04 +0100 |
commit | 511f9145bac4c52ba444935738e5bcd2c1bd8bad (patch) | |
tree | b832934da8efddca75ea19859efa1b0cc2fcf075 /native/android/surface_control.cpp | |
parent | 41b3b73eceddac289a51b6f70b3ccf4d8d631885 (diff) |
setFrameRate: Make shouldBeSeamless an enum
Change the shouldBeSeamless parameter to an enum
in order to make the API easier to understand.
This changes
- SurfaceControl.setFrameRate
- Surface.setFrameRate
- ANativeWindow_setFrameRateWithChangeStrategy
- ASurfaceTransaction_setFrameRateWithChangeStrategy
Bug: 179116474
Test: atest SetFrameRateTest
Change-Id: I55265399238e2c95fbb90fd33a4c2513d1fc5cec
Diffstat (limited to 'native/android/surface_control.cpp')
-rw-r--r-- | native/android/surface_control.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/native/android/surface_control.cpp b/native/android/surface_control.cpp index e8cf63f64572..6c12c438554f 100644 --- a/native/android/surface_control.cpp +++ b/native/android/surface_control.cpp @@ -596,24 +596,25 @@ void ASurfaceTransaction_setColor(ASurfaceTransaction* aSurfaceTransaction, color.g = g; color.b = b; - transaction->setBackgroundColor(surfaceControl, color, alpha, static_cast<ui::Dataspace>(dataspace)); + transaction->setBackgroundColor(surfaceControl, color, alpha, + static_cast<ui::Dataspace>(dataspace)); } void ASurfaceTransaction_setFrameRate(ASurfaceTransaction* aSurfaceTransaction, ASurfaceControl* aSurfaceControl, float frameRate, int8_t compatibility) { - ASurfaceTransaction_setFrameRateWithSeamlessness(aSurfaceTransaction, aSurfaceControl, - frameRate, compatibility, - /*shouldBeSeamless*/ true); + ASurfaceTransaction_setFrameRateWithChangeStrategy( + aSurfaceTransaction, aSurfaceControl, frameRate, compatibility, + ANATIVEWINDOW_CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS); } -void ASurfaceTransaction_setFrameRateWithSeamlessness(ASurfaceTransaction* aSurfaceTransaction, - ASurfaceControl* aSurfaceControl, - float frameRate, int8_t compatibility, - bool shouldBeSeamless) { +void ASurfaceTransaction_setFrameRateWithChangeStrategy(ASurfaceTransaction* aSurfaceTransaction, + ASurfaceControl* aSurfaceControl, + float frameRate, int8_t compatibility, + int8_t changeFrameRateStrategy) { 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, shouldBeSeamless); + transaction->setFrameRate(surfaceControl, frameRate, compatibility, changeFrameRateStrategy); } |