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

Commit 5c8a523d authored by Alec Mouri's avatar Alec Mouri
Browse files

Always specify that screenshots avoid dimming for transitions.

A screenshot may captured dimmed content even when HDR is off-screen,
for instance shortly after playback of HDR ends and the display is
taking some time to transition out of high brightness mode.

So, avoid dimming twice for those screenshot-based transitions by always
avoiding dimming.

Bug: 293560925
Test: rotation animation after HDR video plays
Test: rotation animation while HDR video plays
Change-Id: Iff541c21deb1ab483f80912c4dfd989ade6d1727
parent 671a9f66
Loading
Loading
Loading
Loading
+3 −4
Original line number Diff line number Diff line
@@ -1303,11 +1303,10 @@ public class TransitionAnimation {
            ScreenCapture.ScreenshotHardwareBuffer buffer) {
        t.setBuffer(layer, buffer.getHardwareBuffer());
        t.setDataSpace(layer, buffer.getColorSpace().getDataSpace());
        // Avoid showing dimming effect for HDR content when running animation.
        if (buffer.containsHdrLayers()) {
        // Avoid showing dimming effect for HDR content when running animations.
        // TODO(b/298219334): Only do this if we know we already dimmed in the screenshot
        t.setDimmingEnabled(layer, false);
    }
    }

    /** Returns whether the hardware buffer passed in is marked as protected. */
    public static boolean hasProtectedContent(HardwareBuffer hardwareBuffer) {