| Index: cc/paint/display_item_list.h
|
| diff --git a/cc/paint/display_item_list.h b/cc/paint/display_item_list.h
|
| index b65707dc6e0f2d445206627e319811c27378ee78..2122235a590096595d3de4377c972ff74a41e242 100644
|
| --- a/cc/paint/display_item_list.h
|
| +++ b/cc/paint/display_item_list.h
|
| @@ -18,6 +18,7 @@
|
| #include "cc/base/rtree.h"
|
| #include "cc/paint/discardable_image_map.h"
|
| #include "cc/paint/display_item.h"
|
| +#include "cc/paint/drawing_display_item.h"
|
| #include "cc/paint/image_id.h"
|
| #include "cc/paint/paint_export.h"
|
| #include "third_party/skia/include/core/SkPicture.h"
|
| @@ -119,7 +120,10 @@ class CC_PAINT_EXPORT DisplayItemList
|
| visual_rects_.push_back(visual_rect);
|
| GrowCurrentBeginItemVisualRect(visual_rect);
|
|
|
| - return AllocateAndConstruct<DisplayItemType>(std::forward<Args>(args)...);
|
| + const auto& item =
|
| + AllocateAndConstruct<DisplayItemType>(std::forward<Args>(args)...);
|
| + has_discardable_images_ |= item.picture->HasDiscardableImages();
|
| + return item;
|
| }
|
|
|
| // Called after all items are appended, to process the items and, if
|
| @@ -137,7 +141,6 @@ class CC_PAINT_EXPORT DisplayItemList
|
|
|
| void EmitTraceSnapshot() const;
|
|
|
| - void GenerateDiscardableImagesMetadata();
|
| void GetDiscardableImagesInRect(const gfx::Rect& rect,
|
| float contents_scale,
|
| const gfx::ColorSpace& target_color_space,
|
| @@ -160,6 +163,8 @@ class CC_PAINT_EXPORT DisplayItemList
|
| return items_.end();
|
| }
|
|
|
| + bool has_discardable_images() const { return has_discardable_images_; }
|
| +
|
| private:
|
| FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, AsValueWithNoItems);
|
| FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, AsValueWithItems);
|
| @@ -181,6 +186,8 @@ class CC_PAINT_EXPORT DisplayItemList
|
| return *item;
|
| }
|
|
|
| + void GenerateDiscardableImagesMetadata();
|
| +
|
| RTree rtree_;
|
| DiscardableImageMap image_map_;
|
| ContiguousContainer<DisplayItem> items_;
|
| @@ -198,6 +205,7 @@ class CC_PAINT_EXPORT DisplayItemList
|
| // For testing purposes only. Whether to keep visual rects across calls to
|
| // Finalize().
|
| bool retain_visual_rects_ = false;
|
| + bool has_discardable_images_ = false;
|
|
|
| friend class base::RefCountedThreadSafe<DisplayItemList>;
|
| FRIEND_TEST_ALL_PREFIXES(DisplayItemListTest, ApproximateMemoryUsage);
|
|
|