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 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
805 } | 806 } |
806 | 807 |
807 DebugRectHistory* LayerTreeImpl::debug_rect_history() const { | 808 DebugRectHistory* LayerTreeImpl::debug_rect_history() const { |
808 return layer_tree_host_impl_->debug_rect_history(); | 809 return layer_tree_host_impl_->debug_rect_history(); |
809 } | 810 } |
810 | 811 |
811 AnimationRegistrar* LayerTreeImpl::animationRegistrar() const { | 812 AnimationRegistrar* LayerTreeImpl::animationRegistrar() const { |
812 return layer_tree_host_impl_->animation_registrar(); | 813 return layer_tree_host_impl_->animation_registrar(); |
813 } | 814 } |
814 | 815 |
815 scoped_ptr<base::Value> LayerTreeImpl::AsValue() const { | 816 void LayerTreeImpl::AsValueInto(base::debug::TracedValue* state) const { |
816 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 817 TracedValue::MakeDictIntoImplicitSnapshot(state, "cc::LayerTreeImpl", this); |
817 TracedValue::MakeDictIntoImplicitSnapshot( | |
818 state.get(), "cc::LayerTreeImpl", this); | |
819 | 818 |
820 state->Set("root_layer", root_layer_->AsValue().release()); | 819 state->BeginDictionary("root_layer"); |
| 820 root_layer_->AsValueInto(state); |
| 821 state->EndDictionary(); |
821 | 822 |
822 scoped_ptr<base::ListValue> render_surface_layer_list(new base::ListValue()); | 823 state->BeginArray("render_surface_layer_list"); |
823 typedef LayerIterator<LayerImpl> LayerIteratorType; | 824 typedef LayerIterator<LayerImpl> LayerIteratorType; |
824 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_); | 825 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_); |
825 for (LayerIteratorType it = LayerIteratorType::Begin( | 826 for (LayerIteratorType it = LayerIteratorType::Begin( |
826 &render_surface_layer_list_); it != end; ++it) { | 827 &render_surface_layer_list_); it != end; ++it) { |
827 if (!it.represents_itself()) | 828 if (!it.represents_itself()) |
828 continue; | 829 continue; |
829 render_surface_layer_list->Append(TracedValue::CreateIDRef(*it).release()); | 830 TracedValue::AppendIDRef(*it, state); |
830 } | 831 } |
831 | 832 state->EndArray(); |
832 state->Set("render_surface_layer_list", | |
833 render_surface_layer_list.release()); | |
834 return state.PassAs<base::Value>(); | |
835 } | 833 } |
836 | 834 |
837 void LayerTreeImpl::SetRootLayerScrollOffsetDelegate( | 835 void LayerTreeImpl::SetRootLayerScrollOffsetDelegate( |
838 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) { | 836 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) { |
839 if (root_layer_scroll_offset_delegate_ == root_layer_scroll_offset_delegate) | 837 if (root_layer_scroll_offset_delegate_ == root_layer_scroll_offset_delegate) |
840 return; | 838 return; |
841 | 839 |
842 if (!root_layer_scroll_offset_delegate) { | 840 if (!root_layer_scroll_offset_delegate) { |
843 // Make sure we remove the proxies from their layers before | 841 // Make sure we remove the proxies from their layers before |
844 // releasing them. | 842 // releasing them. |
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1385 | 1383 |
1386 void LayerTreeImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { | 1384 void LayerTreeImpl::UnregisterPictureLayerImpl(PictureLayerImpl* layer) { |
1387 layer_tree_host_impl_->UnregisterPictureLayerImpl(layer); | 1385 layer_tree_host_impl_->UnregisterPictureLayerImpl(layer); |
1388 } | 1386 } |
1389 | 1387 |
1390 void LayerTreeImpl::InputScrollAnimationFinished() { | 1388 void LayerTreeImpl::InputScrollAnimationFinished() { |
1391 layer_tree_host_impl_->ScrollEnd(); | 1389 layer_tree_host_impl_->ScrollEnd(); |
1392 } | 1390 } |
1393 | 1391 |
1394 } // namespace cc | 1392 } // namespace cc |
OLD | NEW |