Commit 78e1b8e5 authored by Christopher Cameron's avatar Christopher Cameron Committed by Commit Bot

Canvas: Cache images in canvas color space

Ensure that the CanvasImageProvider use its target canvas' color space
as its target color space. This was previously hard-coded to sRGB, which
caused images to be clipped when drawn to wide color gamut canvases.

Bug: 1115286
Change-Id: I42c7cca905b5a9f525854ca2c6e99d0f87016eec
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2551836
Commit-Queue: ccameron <ccameron@chromium.org>
Auto-Submit: ccameron <ccameron@chromium.org>
Reviewed-by: default avatarKhushal <khushalsagar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#829676}
parent dacfc31c
......@@ -1134,8 +1134,9 @@ CanvasResourceProvider::GetOrCreateCanvasImageProvider() {
: cc::PlaybackImageProvider::RasterMode::kGpu;
}
canvas_image_provider_ = std::make_unique<CanvasImageProvider>(
ImageDecodeCacheRGBA8(), cache_f16, gfx::ColorSpace::CreateSRGB(),
color_params_.GetSkColorType(), raster_mode);
ImageDecodeCacheRGBA8(), cache_f16,
ColorParams().GetStorageGfxColorSpace(), color_params_.GetSkColorType(),
raster_mode);
}
return canvas_image_provider_.get();
}
......
......@@ -46,7 +46,7 @@ var rec2020TransparentBlackImage = [0.16858, 0.16858, 0.16858, 0.50195];
function testPixels(ctx, tests, sourceType)
{
var actual, expected, tolerance = 0.01;
var actual, expected, tolerance = 0.02;
if (sourceType === 'video')
tolerance = 0.04;
for (var i = 0; i < tests.length; i++) {
......
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