Commit c2154516 authored by Christopher Cameron's avatar Christopher Cameron Committed by Commit Bot

Windows HDR: Disable HDR mode when no HDR or WCG content is present

This allows us to remove the color conversion render pass, and use
a lower-bit depth format.

Bug: 1037954
Change-Id: I6810b1105d47c3690d371f92700182ef4f13e7a2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2060664
Commit-Queue: ccameron <ccameron@chromium.org>
Reviewed-by: default avatarSunny Sachanandani <sunnyps@chromium.org>
Reviewed-by: default avatarRobert Liao <robliao@chromium.org>
Cr-Commit-Position: refs/heads/master@{#742357}
parent 3e853e92
......@@ -211,6 +211,8 @@ Display CreateDisplayFromDisplayInfo(const DisplayInfo& display_info,
display.set_display_frequency(display_info.display_frequency());
if (!Display::HasForceDisplayColorProfile()) {
if (hdr_enabled) {
// This will map to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709 with
// DXGI_FORMAT_B8G8R8A8_UNORM.
gfx::DisplayColorSpaces color_spaces(gfx::ColorSpace::CreateSRGB(),
gfx::BufferFormat::BGRA_8888);
......@@ -225,10 +227,9 @@ Display CreateDisplayFromDisplayInfo(const DisplayInfo& display_info,
const auto hdr10 =
gfx::ColorSpace::CreateHDR10(display_info.sdr_white_level());
// For the moment, always use HDR color space. Once we raster sRGB content
// as sRGB, we can dynamically switch in and out of HDR mode.
// Use HDR color spaces only when there is WCG or HDR content on the
// screen.
const gfx::ContentColorUsage content_color_usages[] = {
gfx::ContentColorUsage::kSRGB,
gfx::ContentColorUsage::kWideColorGamut,
gfx::ContentColorUsage::kHDR,
};
......
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