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

Commit c7e8ce8f authored by Alec Mouri's avatar Alec Mouri
Browse files

Actually apply color transform for GPU comp.

Bug: 129573282
Test: boots
Change-Id: I0a2f9c87fd2eb09ea9c343d5ec9b309644aaeb8b
parent 945a7006
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@

#include <cstdint>

#include <math/mat4.h>
#include <ui/GraphicTypes.h>
#include <ui/Rect.h>
#include <ui/Region.h>
@@ -78,6 +79,9 @@ struct OutputCompositionState {
    // The color transform to apply
    android_color_transform_t colorTransform{HAL_COLOR_TRANSFORM_IDENTITY};

    // The color transform matrix to apply, corresponding with colorTransform.
    mat4 colorTransformMat;

    // Current active color mode
    ui::ColorMode colorMode{ui::ColorMode::NATIVE};

+1 −0
Original line number Diff line number Diff line
@@ -98,6 +98,7 @@ void Output::setColorTransform(const mat4& transform) {
    }

    mState.colorTransform = newColorTransform;
    mState.colorTransformMat = transform;

    dirtyEntireOutput();
}
+1 −2
Original line number Diff line number Diff line
@@ -3288,7 +3288,6 @@ bool SurfaceFlinger::doComposeSurfaces(const sp<DisplayDevice>& displayDevice,
    const bool hasClientComposition = getHwComposer().hasClientComposition(displayId);
    ATRACE_INT("hasClientComposition", hasClientComposition);

    mat4 colorMatrix;
    bool applyColorMatrix = false;

    renderengine::DisplaySettings clientCompositionDisplay;
@@ -3346,7 +3345,7 @@ bool SurfaceFlinger::doComposeSurfaces(const sp<DisplayDevice>& displayDevice,
        // Compute the global color transform matrix.
        applyColorMatrix = !hasDeviceComposition && !skipClientColorTransform;
        if (applyColorMatrix) {
            clientCompositionDisplay.colorTransform = colorMatrix;
            clientCompositionDisplay.colorTransform = displayState.colorTransformMat;
        }
    }