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

Unified Diff: cc/paint/discardable_image_map.cc

Issue 2797583002: cc: Add color space to image decode caches (Closed)
Patch Set: Fix perf test compile Created 3 years, 9 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
Index: cc/paint/discardable_image_map.cc
diff --git a/cc/paint/discardable_image_map.cc b/cc/paint/discardable_image_map.cc
index 2daef282d19514d067497f92109c8badcdc05471..d501d472f487752da0d1e05aab6553075365e659 100644
--- a/cc/paint/discardable_image_map.cc
+++ b/cc/paint/discardable_image_map.cc
@@ -215,10 +215,15 @@ class DiscardableImagesMetadataCanvas : public SkNWayCanvas {
// raster the picture (using device clip bounds that are outset).
image_rect.Inset(-1, -1);
+ // The true target color space will be assigned when it is known, in
+ // GetDiscardableImagesInRect.
+ gfx::ColorSpace target_color_space;
+
(*image_id_to_rect_)[image->uniqueID()].Union(image_rect);
- image_set_->push_back(std::make_pair(
- DrawImage(std::move(image), src_irect, filter_quality, matrix),
- image_rect));
+ image_set_->push_back(
+ std::make_pair(DrawImage(std::move(image), src_irect, filter_quality,
+ matrix, target_color_space),
+ image_rect));
}
// Currently this function only handles extracting images from SkImageShaders
@@ -271,11 +276,14 @@ void DiscardableImageMap::EndGeneratingMetadata() {
void DiscardableImageMap::GetDiscardableImagesInRect(
const gfx::Rect& rect,
float contents_scale,
+ const gfx::ColorSpace& target_color_space,
std::vector<DrawImage>* images) const {
std::vector<size_t> indices;
images_rtree_.Search(rect, &indices);
- for (size_t index : indices)
- images->push_back(all_images_[index].first.ApplyScale(contents_scale));
+ for (size_t index : indices) {
+ images->push_back(all_images_[index].first.ApplyScaleAndColorSpace(
vmpstr 2017/04/04 01:16:43 nit: Can you make this ApplyScale(...).ApplyColorS
ccameron 2017/04/04 06:41:10 Done.
+ contents_scale, target_color_space));
+ }
}
gfx::Rect DiscardableImageMap::GetRectForImage(ImageId image_id) const {

Powered by Google App Engine
This is Rietveld 408576698