| 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 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 165 device_viewport_size, | 165 device_viewport_size, |
| 166 gfx::Transform(), | 166 gfx::Transform(), |
| 167 device_scale_factor, | 167 device_scale_factor, |
| 168 render_surface_layer_list) {} | 168 render_surface_layer_list) {} |
| 169 | 169 |
| 170 LayerTreeHostCommon::ScrollUpdateInfo::ScrollUpdateInfo() | 170 LayerTreeHostCommon::ScrollUpdateInfo::ScrollUpdateInfo() |
| 171 : layer_id(Layer::INVALID_ID) {} | 171 : layer_id(Layer::INVALID_ID) {} |
| 172 | 172 |
| 173 bool LayerTreeHostCommon::ScrollUpdateInfo::operator==( | 173 bool LayerTreeHostCommon::ScrollUpdateInfo::operator==( |
| 174 const LayerTreeHostCommon::ScrollUpdateInfo& other) const { | 174 const LayerTreeHostCommon::ScrollUpdateInfo& other) const { |
| 175 return layer_id == other.layer_id && scroll_delta == other.scroll_delta; | 175 return layer_id == other.layer_id && scroll_delta == other.scroll_delta && |
| 176 overscroll == other.overscroll; |
| 176 } | 177 } |
| 177 | 178 |
| 178 void LayerTreeHostCommon::ScrollUpdateInfo::ToProtobuf( | 179 void LayerTreeHostCommon::ScrollUpdateInfo::ToProtobuf( |
| 179 proto::ScrollUpdateInfo* proto) const { | 180 proto::ScrollUpdateInfo* proto) const { |
| 180 proto->set_layer_id(layer_id); | 181 proto->set_layer_id(layer_id); |
| 181 Vector2dToProto(scroll_delta, proto->mutable_scroll_delta()); | 182 Vector2dToProto(scroll_delta, proto->mutable_scroll_delta()); |
| 183 ScrollOffsetToProto(overscroll, proto->mutable_overscroll()); |
| 182 } | 184 } |
| 183 | 185 |
| 184 void LayerTreeHostCommon::ScrollUpdateInfo::FromProtobuf( | 186 void LayerTreeHostCommon::ScrollUpdateInfo::FromProtobuf( |
| 185 const proto::ScrollUpdateInfo& proto) { | 187 const proto::ScrollUpdateInfo& proto) { |
| 186 layer_id = proto.layer_id(); | 188 layer_id = proto.layer_id(); |
| 187 scroll_delta = ProtoToVector2d(proto.scroll_delta()); | 189 scroll_delta = ProtoToVector2d(proto.scroll_delta()); |
| 190 overscroll = ProtoToScrollOffset(proto.overscroll()); |
| 188 } | 191 } |
| 189 | 192 |
| 190 ScrollAndScaleSet::ScrollAndScaleSet() | 193 ScrollAndScaleSet::ScrollAndScaleSet() |
| 191 : page_scale_delta(1.f), top_controls_delta(0.f) { | 194 : page_scale_delta(1.f), top_controls_delta(0.f) { |
| 192 } | 195 } |
| 193 | 196 |
| 194 ScrollAndScaleSet::~ScrollAndScaleSet() {} | 197 ScrollAndScaleSet::~ScrollAndScaleSet() {} |
| 195 | 198 |
| 196 bool ScrollAndScaleSet::EqualsForTesting(const ScrollAndScaleSet& other) const { | 199 bool ScrollAndScaleSet::EqualsForTesting(const ScrollAndScaleSet& other) const { |
| 197 return scrolls == other.scrolls && | 200 return scrolls == other.scrolls && |
| (...skipping 515 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 713 | 716 |
| 714 PropertyTrees* GetPropertyTrees(Layer* layer) { | 717 PropertyTrees* GetPropertyTrees(Layer* layer) { |
| 715 return layer->GetLayerTree()->property_trees(); | 718 return layer->GetLayerTree()->property_trees(); |
| 716 } | 719 } |
| 717 | 720 |
| 718 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { | 721 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { |
| 719 return layer->layer_tree_impl()->property_trees(); | 722 return layer->layer_tree_impl()->property_trees(); |
| 720 } | 723 } |
| 721 | 724 |
| 722 } // namespace cc | 725 } // namespace cc |
| OLD | NEW |