Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 587dfb19 authored by John Reck's avatar John Reck Committed by Automerger Merge Worker
Browse files

Fix brightness change during screenrotation am: 4546de08

parents 5a5123bb 4546de08
Loading
Loading
Loading
Loading
+4 −1
Original line number Original line Diff line number Diff line
@@ -7424,7 +7424,10 @@ ftl::SharedFuture<FenceResult> SurfaceFlinger::renderScreenImpl(
                                      renderArea->getHintForSeamlessTransition());
                                      renderArea->getHintForSeamlessTransition());
            sdrWhitePointNits = state.sdrWhitePointNits;
            sdrWhitePointNits = state.sdrWhitePointNits;
            displayBrightnessNits = state.displayBrightnessNits;
            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
                // Restrict the amount of HDR "headroom" in the screenshot to avoid over-dimming
                // the SDR portion. 2.0 chosen by experimentation
                // the SDR portion. 2.0 chosen by experimentation
                constexpr float kMaxScreenshotHeadroom = 2.0f;
                constexpr float kMaxScreenshotHeadroom = 2.0f;