Loading services/surfaceflinger/SurfaceFlinger.cpp +24 −14 Original line number Diff line number Diff line Loading @@ -7743,6 +7743,7 @@ ftl::SharedFuture<FenceResult> SurfaceFlinger::renderScreenImpl( ATRACE_CALL(); auto layers = getLayerSnapshots(); for (auto& [_, layerFE] : layers) { frontend::LayerSnapshot* snapshot = layerFE->mSnapshot.get(); captureResults.capturedSecureLayers |= (snapshot->isVisible && snapshot->isSecure); Loading Loading @@ -7794,16 +7795,24 @@ ftl::SharedFuture<FenceResult> SurfaceFlinger::renderScreenImpl( pickBestDataspace(requestedDataspace, display, captureResults.capturedHdrLayers, renderArea->getHintForSeamlessTransition()); sdrWhitePointNits = state.sdrWhitePointNits; // TODO(b/298219334): Clean this up once we verify this doesn't break anything static constexpr bool kScreenshotsDontDim = true; if (kScreenshotsDontDim && !captureResults.capturedHdrLayers) { displayBrightnessNits = sdrWhitePointNits; } else { displayBrightnessNits = state.displayBrightnessNits; // 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 // 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; displayBrightnessNits = std::min(sdrWhitePointNits * kMaxScreenshotHeadroom, displayBrightnessNits); displayBrightnessNits = std::min(sdrWhitePointNits * kMaxScreenshotHeadroom, displayBrightnessNits); } if (requestedDataspace == ui::Dataspace::UNKNOWN) { Loading @@ -7811,6 +7820,7 @@ ftl::SharedFuture<FenceResult> SurfaceFlinger::renderScreenImpl( } } } } captureResults.buffer = capturedBuffer->getBuffer(); Loading Loading
services/surfaceflinger/SurfaceFlinger.cpp +24 −14 Original line number Diff line number Diff line Loading @@ -7743,6 +7743,7 @@ ftl::SharedFuture<FenceResult> SurfaceFlinger::renderScreenImpl( ATRACE_CALL(); auto layers = getLayerSnapshots(); for (auto& [_, layerFE] : layers) { frontend::LayerSnapshot* snapshot = layerFE->mSnapshot.get(); captureResults.capturedSecureLayers |= (snapshot->isVisible && snapshot->isSecure); Loading Loading @@ -7794,16 +7795,24 @@ ftl::SharedFuture<FenceResult> SurfaceFlinger::renderScreenImpl( pickBestDataspace(requestedDataspace, display, captureResults.capturedHdrLayers, renderArea->getHintForSeamlessTransition()); sdrWhitePointNits = state.sdrWhitePointNits; // TODO(b/298219334): Clean this up once we verify this doesn't break anything static constexpr bool kScreenshotsDontDim = true; if (kScreenshotsDontDim && !captureResults.capturedHdrLayers) { displayBrightnessNits = sdrWhitePointNits; } else { displayBrightnessNits = state.displayBrightnessNits; // 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 // 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; displayBrightnessNits = std::min(sdrWhitePointNits * kMaxScreenshotHeadroom, displayBrightnessNits); displayBrightnessNits = std::min(sdrWhitePointNits * kMaxScreenshotHeadroom, displayBrightnessNits); } if (requestedDataspace == ui::Dataspace::UNKNOWN) { Loading @@ -7811,6 +7820,7 @@ ftl::SharedFuture<FenceResult> SurfaceFlinger::renderScreenImpl( } } } } captureResults.buffer = capturedBuffer->getBuffer(); Loading