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

Commit 597b79c2 authored by Alec Mouri's avatar Alec Mouri Committed by Android (Google) Code Review
Browse files

Merge "Make screenshots leaving the device more consistent." into main

parents f1c4ef9c ffb3221d
Loading
Loading
Loading
Loading
+9 −2
Original line number Diff line number Diff line
@@ -7829,7 +7829,10 @@ ftl::SharedFuture<FenceResult> SurfaceFlinger::renderScreenImpl(
                                                     displayBrightnessNits);
                }
            }
            if (requestedDataspace == ui::Dataspace::UNKNOWN) {

            // Screenshots leaving the device should be colorimetric
            if (requestedDataspace == ui::Dataspace::UNKNOWN &&
                renderArea->getHintForSeamlessTransition()) {
                renderIntent = state.renderIntent;
            }
        }
@@ -7873,6 +7876,10 @@ ftl::SharedFuture<FenceResult> SurfaceFlinger::renderScreenImpl(
            }
        }

        // Screenshots leaving the device must not dim in gamma space.
        const bool dimInGammaSpaceForEnhancedScreenshots = mDimInGammaSpaceForEnhancedScreenshots &&
                renderArea->getHintForSeamlessTransition();

        std::shared_ptr<ScreenCaptureOutput> output = createScreenCaptureOutput(
                ScreenCaptureOutputArgs{.compositionEngine = *compositionEngine,
                                        .colorProfile = colorProfile,
@@ -7885,7 +7892,7 @@ ftl::SharedFuture<FenceResult> SurfaceFlinger::renderScreenImpl(
                                        .regionSampling = regionSampling,
                                        .treat170mAsSrgb = mTreat170mAsSrgb,
                                        .dimInGammaSpaceForEnhancedScreenshots =
                                                mDimInGammaSpaceForEnhancedScreenshots});
                                                dimInGammaSpaceForEnhancedScreenshots});

        const float colorSaturation = grayscale ? 0 : 1;
        compositionengine::CompositionRefreshArgs refreshArgs{