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

Unified Diff: cc/trees/layer_tree_impl.cc

Issue 1945813002: cc: Make LayerTreeImpl dump layer list to FrameViewer and Devtools (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Dump every layer in layout test and rebaseline the expectations Created 4 years, 7 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
Index: cc/trees/layer_tree_impl.cc
diff --git a/cc/trees/layer_tree_impl.cc b/cc/trees/layer_tree_impl.cc
index e8291ae66391837468c1a272b2f67ba66d8bb6b7..574bd72e5f8ebee0a9f2188bfd0e9a0e2bc81790 100644
--- a/cc/trees/layer_tree_impl.cc
+++ b/cc/trees/layer_tree_impl.cc
@@ -440,6 +440,14 @@ LayerListIterator<LayerImpl> LayerTreeImpl::end() {
return LayerListIterator<LayerImpl>(nullptr);
}
+LayerListIterator<LayerImpl> LayerTreeImpl::begin() const {
+ return LayerListIterator<LayerImpl>(root_layer_);
+}
+
+LayerListIterator<LayerImpl> LayerTreeImpl::end() const {
+ return LayerListIterator<LayerImpl>(nullptr);
+}
+
LayerListReverseIterator<LayerImpl> LayerTreeImpl::rbegin() {
return LayerListReverseIterator<LayerImpl>(root_layer_);
}
@@ -1284,10 +1292,6 @@ void LayerTreeImpl::AsValueInto(base::trace_event::TracedValue* state) const {
TracedValue::MakeDictIntoImplicitSnapshot(state, "cc::LayerTreeImpl", this);
state->SetInteger("source_frame_number", source_frame_number_);
- state->BeginDictionary("root_layer");
- root_layer_->AsValueInto(state);
- state->EndDictionary();
-
state->BeginArray("render_surface_layer_list");
LayerIterator end = LayerIterator::End(&render_surface_layer_list_);
for (LayerIterator it = LayerIterator::Begin(&render_surface_layer_list_);
@@ -1307,6 +1311,14 @@ void LayerTreeImpl::AsValueInto(base::trace_event::TracedValue* state) const {
for (const auto& swap_promise : pinned_swap_promise_list_)
state->AppendDouble(swap_promise->TraceId());
state->EndArray();
+
+ state->BeginArray("layers");
+ for (auto* layer : *this) {
+ state->BeginDictionary();
+ layer->AsValueInto(state);
+ state->EndDictionary();
+ }
+ state->EndArray();
}
bool LayerTreeImpl::DistributeRootScrollOffset(

Powered by Google App Engine
This is Rietveld 408576698