summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/SurfaceFlinger.cpp
diff options
context:
space:
mode:
author John Reck <jreck@google.com> 2023-07-18 23:44:54 +0000
committer Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> 2023-07-18 23:44:54 +0000
commit425660aeafc730c464a14a61e34bfd97076f87d7 (patch)
treee66f63141c71f70e7b103e64902515d88b029ab2 /services/surfaceflinger/SurfaceFlinger.cpp
parent9b1349733794eec511b5bde6c46e22da2448423c (diff)
parent1dadaa6b78f2939e717451303cd29d8f683e5f08 (diff)
Fix brightness change during screenrotation am: 1dadaa6b78
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/native/+/24108563 Change-Id: Ib77c172ae28c406cce8985061aae93df5ad92d8d Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.cpp')
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index d3489ff805..faa8956108 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -7352,7 +7352,10 @@ ftl::SharedFuture<FenceResult> SurfaceFlinger::renderScreenImpl(
renderArea->getHintForSeamlessTransition());
sdrWhitePointNits = state.sdrWhitePointNits;
displayBrightnessNits = state.displayBrightnessNits;
- if (sdrWhitePointNits > 1.0f) {
+ // Only clamp the display brightness if this is not a seamless transition. Otherwise
+ // for seamless transitions it's important to match the current display state as the
+ // buffer will be shown under these same conditions, and we want to avoid any flickers
+ if (sdrWhitePointNits > 1.0f && !renderArea->getHintForSeamlessTransition()) {
// Restrict the amount of HDR "headroom" in the screenshot to avoid over-dimming
// the SDR portion. 2.0 chosen by experimentation
constexpr float kMaxScreenshotHeadroom = 2.0f;