| 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 proto->set_layer_id(layer_id); | 177 proto->set_layer_id(layer_id); |
| 178 Vector2dToProto(scroll_delta, proto->mutable_scroll_delta()); | 178 Vector2dToProto(scroll_delta, proto->mutable_scroll_delta()); |
| 179 } | 179 } |
| 180 | 180 |
| 181 void LayerTreeHostCommon::ScrollUpdateInfo::FromProtobuf( | 181 void LayerTreeHostCommon::ScrollUpdateInfo::FromProtobuf( |
| 182 const proto::ScrollUpdateInfo& proto) { | 182 const proto::ScrollUpdateInfo& proto) { |
| 183 layer_id = proto.layer_id(); | 183 layer_id = proto.layer_id(); |
| 184 scroll_delta = ProtoToVector2d(proto.scroll_delta()); | 184 scroll_delta = ProtoToVector2d(proto.scroll_delta()); |
| 185 } | 185 } |
| 186 | 186 |
| 187 LayerTreeHostCommon::ScrollbarsUpdateInfo::ScrollbarsUpdateInfo() |
| 188 : layer_id(Layer::INVALID_ID), hidden(true) {} |
| 189 |
| 190 LayerTreeHostCommon::ScrollbarsUpdateInfo::ScrollbarsUpdateInfo(int layer_id, |
| 191 bool hidden) |
| 192 : layer_id(layer_id), hidden(hidden) {} |
| 193 |
| 194 bool LayerTreeHostCommon::ScrollbarsUpdateInfo::operator==( |
| 195 const LayerTreeHostCommon::ScrollbarsUpdateInfo& other) const { |
| 196 return layer_id == other.layer_id && hidden == other.hidden; |
| 197 } |
| 198 |
| 199 void LayerTreeHostCommon::ScrollbarsUpdateInfo::ToProtobuf( |
| 200 proto::ScrollbarsUpdateInfo* proto) const { |
| 201 proto->set_layer_id(layer_id); |
| 202 proto->set_hidden(hidden); |
| 203 } |
| 204 |
| 205 void LayerTreeHostCommon::ScrollbarsUpdateInfo::FromProtobuf( |
| 206 const proto::ScrollbarsUpdateInfo& proto) { |
| 207 layer_id = proto.layer_id(); |
| 208 hidden = proto.hidden(); |
| 209 } |
| 210 |
| 187 ScrollAndScaleSet::ScrollAndScaleSet() | 211 ScrollAndScaleSet::ScrollAndScaleSet() |
| 188 : page_scale_delta(1.f), top_controls_delta(0.f) { | 212 : page_scale_delta(1.f), top_controls_delta(0.f) { |
| 189 } | 213 } |
| 190 | 214 |
| 191 ScrollAndScaleSet::~ScrollAndScaleSet() {} | 215 ScrollAndScaleSet::~ScrollAndScaleSet() {} |
| 192 | 216 |
| 193 bool ScrollAndScaleSet::EqualsForTesting(const ScrollAndScaleSet& other) const { | 217 bool ScrollAndScaleSet::EqualsForTesting(const ScrollAndScaleSet& other) const { |
| 194 return scrolls == other.scrolls && | 218 return scrolls == other.scrolls && |
| 195 page_scale_delta == other.page_scale_delta && | 219 page_scale_delta == other.page_scale_delta && |
| 196 elastic_overscroll_delta == other.elastic_overscroll_delta && | 220 elastic_overscroll_delta == other.elastic_overscroll_delta && |
| (...skipping 509 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 706 | 730 |
| 707 PropertyTrees* GetPropertyTrees(Layer* layer) { | 731 PropertyTrees* GetPropertyTrees(Layer* layer) { |
| 708 return layer->GetLayerTree()->property_trees(); | 732 return layer->GetLayerTree()->property_trees(); |
| 709 } | 733 } |
| 710 | 734 |
| 711 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { | 735 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { |
| 712 return layer->layer_tree_impl()->property_trees(); | 736 return layer->layer_tree_impl()->property_trees(); |
| 713 } | 737 } |
| 714 | 738 |
| 715 } // namespace cc | 739 } // namespace cc |
| OLD | NEW |