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