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 <limits> | 7 #include <limits> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
| 11 #include "base/debug/trace_event_argument.h" |
11 #include "cc/animation/keyframed_animation_curve.h" | 12 #include "cc/animation/keyframed_animation_curve.h" |
12 #include "cc/animation/scrollbar_animation_controller.h" | 13 #include "cc/animation/scrollbar_animation_controller.h" |
13 #include "cc/animation/scrollbar_animation_controller_linear_fade.h" | 14 #include "cc/animation/scrollbar_animation_controller_linear_fade.h" |
14 #include "cc/animation/scrollbar_animation_controller_thinning.h" | 15 #include "cc/animation/scrollbar_animation_controller_thinning.h" |
15 #include "cc/base/math_util.h" | 16 #include "cc/base/math_util.h" |
16 #include "cc/base/util.h" | 17 #include "cc/base/util.h" |
17 #include "cc/debug/devtools_instrumentation.h" | 18 #include "cc/debug/devtools_instrumentation.h" |
18 #include "cc/debug/traced_value.h" | 19 #include "cc/debug/traced_value.h" |
19 #include "cc/layers/heads_up_display_layer_impl.h" | 20 #include "cc/layers/heads_up_display_layer_impl.h" |
20 #include "cc/layers/layer.h" | 21 #include "cc/layers/layer.h" |
(...skipping 792 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
813 } | 814 } |
814 | 815 |
815 DebugRectHistory* LayerTreeImpl::debug_rect_history() const { | 816 DebugRectHistory* LayerTreeImpl::debug_rect_history() const { |
816 return layer_tree_host_impl_->debug_rect_history(); | 817 return layer_tree_host_impl_->debug_rect_history(); |
817 } | 818 } |
818 | 819 |
819 AnimationRegistrar* LayerTreeImpl::animationRegistrar() const { | 820 AnimationRegistrar* LayerTreeImpl::animationRegistrar() const { |
820 return layer_tree_host_impl_->animation_registrar(); | 821 return layer_tree_host_impl_->animation_registrar(); |
821 } | 822 } |
822 | 823 |
823 scoped_ptr<base::Value> LayerTreeImpl::AsValue() const { | 824 void LayerTreeImpl::AsValueInto(base::debug::TracedValue* state) const { |
824 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 825 TracedValue::MakeDictIntoImplicitSnapshot(state, "cc::LayerTreeImpl", this); |
825 TracedValue::MakeDictIntoImplicitSnapshot( | |
826 state.get(), "cc::LayerTreeImpl", this); | |
827 | 826 |
828 state->Set("root_layer", root_layer_->AsValue().release()); | 827 state->BeginDictionary("root_layer"); |
| 828 root_layer_->AsValueInto(state); |
| 829 state->EndDictionary(); |
829 | 830 |
830 scoped_ptr<base::ListValue> render_surface_layer_list(new base::ListValue()); | 831 state->BeginArray("render_surface_layer_list"); |
831 typedef LayerIterator<LayerImpl> LayerIteratorType; | 832 typedef LayerIterator<LayerImpl> LayerIteratorType; |
832 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_); | 833 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_); |
833 for (LayerIteratorType it = LayerIteratorType::Begin( | 834 for (LayerIteratorType it = LayerIteratorType::Begin( |
834 &render_surface_layer_list_); it != end; ++it) { | 835 &render_surface_layer_list_); it != end; ++it) { |
835 if (!it.represents_itself()) | 836 if (!it.represents_itself()) |
836 continue; | 837 continue; |
837 render_surface_layer_list->Append(TracedValue::CreateIDRef(*it).release()); | 838 TracedValue::AppendIDRef(*it, state); |
838 } | 839 } |
839 | 840 state->EndArray(); |
840 state->Set("render_surface_layer_list", | |
841 render_surface_layer_list.release()); | |
842 return state.PassAs<base::Value>(); | |
843 } | 841 } |
844 | 842 |
845 void LayerTreeImpl::SetRootLayerScrollOffsetDelegate( | 843 void LayerTreeImpl::SetRootLayerScrollOffsetDelegate( |
846 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) { | 844 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) { |
847 if (root_layer_scroll_offset_delegate_ == root_layer_scroll_offset_delegate) | 845 if (root_layer_scroll_offset_delegate_ == root_layer_scroll_offset_delegate) |
848 return; | 846 return; |
849 | 847 |
850 if (!root_layer_scroll_offset_delegate) { | 848 if (!root_layer_scroll_offset_delegate) { |
851 // Make sure we remove the proxies from their layers before | 849 // Make sure we remove the proxies from their layers before |
852 // releasing them. | 850 // releasing them. |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1393 | 1391 |
1394 void LayerTreeImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 1392 void LayerTreeImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
1395 layer_tree_host_impl_->UnregisterPictureLayerImpl(layer); | 1393 layer_tree_host_impl_->UnregisterPictureLayerImpl(layer); |
1396 } | 1394 } |
1397 | 1395 |
1398 void LayerTreeImpl::InputScrollAnimationFinished() { | 1396 void LayerTreeImpl::InputScrollAnimationFinished() { |
1399 layer_tree_host_impl_->ScrollEnd(); | 1397 layer_tree_host_impl_->ScrollEnd(); |
1400 } | 1398 } |
1401 | 1399 |
1402 } // namespace cc | 1400 } // namespace cc |
OLD | NEW |