Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1207)

Unified Diff: cc/tiles/gpu_image_decode_cache.cc

Issue 2801413002: color: Enable color conversion in image decoder caches (Closed)
Patch Set: Rebase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/tiles/software_image_decode_cache.h » ('j') | cc/tiles/software_image_decode_cache.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/tiles/gpu_image_decode_cache.cc
diff --git a/cc/tiles/gpu_image_decode_cache.cc b/cc/tiles/gpu_image_decode_cache.cc
index 0f152a44ae55604840581be6c2a7ac844af8e564..39a822617dba6ab31d8606c710c47382018a576a 100644
--- a/cc/tiles/gpu_image_decode_cache.cc
+++ b/cc/tiles/gpu_image_decode_cache.cc
@@ -1130,9 +1130,6 @@ void GpuImageDecodeCache::DecodeImageIfNecessary(const DrawImage& draw_image,
}
}
- // TODO(ccameron,msarett): Convert image to target color space.
- // http://crbug.com/706613
-
if (image_data->decode.data()) {
// An at-raster task decoded this before us. Ingore our decode.
return;
@@ -1196,6 +1193,14 @@ void GpuImageDecodeCache::UploadImageIfNecessary(const DrawImage& draw_image,
image_data->decode.mark_used();
DCHECK(uploaded_image);
+ if (draw_image.target_color_space().IsValid()) {
+ TRACE_EVENT0("cc", "GpuImageDecodeCache::UploadImage - color conversion");
+ uploaded_image = uploaded_image->makeColorSpace(
+ draw_image.target_color_space().ToSkColorSpace(),
+ SkTransferFunctionBehavior::kIgnore);
+ }
+ DCHECK(uploaded_image);
+
// At-raster may have decoded this while we were unlocked. If so, ignore our
// result.
if (!image_data->upload.image())
@@ -1214,8 +1219,7 @@ GpuImageDecodeCache::CreateImageData(const DrawImage& draw_image) {
draw_image.matrix(), CalculateUploadScaleFilterQuality(draw_image),
upload_scale_mip_level);
size_t data_size = draw_image.image()->getDeferredTextureImageData(
- *context_threadsafe_proxy_.get(), &params, 1, nullptr,
- draw_image.target_color_space().ToSkColorSpace().get());
+ *context_threadsafe_proxy_.get(), &params, 1, nullptr, nullptr);
if (data_size == 0) {
// Can't upload image, too large or other failure. Try to use SW fallback.
« no previous file with comments | « no previous file | cc/tiles/software_image_decode_cache.h » ('j') | cc/tiles/software_image_decode_cache.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698