Fix luminance normalization for HLG

When skia color manages, 75% of the HLG signal maps to 1.0. But, this
does not correspond to 203 nits, this actually corresponds to about 265
nits, as the HLG OOTF is not yet applied.

We need to fix this by using a factor of 265 / 1000 to normalize the
signal to a [0-1] range for the LUT lookup. Otherwise, we end up dimming
the HLG signal when tonemapping.

Also, clean up some color management...
* Moving creating the linear working space creating the lut shader,
  rather than applying it to the input + output shader, as that doesn't
  actually apply the working space in the "right" place when executing
  the lut shader
* Remove the toLinearSrgb/fromLinearSrgb intrinsics, which were
  in-place, probably because we weren't actually applying the working
  space. This has the side-effect of looking up linear colors in the
  input image's gamut rather than the sRGB gamut, so we won't clip wide
  colors.

Bug: 418740883
Flag: EXEMPT bug fix
Test: VTS
Test: Photos playback
Test: Youtube playback
Change-Id: I1c8c231b3722ae33112010baeead7cfed94bcc30
1 file changed