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

Side by Side 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: Force drawsContent for layout test Created 4 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright 2011 The Chromium Authors. All rights reserved. 1 // Copyright 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "cc/trees/layer_tree_impl.h" 5 #include "cc/trees/layer_tree_impl.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <algorithm> 10 #include <algorithm>
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
433 } 433 }
434 434
435 LayerListIterator<LayerImpl> LayerTreeImpl::begin() { 435 LayerListIterator<LayerImpl> LayerTreeImpl::begin() {
436 return LayerListIterator<LayerImpl>(root_layer_); 436 return LayerListIterator<LayerImpl>(root_layer_);
437 } 437 }
438 438
439 LayerListIterator<LayerImpl> LayerTreeImpl::end() { 439 LayerListIterator<LayerImpl> LayerTreeImpl::end() {
440 return LayerListIterator<LayerImpl>(nullptr); 440 return LayerListIterator<LayerImpl>(nullptr);
441 } 441 }
442 442
443 LayerListIterator<LayerImpl> LayerTreeImpl::begin() const {
444 return LayerListIterator<LayerImpl>(root_layer_);
445 }
446
447 LayerListIterator<LayerImpl> LayerTreeImpl::end() const {
448 return LayerListIterator<LayerImpl>(nullptr);
449 }
450
443 LayerListReverseIterator<LayerImpl> LayerTreeImpl::rbegin() { 451 LayerListReverseIterator<LayerImpl> LayerTreeImpl::rbegin() {
444 return LayerListReverseIterator<LayerImpl>(root_layer_); 452 return LayerListReverseIterator<LayerImpl>(root_layer_);
445 } 453 }
446 454
447 LayerListReverseIterator<LayerImpl> LayerTreeImpl::rend() { 455 LayerListReverseIterator<LayerImpl> LayerTreeImpl::rend() {
448 return LayerListReverseIterator<LayerImpl>(nullptr); 456 return LayerListReverseIterator<LayerImpl>(nullptr);
449 } 457 }
450 458
451 void LayerTreeImpl::AddToElementMap(LayerImpl* layer) { 459 void LayerTreeImpl::AddToElementMap(LayerImpl* layer) {
452 if (!layer->element_id() || !layer->mutable_properties()) 460 if (!layer->element_id() || !layer->mutable_properties())
(...skipping 824 matching lines...) Expand 10 before | Expand all | Expand 10 after
1277 continue; 1285 continue;
1278 LayerImpl* layer_impl = *it; 1286 LayerImpl* layer_impl = *it;
1279 layer_impl->GetAllPrioritizedTilesForTracing(prioritized_tiles); 1287 layer_impl->GetAllPrioritizedTilesForTracing(prioritized_tiles);
1280 } 1288 }
1281 } 1289 }
1282 1290
1283 void LayerTreeImpl::AsValueInto(base::trace_event::TracedValue* state) const { 1291 void LayerTreeImpl::AsValueInto(base::trace_event::TracedValue* state) const {
1284 TracedValue::MakeDictIntoImplicitSnapshot(state, "cc::LayerTreeImpl", this); 1292 TracedValue::MakeDictIntoImplicitSnapshot(state, "cc::LayerTreeImpl", this);
1285 state->SetInteger("source_frame_number", source_frame_number_); 1293 state->SetInteger("source_frame_number", source_frame_number_);
1286 1294
1287 state->BeginDictionary("root_layer");
1288 root_layer_->AsValueInto(state);
1289 state->EndDictionary();
1290
1291 state->BeginArray("render_surface_layer_list"); 1295 state->BeginArray("render_surface_layer_list");
1292 LayerIterator end = LayerIterator::End(&render_surface_layer_list_); 1296 LayerIterator end = LayerIterator::End(&render_surface_layer_list_);
1293 for (LayerIterator it = LayerIterator::Begin(&render_surface_layer_list_); 1297 for (LayerIterator it = LayerIterator::Begin(&render_surface_layer_list_);
1294 it != end; ++it) { 1298 it != end; ++it) {
1295 if (!it.represents_itself()) 1299 if (!it.represents_itself())
1296 continue; 1300 continue;
1297 TracedValue::AppendIDRef(*it, state); 1301 TracedValue::AppendIDRef(*it, state);
1298 } 1302 }
1299 state->EndArray(); 1303 state->EndArray();
1300 1304
1301 state->BeginArray("swap_promise_trace_ids"); 1305 state->BeginArray("swap_promise_trace_ids");
1302 for (const auto& swap_promise : swap_promise_list_) 1306 for (const auto& swap_promise : swap_promise_list_)
1303 state->AppendDouble(swap_promise->TraceId()); 1307 state->AppendDouble(swap_promise->TraceId());
1304 state->EndArray(); 1308 state->EndArray();
1305 1309
1306 state->BeginArray("pinned_swap_promise_trace_ids"); 1310 state->BeginArray("pinned_swap_promise_trace_ids");
1307 for (const auto& swap_promise : pinned_swap_promise_list_) 1311 for (const auto& swap_promise : pinned_swap_promise_list_)
1308 state->AppendDouble(swap_promise->TraceId()); 1312 state->AppendDouble(swap_promise->TraceId());
1309 state->EndArray(); 1313 state->EndArray();
1314
1315 state->BeginArray("layers");
1316 for (auto* layer : *this) {
1317 state->BeginDictionary();
1318 layer->AsValueInto(state);
1319 state->EndDictionary();
1320 }
1321 state->EndArray();
1310 } 1322 }
1311 1323
1312 bool LayerTreeImpl::DistributeRootScrollOffset( 1324 bool LayerTreeImpl::DistributeRootScrollOffset(
1313 const gfx::ScrollOffset& root_offset) { 1325 const gfx::ScrollOffset& root_offset) {
1314 if (!InnerViewportScrollLayer()) 1326 if (!InnerViewportScrollLayer())
1315 return false; 1327 return false;
1316 1328
1317 DCHECK(OuterViewportScrollLayer()); 1329 DCHECK(OuterViewportScrollLayer());
1318 1330
1319 // If we get here, we have both inner/outer viewports, and need to distribute 1331 // If we get here, we have both inner/outer viewports, and need to distribute
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
2088 } 2100 }
2089 2101
2090 void LayerTreeImpl::ResetAllChangeTracking() { 2102 void LayerTreeImpl::ResetAllChangeTracking() {
2091 layers_that_should_push_properties_.clear(); 2103 layers_that_should_push_properties_.clear();
2092 for (auto* layer : *this) 2104 for (auto* layer : *this)
2093 layer->ResetChangeTracking(); 2105 layer->ResetChangeTracking();
2094 property_trees_.ResetAllChangeTracking(); 2106 property_trees_.ResetAllChangeTracking();
2095 } 2107 }
2096 2108
2097 } // namespace cc 2109 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698