OLD | NEW |
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 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 void LayerTreeImpl::MoveChangeTrackingToLayers() { | 425 void LayerTreeImpl::MoveChangeTrackingToLayers() { |
426 // We need to update the change tracking on property trees before we move it | 426 // We need to update the change tracking on property trees before we move it |
427 // onto the layers. | 427 // onto the layers. |
428 property_trees_.UpdateChangeTracking(); | 428 property_trees_.UpdateChangeTracking(); |
429 for (auto* layer : *this) { | 429 for (auto* layer : *this) { |
430 if (layer->LayerPropertyChanged()) | 430 if (layer->LayerPropertyChanged()) |
431 layer->NoteLayerPropertyChanged(); | 431 layer->NoteLayerPropertyChanged(); |
432 } | 432 } |
433 } | 433 } |
434 | 434 |
435 LayerListIterator<LayerImpl> LayerTreeImpl::begin() { | 435 LayerListIterator<LayerImpl> LayerTreeImpl::begin() const { |
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() const { |
440 return LayerListIterator<LayerImpl>(nullptr); | 440 return LayerListIterator<LayerImpl>(nullptr); |
441 } | 441 } |
442 | 442 |
443 LayerListReverseIterator<LayerImpl> LayerTreeImpl::rbegin() { | 443 LayerListReverseIterator<LayerImpl> LayerTreeImpl::rbegin() { |
444 return LayerListReverseIterator<LayerImpl>(root_layer_); | 444 return LayerListReverseIterator<LayerImpl>(root_layer_); |
445 } | 445 } |
446 | 446 |
447 LayerListReverseIterator<LayerImpl> LayerTreeImpl::rend() { | 447 LayerListReverseIterator<LayerImpl> LayerTreeImpl::rend() { |
448 return LayerListReverseIterator<LayerImpl>(nullptr); | 448 return LayerListReverseIterator<LayerImpl>(nullptr); |
449 } | 449 } |
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1277 continue; | 1277 continue; |
1278 LayerImpl* layer_impl = *it; | 1278 LayerImpl* layer_impl = *it; |
1279 layer_impl->GetAllPrioritizedTilesForTracing(prioritized_tiles); | 1279 layer_impl->GetAllPrioritizedTilesForTracing(prioritized_tiles); |
1280 } | 1280 } |
1281 } | 1281 } |
1282 | 1282 |
1283 void LayerTreeImpl::AsValueInto(base::trace_event::TracedValue* state) const { | 1283 void LayerTreeImpl::AsValueInto(base::trace_event::TracedValue* state) const { |
1284 TracedValue::MakeDictIntoImplicitSnapshot(state, "cc::LayerTreeImpl", this); | 1284 TracedValue::MakeDictIntoImplicitSnapshot(state, "cc::LayerTreeImpl", this); |
1285 state->SetInteger("source_frame_number", source_frame_number_); | 1285 state->SetInteger("source_frame_number", source_frame_number_); |
1286 | 1286 |
1287 state->BeginDictionary("root_layer"); | |
1288 root_layer_->AsValueInto(state); | |
1289 state->EndDictionary(); | |
1290 | |
1291 state->BeginArray("render_surface_layer_list"); | 1287 state->BeginArray("render_surface_layer_list"); |
1292 LayerIterator end = LayerIterator::End(&render_surface_layer_list_); | 1288 LayerIterator end = LayerIterator::End(&render_surface_layer_list_); |
1293 for (LayerIterator it = LayerIterator::Begin(&render_surface_layer_list_); | 1289 for (LayerIterator it = LayerIterator::Begin(&render_surface_layer_list_); |
1294 it != end; ++it) { | 1290 it != end; ++it) { |
1295 if (!it.represents_itself()) | 1291 if (!it.represents_itself()) |
1296 continue; | 1292 continue; |
1297 TracedValue::AppendIDRef(*it, state); | 1293 TracedValue::AppendIDRef(*it, state); |
1298 } | 1294 } |
1299 state->EndArray(); | 1295 state->EndArray(); |
1300 | 1296 |
1301 state->BeginArray("swap_promise_trace_ids"); | 1297 state->BeginArray("swap_promise_trace_ids"); |
1302 for (const auto& swap_promise : swap_promise_list_) | 1298 for (const auto& swap_promise : swap_promise_list_) |
1303 state->AppendDouble(swap_promise->TraceId()); | 1299 state->AppendDouble(swap_promise->TraceId()); |
1304 state->EndArray(); | 1300 state->EndArray(); |
1305 | 1301 |
1306 state->BeginArray("pinned_swap_promise_trace_ids"); | 1302 state->BeginArray("pinned_swap_promise_trace_ids"); |
1307 for (const auto& swap_promise : pinned_swap_promise_list_) | 1303 for (const auto& swap_promise : pinned_swap_promise_list_) |
1308 state->AppendDouble(swap_promise->TraceId()); | 1304 state->AppendDouble(swap_promise->TraceId()); |
1309 state->EndArray(); | 1305 state->EndArray(); |
| 1306 |
| 1307 state->BeginArray("layers"); |
| 1308 for (auto* layer : *this) { |
| 1309 state->BeginDictionary(); |
| 1310 layer->AsValueInto(state); |
| 1311 state->EndDictionary(); |
| 1312 } |
| 1313 state->EndArray(); |
1310 } | 1314 } |
1311 | 1315 |
1312 bool LayerTreeImpl::DistributeRootScrollOffset( | 1316 bool LayerTreeImpl::DistributeRootScrollOffset( |
1313 const gfx::ScrollOffset& root_offset) { | 1317 const gfx::ScrollOffset& root_offset) { |
1314 if (!InnerViewportScrollLayer()) | 1318 if (!InnerViewportScrollLayer()) |
1315 return false; | 1319 return false; |
1316 | 1320 |
1317 DCHECK(OuterViewportScrollLayer()); | 1321 DCHECK(OuterViewportScrollLayer()); |
1318 | 1322 |
1319 // If we get here, we have both inner/outer viewports, and need to distribute | 1323 // 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 Loading... |
2088 } | 2092 } |
2089 | 2093 |
2090 void LayerTreeImpl::ResetAllChangeTracking() { | 2094 void LayerTreeImpl::ResetAllChangeTracking() { |
2091 layers_that_should_push_properties_.clear(); | 2095 layers_that_should_push_properties_.clear(); |
2092 for (auto* layer : *this) | 2096 for (auto* layer : *this) |
2093 layer->ResetChangeTracking(); | 2097 layer->ResetChangeTracking(); |
2094 property_trees_.ResetAllChangeTracking(); | 2098 property_trees_.ResetAllChangeTracking(); |
2095 } | 2099 } |
2096 | 2100 |
2097 } // namespace cc | 2101 } // namespace cc |
OLD | NEW |