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

Unified Diff: cc/playback/display_item_list.h

Issue 2239913002: Allow filters to specify their initial visual rect. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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/blink/web_display_item_list_impl.cc ('k') | cc/playback/display_item_list_unittest.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 2f19bb77f4eba89e0c7971e96129818bde790e92..83ad4f43de24ccac48a1f5624b3d794e3a1876fc 100644
--- a/cc/playback/display_item_list.h
+++ b/cc/playback/display_item_list.h
@@ -73,10 +73,24 @@ class CC_EXPORT DisplayItemList
// Because processing happens in these CreateAndAppend functions, all the set
// up for the item should be done via the args, which is why the return type
// needs to be const, to prevent set-after-processing mistakes.
+
+ // Most paired begin item types default to an empty visual rect, which will
+ // subsequently be grown as needed to encompass any contained items that draw
+ // content, such as drawing or filter items.
template <typename DisplayItemType, typename... Args>
const DisplayItemType& CreateAndAppendPairedBeginItem(Args&&... args) {
+ return CreateAndAppendPairedBeginItemWithVisualRect<DisplayItemType>(
+ gfx::Rect(), std::forward<Args>(args)...);
+ }
+
+ // This method variant is exposed to allow filters to specify their visual
+ // rect since they may draw content despite containing no drawing items.
+ template <typename DisplayItemType, typename... Args>
+ const DisplayItemType& CreateAndAppendPairedBeginItemWithVisualRect(
vmpstr 2016/08/11 23:39:37 It seems like we could just have CreateAndAppendPa
wkorman 2016/08/12 00:17:08 Yeah, I thought about that. There are ~41 callsite
+ const gfx::Rect& visual_rect,
+ Args&&... args) {
size_t item_index = inputs_.visual_rects.size();
- inputs_.visual_rects.push_back(gfx::Rect());
+ inputs_.visual_rects.push_back(visual_rect);
inputs_.begin_item_indices.push_back(item_index);
return AllocateAndConstruct<DisplayItemType>(std::forward<Args>(args)...);
« no previous file with comments | « cc/blink/web_display_item_list_impl.cc ('k') | cc/playback/display_item_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698