Use the correct dataspace in shaders.cpp
This improves the quality of HDR->SDR tone-mapping in TextureView by removing an incorrect gamut mapping which was causing undesired hue shift. The technical detail is that in TextureView, skia will color manage the input image to the destination colorspace prior to tone-mapping. The tone-mapping shader library compensates when authoring the shader to use the correct EOTF when re-decoding the image, but did not compensate when binding uniforms. This patch compensates accordingly so that the correct gamut->gamut mapping is applied. This patch adds a brief test suite for libshaders to verify that the correct color gamut matrices are being selected. Bug: 234355355 Test: Observe accurate HLG colors in Photos and Instagram where TextureView is used for media playback. Test: libshaders_test Change-Id: I801349cfe1780880a55528fd7e91ff1ac553281b
Loading
Please register or sign in to comment