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

Commit 2c0ea355 authored by Alec Mouri's avatar Alec Mouri
Browse files

Treat dimming-disabled layers as HDR

Screen rotations currently capture an SDR screenshot, and rotate the
screenshot. If there is an HDR layer on screen, this causes the HDR
layer to be tone-mapped to SDR, and the screeenshot when fed back into
SurfaceFlinger has a tag that prevents the screenshot from being dimmed
so that the HDR layer can remain at the same brightness (modulo a
brightness change). But this means that the screenshot should be treated
as an HDR layer, as there is a noticeable dip and re-ramp up in
brightness.

Bug: 228197661
Test: builds, boots
Change-Id: I1d1b0dcaf230300ca34b84ea407d0817feb2c664
parent fcedb9ca
Loading
Loading
Loading
Loading
+6 −1
Original line number Original line Diff line number Diff line
@@ -2345,7 +2345,12 @@ void SurfaceFlinger::setCompositorTimingSnapped(const DisplayStatInfo& stats,
}
}


bool SurfaceFlinger::isHdrLayer(Layer* layer) const {
bool SurfaceFlinger::isHdrLayer(Layer* layer) const {
    if (!isHdrDataspace(layer->getDataSpace())) {
    // Treat all layers as non-HDR if:
    // 1. They do not have a valid HDR dataspace. Currently we treat those as PQ or HLG. and
    // 2. The layer is allowed to be dimmed. WindowManager may disable dimming in order to
    // keep animations invoking SDR screenshots of HDR layers seamless. Treat such tagged
    // layers as HDR so that DisplayManagerService does not try to change the screen brightness
    if (!isHdrDataspace(layer->getDataSpace()) && layer->isDimmingEnabled()) {
        return false;
        return false;
    }
    }
    if (mIgnoreHdrCameraLayers) {
    if (mIgnoreHdrCameraLayers) {