Skip to content

Commit f22d783

Browse files
author
Sally Qi
committed
[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
1 parent d15c73e commit f22d783

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

libs/renderengine/skia/filters/LutShader.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
#include <ui/ColorSpace.h>
2525

2626
#include "include/core/SkColorSpace.h"
27-
#include "src/core/SkColorFilterPriv.h"
2827

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

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

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

292-
auto colorXformLutToDst =
293-
SkColorFilterPriv::MakeColorSpaceXform(lutMathColorSpace, outColorSpace);
294-
input = input->makeWithColorFilter(colorXformLutToDst);
291+
input = input->makeWithWorkingColorSpace(outColorSpace);
295292
}
296293
return input;
297294
}

0 commit comments

Comments
 (0)