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

Commit cc4f30f4 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Fix display brightness for HDR layers during transitions" into main

parents 69e737f0 23ac46c2
Loading
Loading
Loading
Loading
+10 −9
Original line number Diff line number Diff line
@@ -7823,8 +7823,8 @@ ftl::SharedFuture<FenceResult> SurfaceFlinger::renderScreenImpl(
    // 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 (captureResults.capturedHdrLayers && !enableLocalTonemapping &&
        args.sdrWhitePointNits > 1.0f && !args.seamlessTransition) {
    if (captureResults.capturedHdrLayers) {
        if (!enableLocalTonemapping && args.sdrWhitePointNits > 1.0f && !args.seamlessTransition) {
            // 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;
@@ -7832,6 +7832,7 @@ ftl::SharedFuture<FenceResult> SurfaceFlinger::renderScreenImpl(
            // path so ScreenshotArgs can be passed as const
            args.displayBrightnessNits = std::min(args.sdrWhitePointNits * kMaxScreenshotHeadroom,
                                                  args.displayBrightnessNits);
        }
    } else {
        args.displayBrightnessNits = args.sdrWhitePointNits;
    }