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

Commit f22d7836 authored by Sally Qi's avatar Sally Qi
Browse files

[Lut] fix over-saturated issue on GPU composition

Bug: 398007850
Test: play Youtube and toggle between gpu/dup; ASurfaceControlTest;
SurfaceControlTest
Flag: EXEMPT bugfix

Change-Id: I86a5dae18621b271bc4ff6251b53f57cf822bdbb
parent d15c73e4
Loading
Loading
Loading
Loading
+2 −5
Original line number Original line Diff line number Diff line
@@ -24,7 +24,6 @@
#include <ui/ColorSpace.h>
#include <ui/ColorSpace.h>


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


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


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


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


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