summaryrefslogtreecommitdiff
path: root/libs/gui/SurfaceComposerClient.cpp
diff options
context:
space:
mode:
author Rachel Lee <rnlee@google.com> 2023-09-28 15:35:07 -0700
committer Rachel Lee <rnlee@google.com> 2023-10-11 11:17:40 -0700
commit67afbeaac2c284356f2b2aa61f48258bc0758911 (patch)
tree129d2495c5090c79f5164888abe6ad1ff96f5703 /libs/gui/SurfaceComposerClient.cpp
parent64edb6c4b8e5491de46bf7b58643c0d91ee4e652 (diff)
Add smooth switch bool for setFrameRateCategory
This allows the platform to have a different behavior depending on whether a device is MRR or dVRR. When the bool is `true`, MRR devices (those with DisplayModes that do not have vrr config) will not change frame rates if it would cause jank. The expected usage is to mark the bool true when an animation is running. Bug: 300491171 Test: atest libsurfaceflinger_unittest Change-Id: I5e87d276c11ecc806ede3e943f0a6498a7b910c4
Diffstat (limited to 'libs/gui/SurfaceComposerClient.cpp')
-rw-r--r--libs/gui/SurfaceComposerClient.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index 8a57f925ec..d9d99a414e 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -2098,7 +2098,7 @@ SurfaceComposerClient::Transaction::setDefaultFrameRateCompatibility(const sp<Su
}
SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setFrameRateCategory(
- const sp<SurfaceControl>& sc, int8_t category) {
+ const sp<SurfaceControl>& sc, int8_t category, bool smoothSwitchOnly) {
layer_state_t* s = getLayerState(sc);
if (!s) {
mStatus = BAD_INDEX;
@@ -2106,6 +2106,7 @@ SurfaceComposerClient::Transaction& SurfaceComposerClient::Transaction::setFrame
}
s->what |= layer_state_t::eFrameRateCategoryChanged;
s->frameRateCategory = category;
+ s->frameRateCategorySmoothSwitchOnly = smoothSwitchOnly;
return *this;
}