Index: cc/paint/display_item_list.cc |
diff --git a/cc/paint/display_item_list.cc b/cc/paint/display_item_list.cc |
index c1b069548409f6a31a1aeea75870222fc5c62645..432b0baf840a8690c097e6eae68f3ecc9aebdaa0 100644 |
--- a/cc/paint/display_item_list.cc |
+++ b/cc/paint/display_item_list.cc |
@@ -262,6 +262,8 @@ void DisplayItemList::Finalize() { |
// This clears both the vector and the vector's capacity, since |
// visual_rects won't be used anymore. |
std::vector<gfx::Rect>().swap(visual_rects_); |
+ |
+ GenerateDiscardableImagesMetadata(); |
} |
bool DisplayItemList::IsSuitableForGpuRasterization() const { |
@@ -526,6 +528,8 @@ DisplayItemList::CreateTracedValue(bool include_items) const { |
void DisplayItemList::GenerateDiscardableImagesMetadata() { |
// This should be only called once. |
DCHECK(image_map_.empty()); |
+ if (!has_discardable_images_) |
+ return; |
gfx::Rect bounds = rtree_.GetBounds(); |
DiscardableImageMap::ScopedMetadataGenerator generator( |