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

Unified Diff: cc/playback/display_item_list.h

Issue 1835843002: WIP: Fix foreignObject cullrect Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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
« no previous file with comments | « cc/playback/display_item.h ('k') | cc/playback/display_item_list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/playback/display_item_list.h
diff --git a/cc/playback/display_item_list.h b/cc/playback/display_item_list.h
index 5d33d24795a34a44ae17b6dfe577d22a7bf881c2..dd5d71a9627f6b05aba929afe47665387916d9cb 100644
--- a/cc/playback/display_item_list.h
+++ b/cc/playback/display_item_list.h
@@ -15,12 +15,14 @@
#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 "skia/ext/refptr.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.
@@ -64,11 +61,6 @@ class CC_EXPORT DisplayItemList
const gfx::Rect& canvas_target_playback_rect,
float contents_scale) const;
- // This is a fast path for use only if canvas_ is set and
- // retain_individual_display_items_ is false. This method also updates
- // is_suitable_for_gpu_rasterization_ and 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.
@@ -82,8 +74,8 @@ class CC_EXPORT DisplayItemList
// TODO(crbug.com/513016): None of the items might individually trigger a
// veto even though they collectively have enough "bad" operations that a
// corresponding flattened Picture would get vetoed.
- is_suitable_for_gpu_rasterization_ &= item->IsSuitableForGpuRasterization();
- ProcessAppendedItem(item);
+ all_items_are_suitable_for_gpu_rasterization_ &=
+ item->IsSuitableForGpuRasterization();
return *item;
}
@@ -96,8 +88,6 @@ class CC_EXPORT DisplayItemList
size_t ApproximateMemoryUsage() const;
bool ShouldBeAnalyzedForSolidColor() const;
- bool RetainsIndividualDisplayItems() const;
-
scoped_ptr<base::trace_event::ConvertableToTraceFormat> AsValue(
bool include_items) const;
@@ -110,15 +100,20 @@ class CC_EXPORT DisplayItemList
bool MayHaveDiscardableImages() const;
gfx::Rect VisualRectForTesting(int index) { return visual_rects_[index]; }
+ void SetRetainVisualRectsForTesting(bool retain) {
+ retain_visual_rects_ = retain;
+ }
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);
+ gfx::Rect GetQueryRect(const gfx::Rect& rect, float scale) const;
+
+ 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
@@ -126,20 +121,12 @@ 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_;
+ bool retain_visual_rects_;
- scoped_ptr<SkPictureRecorder> recorder_;
- skia::RefPtr<SkCanvas> canvas_;
const DisplayItemListSettings settings_;
- bool retain_individual_display_items_;
-
- gfx::Rect layer_rect_;
- bool is_suitable_for_gpu_rasterization_;
+ bool all_items_are_suitable_for_gpu_rasterization_;
int approximate_op_count_;
- // Memory usage due to the cached SkPicture.
- size_t picture_memory_usage_;
-
DiscardableImageMap image_map_;
friend class base::RefCountedThreadSafe<DisplayItemList>;
« no previous file with comments | « cc/playback/display_item.h ('k') | cc/playback/display_item_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698