Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Side by Side Diff: cc/trees/layer_tree_host_common.cc

Issue 2453553003: Disable overlay scrollbars in Blink when hidden by the compositor. (Closed)
Patch Set: Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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 514 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 735
712 PropertyTrees* GetPropertyTrees(Layer* layer) { 736 PropertyTrees* GetPropertyTrees(Layer* layer) {
713 return layer->GetLayerTree()->property_trees(); 737 return layer->GetLayerTree()->property_trees();
714 } 738 }
715 739
716 PropertyTrees* GetPropertyTrees(LayerImpl* layer) { 740 PropertyTrees* GetPropertyTrees(LayerImpl* layer) {
717 return layer->layer_tree_impl()->property_trees(); 741 return layer->layer_tree_impl()->property_trees();
718 } 742 }
719 743
720 } // namespace cc 744 } // namespace cc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698