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

Unified Diff: cc/paint/display_item_list.cc

Issue 2830243002: cc: Don't perform image analysis if the DisplayItemList has no images. (Closed)
Patch Set: for-draw-ops-only 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
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(

Powered by Google App Engine
This is Rietveld 408576698