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/layers/layer_impl.h" | 5 #include "cc/layers/layer_impl.h" |
6 | 6 |
7 #include "base/debug/trace_event.h" | 7 #include "base/debug/trace_event.h" |
8 #include "base/strings/stringprintf.h" | 8 #include "base/strings/stringprintf.h" |
9 #include "cc/animation/animation_registrar.h" | 9 #include "cc/animation/animation_registrar.h" |
10 #include "cc/animation/scrollbar_animation_controller.h" | 10 #include "cc/animation/scrollbar_animation_controller.h" |
(...skipping 729 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
740 if (replica_layer_) | 740 if (replica_layer_) |
741 replica_layer_->set_parent(this); | 741 replica_layer_->set_parent(this); |
742 NoteLayerPropertyChangedForSubtree(); | 742 NoteLayerPropertyChangedForSubtree(); |
743 } | 743 } |
744 | 744 |
745 scoped_ptr<LayerImpl> LayerImpl::TakeReplicaLayer() { | 745 scoped_ptr<LayerImpl> LayerImpl::TakeReplicaLayer() { |
746 replica_layer_id_ = -1; | 746 replica_layer_id_ = -1; |
747 return replica_layer_.Pass(); | 747 return replica_layer_.Pass(); |
748 } | 748 } |
749 | 749 |
750 PaintedScrollbarLayerImpl* LayerImpl::ToScrollbarLayer() { | 750 ScrollbarLayerImplBase* LayerImpl::ToScrollbarLayer() { |
751 return NULL; | 751 return NULL; |
752 } | 752 } |
753 | 753 |
754 void LayerImpl::SetDrawsContent(bool draws_content) { | 754 void LayerImpl::SetDrawsContent(bool draws_content) { |
755 if (draws_content_ == draws_content) | 755 if (draws_content_ == draws_content) |
756 return; | 756 return; |
757 | 757 |
758 draws_content_ = draws_content; | 758 draws_content_ = draws_content; |
759 NoteLayerPropertyChanged(); | 759 NoteLayerPropertyChanged(); |
760 } | 760 } |
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1107 scrollbar_animation_controller_ = | 1107 scrollbar_animation_controller_ = |
1108 ScrollbarAnimationControllerLinearFade::Create( | 1108 ScrollbarAnimationControllerLinearFade::Create( |
1109 this, fadeout_delay, fadeout_length) | 1109 this, fadeout_delay, fadeout_length) |
1110 .PassAs<ScrollbarAnimationController>(); | 1110 .PassAs<ScrollbarAnimationController>(); |
1111 } | 1111 } |
1112 } else { | 1112 } else { |
1113 scrollbar_animation_controller_.reset(); | 1113 scrollbar_animation_controller_.reset(); |
1114 } | 1114 } |
1115 } | 1115 } |
1116 void LayerImpl::SetHorizontalScrollbarLayer( | 1116 void LayerImpl::SetHorizontalScrollbarLayer( |
1117 PaintedScrollbarLayerImpl* scrollbar_layer) { | 1117 ScrollbarLayerImplBase* scrollbar_layer) { |
1118 horizontal_scrollbar_layer_ = scrollbar_layer; | 1118 horizontal_scrollbar_layer_ = scrollbar_layer; |
1119 if (horizontal_scrollbar_layer_) | 1119 if (horizontal_scrollbar_layer_) |
1120 horizontal_scrollbar_layer_->set_scroll_layer_id(id()); | 1120 horizontal_scrollbar_layer_->set_scroll_layer_id(id()); |
1121 } | 1121 } |
1122 | 1122 |
1123 void LayerImpl::SetVerticalScrollbarLayer( | 1123 void LayerImpl::SetVerticalScrollbarLayer( |
1124 PaintedScrollbarLayerImpl* scrollbar_layer) { | 1124 ScrollbarLayerImplBase* scrollbar_layer) { |
1125 vertical_scrollbar_layer_ = scrollbar_layer; | 1125 vertical_scrollbar_layer_ = scrollbar_layer; |
1126 if (vertical_scrollbar_layer_) | 1126 if (vertical_scrollbar_layer_) |
1127 vertical_scrollbar_layer_->set_scroll_layer_id(id()); | 1127 vertical_scrollbar_layer_->set_scroll_layer_id(id()); |
1128 } | 1128 } |
1129 | 1129 |
1130 static scoped_ptr<base::Value> | 1130 static scoped_ptr<base::Value> |
1131 CompositingReasonsAsValue(CompositingReasons reasons) { | 1131 CompositingReasonsAsValue(CompositingReasons reasons) { |
1132 scoped_ptr<base::ListValue> reason_list(new base::ListValue()); | 1132 scoped_ptr<base::ListValue> reason_list(new base::ListValue()); |
1133 | 1133 |
1134 if (reasons == kCompositingReasonUnknown) { | 1134 if (reasons == kCompositingReasonUnknown) { |
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1289 | 1289 |
1290 size_t LayerImpl::GPUMemoryUsageInBytes() const { return 0; } | 1290 size_t LayerImpl::GPUMemoryUsageInBytes() const { return 0; } |
1291 | 1291 |
1292 scoped_ptr<base::Value> LayerImpl::AsValue() const { | 1292 scoped_ptr<base::Value> LayerImpl::AsValue() const { |
1293 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); | 1293 scoped_ptr<base::DictionaryValue> state(new base::DictionaryValue()); |
1294 AsValueInto(state.get()); | 1294 AsValueInto(state.get()); |
1295 return state.PassAs<base::Value>(); | 1295 return state.PassAs<base::Value>(); |
1296 } | 1296 } |
1297 | 1297 |
1298 } // namespace cc | 1298 } // namespace cc |
OLD | NEW |