| Index: cc/playback/display_item_list.h
|
| diff --git a/cc/playback/display_item_list.h b/cc/playback/display_item_list.h
|
| index 710284e4c579c06173390638cf643dafada9c1ea..5d185f441502ad0e6ee228631102370a88682825 100644
|
| --- a/cc/playback/display_item_list.h
|
| +++ b/cc/playback/display_item_list.h
|
| @@ -16,11 +16,13 @@
|
| #include "base/trace_event/trace_event.h"
|
| #include "cc/base/cc_export.h"
|
| #include "cc/base/contiguous_container.h"
|
| +#include "cc/base/rtree.h"
|
| #include "cc/playback/discardable_image_map.h"
|
| #include "cc/playback/display_item.h"
|
| #include "cc/playback/display_item_list_settings.h"
|
| #include "third_party/skia/include/core/SkPicture.h"
|
| #include "ui/gfx/geometry/rect.h"
|
| +#include "ui/gfx/geometry/rect_conversions.h"
|
|
|
| class SkCanvas;
|
| class SkPictureRecorder;
|
| @@ -37,13 +39,8 @@ class DisplayItemList;
|
| class CC_EXPORT DisplayItemList
|
| : public base::RefCountedThreadSafe<DisplayItemList> {
|
| public:
|
| - // Creates a display item list. If picture caching is used, then layer_rect
|
| - // specifies the cull rect of the display item list (the picture will not
|
| - // exceed this rect). If picture caching is not used, then the given rect can
|
| - // be empty.
|
| - // TODO(vmpstr): Maybe this cull rect can be part of the settings instead.
|
| + // Creates a display item list.
|
| static scoped_refptr<DisplayItemList> Create(
|
| - const gfx::Rect& layer_rect,
|
| const DisplayItemListSettings& settings);
|
|
|
| // Creates a DisplayItemList from a Protobuf.
|
| @@ -65,11 +62,6 @@ class CC_EXPORT DisplayItemList
|
|
|
| void Raster(SkCanvas* canvas, SkPicture::AbortCallback* callback) const;
|
|
|
| - // This is a fast path for use only if canvas_ is set and
|
| - // retain_individual_display_items_ is false. This method also updates
|
| - // approximate_op_count_.
|
| - void RasterIntoCanvas(const DisplayItem& display_item);
|
| -
|
| // Because processing happens in this function, all the set up for
|
| // this item should be done via the args, which is why the return
|
| // type needs to be const, to prevent set-after-processing mistakes.
|
| @@ -80,7 +72,6 @@ class CC_EXPORT DisplayItemList
|
| auto* item = &items_.AllocateAndConstruct<DisplayItemType>(
|
| std::forward<Args>(args)...);
|
| approximate_op_count_ += item->ApproximateOpCount();
|
| - ProcessAppendedItem(item);
|
| return *item;
|
| }
|
|
|
| @@ -89,15 +80,13 @@ class CC_EXPORT DisplayItemList
|
| void Finalize();
|
|
|
| void SetIsSuitableForGpuRasterization(bool is_suitable) {
|
| - is_suitable_for_gpu_rasterization_ = is_suitable;
|
| + all_items_are_suitable_for_gpu_rasterization_ = is_suitable;
|
| }
|
| bool IsSuitableForGpuRasterization() const;
|
| int ApproximateOpCount() const;
|
| size_t ApproximateMemoryUsage() const;
|
| bool ShouldBeAnalyzedForSolidColor() const;
|
|
|
| - bool RetainsIndividualDisplayItems() const;
|
| -
|
| std::unique_ptr<base::trace_event::ConvertableToTraceFormat> AsValue(
|
| bool include_items) const;
|
|
|
| @@ -109,6 +98,9 @@ class CC_EXPORT DisplayItemList
|
| std::vector<DrawImage>* images);
|
|
|
| gfx::Rect VisualRectForTesting(int index) { return visual_rects_[index]; }
|
| + void SetRetainVisualRectsForTesting(bool retain) {
|
| + retain_visual_rects_ = retain;
|
| + }
|
|
|
| ContiguousContainer<DisplayItem>::const_iterator begin() const {
|
| return items_.begin();
|
| @@ -119,13 +111,13 @@ class CC_EXPORT DisplayItemList
|
| }
|
|
|
| private:
|
| - DisplayItemList(gfx::Rect layer_rect,
|
| - const DisplayItemListSettings& display_list_settings,
|
| - bool retain_individual_display_items);
|
| + explicit DisplayItemList(
|
| + const DisplayItemListSettings& display_list_settings);
|
| ~DisplayItemList();
|
|
|
| void ProcessAppendedItem(const DisplayItem* item);
|
|
|
| + RTree rtree_;
|
| ContiguousContainer<DisplayItem> items_;
|
| // The visual rects associated with each of the display items in the
|
| // display item list. There is one rect per display item, and the
|
| @@ -133,18 +125,13 @@ class CC_EXPORT DisplayItemList
|
| // |items_| . These rects are intentionally kept separate
|
| // because they are not needed while walking the |items_| for raster.
|
| std::vector<gfx::Rect> visual_rects_;
|
| - sk_sp<SkPicture> picture_;
|
| + // For testing purposes only. Whether to keep visual rects across calls to
|
| + // Finalize().
|
| + bool retain_visual_rects_ = false;
|
|
|
| - std::unique_ptr<SkPictureRecorder> recorder_;
|
| const DisplayItemListSettings settings_;
|
| - bool retain_individual_display_items_;
|
| -
|
| - gfx::Rect layer_rect_;
|
| - bool is_suitable_for_gpu_rasterization_;
|
| - int approximate_op_count_;
|
| -
|
| - // Memory usage due to the cached SkPicture.
|
| - size_t picture_memory_usage_;
|
| + bool all_items_are_suitable_for_gpu_rasterization_ = true;
|
| + int approximate_op_count_ = 0;
|
|
|
| DiscardableImageMap image_map_;
|
|
|
|
|