diff options
| author | 2020-10-13 12:33:42 +0200 | |
|---|---|---|
| committer | 2020-11-16 18:01:55 +0100 | |
| commit | 4608442db90c07dccc833dbdf1cea78f57c7b96d (patch) | |
| tree | be976923f779a78bf40ee5f5165a51f76b37b897 /libs/gui/Surface.cpp | |
| parent | 6bb6836cbdc56efc7e3bc4a14aea6dcf43f9ff3c (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/gui/Surface.cpp')
| -rw-r--r-- | libs/gui/Surface.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp index c1155ab73a..94390aa86c 100644 --- a/libs/gui/Surface.cpp +++ b/libs/gui/Surface.cpp @@ -1443,7 +1443,8 @@ int Surface::dispatchGetLastQueueDuration(va_list args) { int Surface::dispatchSetFrameRate(va_list args) { float frameRate = static_cast<float>(va_arg(args, double)); int8_t compatibility = static_cast<int8_t>(va_arg(args, int)); - return setFrameRate(frameRate, compatibility); + bool shouldBeSeamless = static_cast<bool>(va_arg(args, int)); + return setFrameRate(frameRate, compatibility, shouldBeSeamless); } int Surface::dispatchAddCancelInterceptor(va_list args) { @@ -2279,7 +2280,7 @@ void Surface::ProducerListenerProxy::onBuffersDiscarded(const std::vector<int32_ mSurfaceListener->onBuffersDiscarded(discardedBufs); } -status_t Surface::setFrameRate(float frameRate, int8_t compatibility) { +status_t Surface::setFrameRate(float frameRate, int8_t compatibility, bool shouldBeSeamless) { ATRACE_CALL(); ALOGV("Surface::setFrameRate"); @@ -2287,7 +2288,8 @@ status_t Surface::setFrameRate(float frameRate, int8_t compatibility) { return BAD_VALUE; } - return composerService()->setFrameRate(mGraphicBufferProducer, frameRate, compatibility); + return composerService()->setFrameRate(mGraphicBufferProducer, frameRate, compatibility, + shouldBeSeamless); } status_t Surface::setFrameTimelineVsync(int64_t frameTimelineVsyncId) { |