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

Unified Diff: cc/playback/display_item_list.cc

Issue 1423653005: Further plumb visual rect into cc:DisplayItemList. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix clip recorder params in omnibox. Created 5 years, 1 month 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_list.h ('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.cc
diff --git a/cc/playback/display_item_list.cc b/cc/playback/display_item_list.cc
index 6dd3778349ebeb20d92c04d9f0cd6e3736ed6a48..e997a2e3e1af655ed47f1a5088ab86f8dd334f0a 100644
--- a/cc/playback/display_item_list.cc
+++ b/cc/playback/display_item_list.cc
@@ -7,6 +7,7 @@
#include <string>
#include "base/numerics/safe_conversions.h"
+#include "base/strings/stringprintf.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/trace_event_argument.h"
#include "cc/base/math_util.h"
@@ -21,6 +22,7 @@
#include "third_party/skia/include/core/SkCanvas.h"
#include "third_party/skia/include/core/SkPictureRecorder.h"
#include "third_party/skia/include/utils/SkPictureUtils.h"
+#include "ui/gfx/geometry/rect.h"
#include "ui/gfx/skia_util.h"
namespace cc {
@@ -59,8 +61,8 @@ scoped_refptr<DisplayItemList> DisplayItemList::CreateFromProto(
for (int i = 0; i < proto.items_size(); i++) {
const proto::DisplayItem& item_proto = proto.items(i);
- DisplayItem* item =
- DisplayItemProtoFactory::AllocateAndConstruct(list.get(), item_proto);
+ DisplayItem* item = DisplayItemProtoFactory::AllocateAndConstruct(
+ layer_rect, list.get(), item_proto);
if (item)
item->FromProtobuf(item_proto);
}
@@ -200,6 +202,15 @@ void DisplayItemList::RemoveLast() {
}
void DisplayItemList::Finalize() {
+ // TODO(wkorman): Uncomment the assert below once we've investigated
+ // and resolved issues. http://crbug.com/557905
+ // DCHECK_EQ(items_.size(), visual_rects_.size());
+
+ // TODO(vmpstr): Build and make use of an RTree from the visual
+ // rects. For now we just clear them out since we won't ever need
+ // them to stick around post-Finalize. http://crbug.com/527245
+ visual_rects_.clear();
+
ProcessAppendedItems();
if (settings_.use_cached_picture) {
@@ -262,8 +273,13 @@ DisplayItemList::AsValue(bool include_items) const {
state->BeginDictionary("params");
if (include_items) {
state->BeginArray("items");
+ size_t item_index = 0;
for (const DisplayItem* item : items_) {
- item->AsValueInto(state.get());
+ item->AsValueInto(visual_rects_.size() >= item_index
+ ? visual_rects_[item_index]
+ : gfx::Rect(),
+ state.get());
+ item_index++;
}
state->EndArray(); // "items".
}
« no previous file with comments | « cc/playback/display_item_list.h ('k') | cc/playback/display_item_list_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698