Commit 4cabff3a authored by Daniele Castagna's avatar Daniele Castagna Committed by Commit Bot

cc: Make UI resources use raster color space

UI resources are rastered in sRGB, if the screen
has a different color space, a color conversion step
will be added to the fragment shader.

This CL creates UI resources directly in the color space
used by the final compositing step, so that
the conversion can be skipped.

Bug: 1129243
Change-Id: Ia9659cbb993ebb16097079daf6c7e67aecf0525f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2441932
Commit-Queue: Daniele Castagna <dcastagna@chromium.org>
Reviewed-by: default avatarccameron <ccameron@chromium.org>
Cr-Commit-Position: refs/heads/master@{#814330}
parent 0b4e5b62
...@@ -4242,8 +4242,9 @@ void LayerTreeHostImpl::CreateUIResource(UIResourceId uid, ...@@ -4242,8 +4242,9 @@ void LayerTreeHostImpl::CreateUIResource(UIResourceId uid,
const gfx::Size source_size = bitmap.GetSize(); const gfx::Size source_size = bitmap.GetSize();
gfx::Size upload_size = bitmap.GetSize(); gfx::Size upload_size = bitmap.GetSize();
bool scaled = false; bool scaled = false;
// UIResources are assumed to be rastered in SRGB. // UIResources are assumed to be rastered in raster color space.
const gfx::ColorSpace& color_space = gfx::ColorSpace::CreateSRGB(); const gfx::ColorSpace& color_space =
GetRasterColorSpace(gfx::ContentColorUsage::kSRGB);
if (source_size.width() > max_texture_size_ || if (source_size.width() > max_texture_size_ ||
source_size.height() > max_texture_size_) { source_size.height() > max_texture_size_) {
......
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