| 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_host_common.h" | 5 #include "cc/trees/layer_tree_host_common.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 : CalcDrawPropsImplInputsForTesting(root_layer, | 138 : CalcDrawPropsImplInputsForTesting(root_layer, |
| 139 device_viewport_size, | 139 device_viewport_size, |
| 140 gfx::Transform(), | 140 gfx::Transform(), |
| 141 render_surface_layer_list) {} | 141 render_surface_layer_list) {} |
| 142 | 142 |
| 143 LayerTreeHostCommon::ScrollUpdateInfo::ScrollUpdateInfo() | 143 LayerTreeHostCommon::ScrollUpdateInfo::ScrollUpdateInfo() |
| 144 : layer_id(Layer::INVALID_ID) {} | 144 : layer_id(Layer::INVALID_ID) {} |
| 145 | 145 |
| 146 bool LayerTreeHostCommon::ScrollUpdateInfo::operator==( | 146 bool LayerTreeHostCommon::ScrollUpdateInfo::operator==( |
| 147 const LayerTreeHostCommon::ScrollUpdateInfo& other) const { | 147 const LayerTreeHostCommon::ScrollUpdateInfo& other) const { |
| 148 return layer_id == other.layer_id && scroll_delta == other.scroll_delta; | 148 return layer_id == other.layer_id && scroll_delta == other.scroll_delta && |
| 149 overscroll == other.overscroll; |
| 149 } | 150 } |
| 150 | 151 |
| 151 void LayerTreeHostCommon::ScrollUpdateInfo::ToProtobuf( | 152 void LayerTreeHostCommon::ScrollUpdateInfo::ToProtobuf( |
| 152 proto::ScrollUpdateInfo* proto) const { | 153 proto::ScrollUpdateInfo* proto) const { |
| 153 proto->set_layer_id(layer_id); | 154 proto->set_layer_id(layer_id); |
| 154 Vector2dToProto(scroll_delta, proto->mutable_scroll_delta()); | 155 Vector2dToProto(scroll_delta, proto->mutable_scroll_delta()); |
| 156 ScrollOffsetToProto(overscroll, proto->mutable_overscroll()); |
| 155 } | 157 } |
| 156 | 158 |
| 157 void LayerTreeHostCommon::ScrollUpdateInfo::FromProtobuf( | 159 void LayerTreeHostCommon::ScrollUpdateInfo::FromProtobuf( |
| 158 const proto::ScrollUpdateInfo& proto) { | 160 const proto::ScrollUpdateInfo& proto) { |
| 159 layer_id = proto.layer_id(); | 161 layer_id = proto.layer_id(); |
| 160 scroll_delta = ProtoToVector2d(proto.scroll_delta()); | 162 scroll_delta = ProtoToVector2d(proto.scroll_delta()); |
| 163 overscroll = ProtoToScrollOffset(proto.overscroll()); |
| 161 } | 164 } |
| 162 | 165 |
| 163 ScrollAndScaleSet::ScrollAndScaleSet() | 166 ScrollAndScaleSet::ScrollAndScaleSet() |
| 164 : page_scale_delta(1.f), top_controls_delta(0.f) { | 167 : page_scale_delta(1.f), top_controls_delta(0.f) { |
| 165 } | 168 } |
| 166 | 169 |
| 167 ScrollAndScaleSet::~ScrollAndScaleSet() {} | 170 ScrollAndScaleSet::~ScrollAndScaleSet() {} |
| 168 | 171 |
| 169 bool ScrollAndScaleSet::EqualsForTesting(const ScrollAndScaleSet& other) const { | 172 bool ScrollAndScaleSet::EqualsForTesting(const ScrollAndScaleSet& other) const { |
| 170 return scrolls == other.scrolls && | 173 return scrolls == other.scrolls && |
| (...skipping 521 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 692 | 695 |
| 693 PropertyTrees* GetPropertyTrees(Layer* layer) { | 696 PropertyTrees* GetPropertyTrees(Layer* layer) { |
| 694 return layer->layer_tree_host()->property_trees(); | 697 return layer->layer_tree_host()->property_trees(); |
| 695 } | 698 } |
| 696 | 699 |
| 697 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { | 700 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { |
| 698 return layer->layer_tree_impl()->property_trees(); | 701 return layer->layer_tree_impl()->property_trees(); |
| 699 } | 702 } |
| 700 | 703 |
| 701 } // namespace cc | 704 } // namespace cc |
| OLD | NEW |