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