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

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

Merge "Actually apply color transform for GPU comp."

parents e6312c8d c7e8ce8f
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
@@ -3255,7 +3255,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;
@@ -3314,7 +3313,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;
        }
    }