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

Commit a5a581d7 authored by Sally Qi's avatar Sally Qi Committed by Android (Google) Code Review
Browse files

Merge "[Lut] fix over-saturated issue on GPU composition" into main

parents 208f88a7 f22d7836
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@
#include <ui/ColorSpace.h>

#include "include/core/SkColorSpace.h"
#include "src/core/SkColorFilterPriv.h"

using aidl::android::hardware::graphics::composer3::LutProperties;

@@ -116,7 +115,7 @@ static const SkString kShader = SkString(R"(
                linear = mix(c0, c1, linear.b);
            }
        }
        return float4(linear, rgba.a);
        return float4(fromLinearSrgb(linear), rgba.a);
    })");

// same as shader::toColorSpace function
@@ -289,9 +288,7 @@ sk_sp<SkShader> LutShader::lutShader(sk_sp<SkShader>& input,
                                      lutProperties[i].samplingKey, srcDataspace);
        }

        auto colorXformLutToDst =
                SkColorFilterPriv::MakeColorSpaceXform(lutMathColorSpace, outColorSpace);
        input = input->makeWithColorFilter(colorXformLutToDst);
        input = input->makeWithWorkingColorSpace(outColorSpace);
    }
    return input;
}