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

Unified Diff: cc/paint/discardable_image_map.cc

Issue 2797583002: cc: Add color space to image decode caches (Closed)
Patch Set: Remove dead code 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 | « cc/paint/discardable_image_map.h ('k') | cc/paint/discardable_image_map_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..c1a3b57ccb532bfc4affac0e30c903625af7c0ca 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,15 @@ 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.ApplyScale(contents_scale)
+ .ApplyTargetColorSpace(target_color_space));
+ }
}
gfx::Rect DiscardableImageMap::GetRectForImage(ImageId image_id) const {
« no previous file with comments | « cc/paint/discardable_image_map.h ('k') | cc/paint/discardable_image_map_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698