summaryrefslogtreecommitdiff
path: root/libs/nativewindow/ANativeWindow.cpp
diff options
context:
space:
mode:
author Marin Shalamanov <shalamanov@google.com> 2021-03-16 16:09:49 +0100
committer Marin Shalamanov <shalamanov@google.com> 2021-03-24 13:19:07 +0100
commitc5986778d0d6c7ab3f96fafb1b84887e901ed92b (patch)
tree8e99206a5ad1852ac86affa3e35ac51f1ba4206f /libs/nativewindow/ANativeWindow.cpp
parent3b1f7bcf8fd0ca2458eb26ec31a1bddf4bf7fd43 (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: I28a8863ea77101f90b878fbda5f00d98e075b7cc
Diffstat (limited to 'libs/nativewindow/ANativeWindow.cpp')
-rw-r--r--libs/nativewindow/ANativeWindow.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/nativewindow/ANativeWindow.cpp b/libs/nativewindow/ANativeWindow.cpp
index b406a9c2fe..ada689ac42 100644
--- a/libs/nativewindow/ANativeWindow.cpp
+++ b/libs/nativewindow/ANativeWindow.cpp
@@ -159,8 +159,8 @@ int32_t ANativeWindow_getBuffersDataSpace(ANativeWindow* window) {
}
int32_t ANativeWindow_setFrameRate(ANativeWindow* window, float frameRate, int8_t compatibility) {
- return ANativeWindow_setFrameRateWithSeamlessness(window, frameRate, compatibility,
- /*shouldBeSeamless*/ true);
+ return ANativeWindow_setFrameRateWithChangeStrategy(window, frameRate, compatibility,
+ ANATIVEWINDOW_CHANGE_FRAME_RATE_ONLY_IF_SEAMLESS);
}
void ANativeWindow_tryAllocateBuffers(ANativeWindow* window) {
@@ -170,12 +170,12 @@ void ANativeWindow_tryAllocateBuffers(ANativeWindow* window) {
window->perform(window, NATIVE_WINDOW_ALLOCATE_BUFFERS);
}
-int32_t ANativeWindow_setFrameRateWithSeamlessness(ANativeWindow* window, float frameRate,
- int8_t compatibility, bool shouldBeSeamless) {
+int32_t ANativeWindow_setFrameRateWithChangeStrategy(ANativeWindow* window, float frameRate,
+ int8_t compatibility, int8_t changeFrameRateStrategy) {
if (!window || !query(window, NATIVE_WINDOW_IS_VALID)) {
return -EINVAL;
}
- return native_window_set_frame_rate(window, frameRate, compatibility, shouldBeSeamless);
+ return native_window_set_frame_rate(window, frameRate, compatibility, changeFrameRateStrategy);
}
/**************************************************************************************************