| Index: cc/paint/display_item_list.cc
|
| diff --git a/cc/paint/display_item_list.cc b/cc/paint/display_item_list.cc
|
| index 432b0baf840a8690c097e6eae68f3ecc9aebdaa0..1b33b7b4460174acf81aff68dac867cea49d17a6 100644
|
| --- a/cc/paint/display_item_list.cc
|
| +++ b/cc/paint/display_item_list.cc
|
| @@ -19,6 +19,7 @@
|
| #include "cc/paint/clip_display_item.h"
|
| #include "cc/paint/clip_path_display_item.h"
|
| #include "cc/paint/compositing_display_item.h"
|
| +#include "cc/paint/discardable_image_store.h"
|
| #include "cc/paint/drawing_display_item.h"
|
| #include "cc/paint/filter_display_item.h"
|
| #include "cc/paint/float_clip_display_item.h"
|
| @@ -534,9 +535,22 @@ void DisplayItemList::GenerateDiscardableImagesMetadata() {
|
| gfx::Rect bounds = rtree_.GetBounds();
|
| DiscardableImageMap::ScopedMetadataGenerator generator(
|
| &image_map_, gfx::Size(bounds.right(), bounds.bottom()));
|
| - auto* canvas = generator.canvas();
|
| - for (const auto& item : items_)
|
| - RasterItem(item, canvas, nullptr);
|
| + GatherDiscardableImages(generator.image_store());
|
| +}
|
| +
|
| +void DisplayItemList::GatherDiscardableImages(
|
| + DiscardableImageStore* image_store) const {
|
| + // TODO(khushalsagar): Could we avoid this if the data was already stored in
|
| + // the |image_map_|?
|
| + SkCanvas* canvas = image_store->NoDrawCanvas();
|
| + for (const auto& item : items_) {
|
| + if (item.type == DisplayItem::DRAWING) {
|
| + const auto& drawing_item = static_cast<const DrawingDisplayItem&>(item);
|
| + drawing_item.picture->GatherDiscardableImages(image_store);
|
| + } else {
|
| + RasterItem(item, canvas, nullptr);
|
| + }
|
| + }
|
| }
|
|
|
| void DisplayItemList::GetDiscardableImagesInRect(
|
|
|