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

Commit 6c903caa authored by Sally Qi's avatar Sally Qi
Browse files

Fix rotation flicker issue when screenshot rotates with HDR content.

- instead of using max luminance, assign whitePointNits according to if
  the layer is an HDR one.

Bug: 229694638
Test: play HDR video on YouTube and rotates
Change-Id: I7c6e6a1112bcc2c5a13f07172492a02552ea9a53
parent 8e5ba105
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -6709,6 +6709,9 @@ std::shared_future<renderengine::RenderEngineResult> SurfaceFlinger::renderScree
    auto dataspace = renderArea.getReqDataSpace();
    auto parent = renderArea.getParentLayer();
    auto renderIntent = RenderIntent::TONE_MAP_COLORIMETRIC;
    auto sdrWhitePointNits = DisplayDevice::sDefaultMaxLumiance;
    auto displayBrightnessNits = DisplayDevice::sDefaultMaxLumiance;

    if ((dataspace == ui::Dataspace::UNKNOWN) && (parent != nullptr)) {
        Mutex::Autolock lock(mStateLock);
        auto display = findDisplay([layerStack = parent->getLayerStack()](const auto& display) {
@@ -6722,6 +6725,8 @@ std::shared_future<renderengine::RenderEngineResult> SurfaceFlinger::renderScree
        const ui::ColorMode colorMode = display->getCompositionDisplay()->getState().colorMode;
        dataspace = pickDataspaceFromColorMode(colorMode);
        renderIntent = display->getCompositionDisplay()->getState().renderIntent;
        sdrWhitePointNits = display->getCompositionDisplay()->getState().sdrWhitePointNits;
        displayBrightnessNits = display->getCompositionDisplay()->getState().displayBrightnessNits;
    }
    captureResults.capturedDataspace = dataspace;

@@ -6780,7 +6785,7 @@ std::shared_future<renderengine::RenderEngineResult> SurfaceFlinger::renderScree
                                       BlurSetting::Disabled
                             : compositionengine::LayerFE::ClientCompositionTargetSettings::
                                       BlurSetting::Enabled,
                DisplayDevice::sDefaultMaxLumiance,
                isHdrDataspace(dataspace) ? displayBrightnessNits : sdrWhitePointNits,

        };
        std::vector<compositionengine::LayerFE::LayerSettings> results =