| 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 "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
| 8 #include "base/debug/traced_value.h" |
| 8 #include "cc/animation/keyframed_animation_curve.h" | 9 #include "cc/animation/keyframed_animation_curve.h" |
| 9 #include "cc/animation/scrollbar_animation_controller.h" | 10 #include "cc/animation/scrollbar_animation_controller.h" |
| 10 #include "cc/animation/scrollbar_animation_controller_linear_fade.h" | 11 #include "cc/animation/scrollbar_animation_controller_linear_fade.h" |
| 11 #include "cc/animation/scrollbar_animation_controller_thinning.h" | 12 #include "cc/animation/scrollbar_animation_controller_thinning.h" |
| 12 #include "cc/base/math_util.h" | 13 #include "cc/base/math_util.h" |
| 13 #include "cc/base/util.h" | 14 #include "cc/base/util.h" |
| 14 #include "cc/debug/traced_value.h" | |
| 15 #include "cc/layers/heads_up_display_layer_impl.h" | 15 #include "cc/layers/heads_up_display_layer_impl.h" |
| 16 #include "cc/layers/layer.h" | 16 #include "cc/layers/layer.h" |
| 17 #include "cc/layers/layer_iterator.h" | 17 #include "cc/layers/layer_iterator.h" |
| 18 #include "cc/layers/render_surface_impl.h" | 18 #include "cc/layers/render_surface_impl.h" |
| 19 #include "cc/layers/scrollbar_layer_impl_base.h" | 19 #include "cc/layers/scrollbar_layer_impl_base.h" |
| 20 #include "cc/resources/ui_resource_request.h" | 20 #include "cc/resources/ui_resource_request.h" |
| 21 #include "cc/trees/layer_tree_host_common.h" | 21 #include "cc/trees/layer_tree_host_common.h" |
| 22 #include "cc/trees/layer_tree_host_impl.h" | 22 #include "cc/trees/layer_tree_host_impl.h" |
| 23 #include "ui/gfx/size_conversions.h" | 23 #include "ui/gfx/size_conversions.h" |
| 24 #include "ui/gfx/vector2d_conversions.h" | 24 #include "ui/gfx/vector2d_conversions.h" |
| (...skipping 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 747 DebugRectHistory* LayerTreeImpl::debug_rect_history() const { | 747 DebugRectHistory* LayerTreeImpl::debug_rect_history() const { |
| 748 return layer_tree_host_impl_->debug_rect_history(); | 748 return layer_tree_host_impl_->debug_rect_history(); |
| 749 } | 749 } |
| 750 | 750 |
| 751 AnimationRegistrar* LayerTreeImpl::animationRegistrar() const { | 751 AnimationRegistrar* LayerTreeImpl::animationRegistrar() const { |
| 752 return layer_tree_host_impl_->animation_registrar(); | 752 return layer_tree_host_impl_->animation_registrar(); |
| 753 } | 753 } |
| 754 | 754 |
| 755 scoped_ptr<base::Value> LayerTreeImpl::AsValue() const { | 755 scoped_ptr<base::Value> LayerTreeImpl::AsValue() const { |
| 756 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 756 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
| 757 TracedValue::MakeDictIntoImplicitSnapshot( | 757 base::debug::TracedValue::MakeDictIntoImplicitSnapshot( |
| 758 state.get(), "cc::LayerTreeImpl", this); | 758 state.get(), "cc::LayerTreeImpl", this); |
| 759 | 759 |
| 760 state->Set("root_layer", root_layer_->AsValue().release()); | 760 state->Set("root_layer", root_layer_->AsValue().release()); |
| 761 | 761 |
| 762 scoped_ptr<base::ListValue> render_surface_layer_list(new base::ListValue()); | 762 scoped_ptr<base::ListValue> render_surface_layer_list(new base::ListValue()); |
| 763 typedef LayerIterator<LayerImpl> LayerIteratorType; | 763 typedef LayerIterator<LayerImpl> LayerIteratorType; |
| 764 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_); | 764 LayerIteratorType end = LayerIteratorType::End(&render_surface_layer_list_); |
| 765 for (LayerIteratorType it = LayerIteratorType::Begin( | 765 for (LayerIteratorType it = LayerIteratorType::Begin( |
| 766 &render_surface_layer_list_); it != end; ++it) { | 766 &render_surface_layer_list_); it != end; ++it) { |
| 767 if (!it.represents_itself()) | 767 if (!it.represents_itself()) |
| 768 continue; | 768 continue; |
| 769 render_surface_layer_list->Append(TracedValue::CreateIDRef(*it).release()); | 769 render_surface_layer_list->Append( |
| 770 base::debug::TracedValue::CreateIDRef(*it).release()); |
| 770 } | 771 } |
| 771 | 772 |
| 772 state->Set("render_surface_layer_list", | 773 state->Set("render_surface_layer_list", |
| 773 render_surface_layer_list.release()); | 774 render_surface_layer_list.release()); |
| 774 return state.PassAs<base::Value>(); | 775 return state.PassAs<base::Value>(); |
| 775 } | 776 } |
| 776 | 777 |
| 777 void LayerTreeImpl::SetRootLayerScrollOffsetDelegate( | 778 void LayerTreeImpl::SetRootLayerScrollOffsetDelegate( |
| 778 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) { | 779 LayerScrollOffsetDelegate* root_layer_scroll_offset_delegate) { |
| 779 if (root_layer_scroll_offset_delegate_ == root_layer_scroll_offset_delegate) | 780 if (root_layer_scroll_offset_delegate_ == root_layer_scroll_offset_delegate) |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 984 const std::vector<LayerImpl*>& LayerTreeImpl::LayersWithCopyOutputRequest() | 985 const std::vector<LayerImpl*>& LayerTreeImpl::LayersWithCopyOutputRequest() |
| 985 const { | 986 const { |
| 986 // Only the active tree needs to know about layers with copy requests, as | 987 // Only the active tree needs to know about layers with copy requests, as |
| 987 // they are aborted if not serviced during draw. | 988 // they are aborted if not serviced during draw. |
| 988 DCHECK(IsActiveTree()); | 989 DCHECK(IsActiveTree()); |
| 989 | 990 |
| 990 return layers_with_copy_output_request_; | 991 return layers_with_copy_output_request_; |
| 991 } | 992 } |
| 992 | 993 |
| 993 } // namespace cc | 994 } // namespace cc |
| OLD | NEW |