summaryrefslogtreecommitdiff
path: root/libs/nativewindow/ANativeWindow.cpp
diff options
context:
space:
mode:
author Marin Shalamanov <shalamanov@google.com> 2020-10-13 12:33:42 +0200
committer Marin Shalamanov <shalamanov@google.com> 2020-11-16 18:01:55 +0100
commit4608442db90c07dccc833dbdf1cea78f57c7b96d (patch)
treebe976923f779a78bf40ee5f5165a51f76b37b897 /libs/nativewindow/ANativeWindow.cpp
parent6bb6836cbdc56efc7e3bc4a14aea6dcf43f9ff3c (diff)
Add shouldBeSeamless to 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 RefreshRateConfigsTest Test: atest SetFrameRateTest Test: atest libsurfaceflinger_unittest Test: atest libgui_test Bug: 161776961 Change-Id: I0df16e09f77c8c198fd3733fb581a2aaadfed685
Diffstat (limited to 'libs/nativewindow/ANativeWindow.cpp')
-rw-r--r--libs/nativewindow/ANativeWindow.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/libs/nativewindow/ANativeWindow.cpp b/libs/nativewindow/ANativeWindow.cpp
index fd1793b6bc..b406a9c2fe 100644
--- a/libs/nativewindow/ANativeWindow.cpp
+++ b/libs/nativewindow/ANativeWindow.cpp
@@ -159,10 +159,8 @@ int32_t ANativeWindow_getBuffersDataSpace(ANativeWindow* window) {
}
int32_t ANativeWindow_setFrameRate(ANativeWindow* window, float frameRate, int8_t compatibility) {
- if (!window || !query(window, NATIVE_WINDOW_IS_VALID)) {
- return -EINVAL;
- }
- return native_window_set_frame_rate(window, frameRate, compatibility);
+ return ANativeWindow_setFrameRateWithSeamlessness(window, frameRate, compatibility,
+ /*shouldBeSeamless*/ true);
}
void ANativeWindow_tryAllocateBuffers(ANativeWindow* window) {
@@ -172,6 +170,13 @@ 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) {
+ if (!window || !query(window, NATIVE_WINDOW_IS_VALID)) {
+ return -EINVAL;
+ }
+ return native_window_set_frame_rate(window, frameRate, compatibility, shouldBeSeamless);
+}
/**************************************************************************************************
* vndk-stable