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

Unified Diff: cc/resources/display_list_raster_source.cc

Issue 1045953002: Implement DisplayList GatherPixelRefs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix crash w/ unittest Created 5 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
« no previous file with comments | « cc/resources/display_item_list.cc ('k') | cc/resources/display_list_recording_source.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/resources/display_list_raster_source.cc
diff --git a/cc/resources/display_list_raster_source.cc b/cc/resources/display_list_raster_source.cc
index e35900a065f7637f8f3aa3ceb23d3b3518687fb3..9a0bc9111506c0c92b61e447c8ac1a572b41f519 100644
--- a/cc/resources/display_list_raster_source.cc
+++ b/cc/resources/display_list_raster_source.cc
@@ -159,7 +159,16 @@ void DisplayListRasterSource::GatherPixelRefs(
const gfx::Rect& content_rect,
float contents_scale,
std::vector<SkPixelRef*>* pixel_refs) const {
- // TODO(ajuma): Implement this.
+ DCHECK_EQ(0u, pixel_refs->size());
+
+ gfx::Rect layer_rect =
+ gfx::ScaleToEnclosingRect(content_rect, 1.0f / contents_scale);
+
+ PixelRefMap::Iterator iterator(layer_rect, display_list_.get());
+ while (iterator) {
+ pixel_refs->push_back(*iterator);
+ ++iterator;
+ }
}
bool DisplayListRasterSource::CoversRect(const gfx::Rect& content_rect,
« no previous file with comments | « cc/resources/display_item_list.cc ('k') | cc/resources/display_list_recording_source.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698