Commit 900f1306 authored by Chris Blume's avatar Chris Blume Committed by Commit Bot

Make color conversion Windows-only

SurfaceAggregator's call to AddColorConversionPass() currently
happens on all platforms. But it should be a no-op on every
platform except Windows.

On other platforms, there is a proper gamma curve. But on Windows
it is linear. This results in color values that are outside an
acceptable threshold. That is why a color conversion is necessary.

The intent was for this to only happen on Windows. This CL matches
that intent by explicitly marking that function call as only
happening on Windows.

Change-Id: I66ebf3b42b84729e6062ff738c25d903aac2dc5a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1900286Reviewed-by: default avatarccameron <ccameron@chromium.org>
Commit-Queue: Chris Blume <cblume@chromium.org>
Cr-Commit-Position: refs/heads/master@{#713664}
parent 92df0f27
......@@ -800,6 +800,18 @@ void SurfaceAggregator::AddColorConversionPass() {
if (root_render_pass->color_space == output_color_space_)
return;
// An extra color conversion pass is only done if the display's color
// space is unsuitable as a working color space. This happens only
// on Windows, where HDR output is required to be in a space with a linear
// (or PQ) transfer function.
// TODO(ccameron,sunnyps): Determine if blending in PQ space is close
// enough to sRGB space as to not require this extra pass.
// Or at least to avoid changing behavior.
if (output_color_space_ != gfx::ColorSpace::CreateSCRGBLinear() &&
output_color_space_ != gfx::ColorSpace::CreateHDR10()) {
return;
}
gfx::Rect output_rect = root_render_pass->output_rect;
CHECK(root_render_pass->transform_to_root_target == gfx::Transform());
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment