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

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

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 #ifndef CC_TREES_LAYER_TREE_HOST_COMMON_H_ 5 #ifndef CC_TREES_LAYER_TREE_HOST_COMMON_H_
6 #define CC_TREES_LAYER_TREE_HOST_COMMON_H_ 6 #define CC_TREES_LAYER_TREE_HOST_COMMON_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <limits> 10 #include <limits>
(...skipping 10 matching lines...) Expand all
21 #include "cc/trees/layer_tree_impl.h" 21 #include "cc/trees/layer_tree_impl.h"
22 #include "cc/trees/property_tree.h" 22 #include "cc/trees/property_tree.h"
23 #include "ui/gfx/geometry/rect.h" 23 #include "ui/gfx/geometry/rect.h"
24 #include "ui/gfx/geometry/vector2d.h" 24 #include "ui/gfx/geometry/vector2d.h"
25 #include "ui/gfx/transform.h" 25 #include "ui/gfx/transform.h"
26 26
27 namespace cc { 27 namespace cc {
28 28
29 namespace proto { 29 namespace proto {
30 class ScrollUpdateInfo; 30 class ScrollUpdateInfo;
31 class ScrollbarsUpdateInfo;
31 class ScrollAndScaleSet; 32 class ScrollAndScaleSet;
32 } 33 }
33 34
34 class LayerImpl; 35 class LayerImpl;
35 class Layer; 36 class Layer;
36 class SwapPromise; 37 class SwapPromise;
37 class PropertyTrees; 38 class PropertyTrees;
38 39
39 class CC_EXPORT LayerTreeHostCommon { 40 class CC_EXPORT LayerTreeHostCommon {
40 public: 41 public:
(...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after
135 static void CallFunctionForEveryLayer(LayerTree* layer, 136 static void CallFunctionForEveryLayer(LayerTree* layer,
136 const Function& function); 137 const Function& function);
137 138
138 template <typename Function> 139 template <typename Function>
139 static void CallFunctionForEveryLayer(LayerTreeImpl* layer, 140 static void CallFunctionForEveryLayer(LayerTreeImpl* layer,
140 const Function& function); 141 const Function& function);
141 142
142 struct CC_EXPORT ScrollUpdateInfo { 143 struct CC_EXPORT ScrollUpdateInfo {
143 int layer_id; 144 int layer_id;
144 // TODO(miletus): Use ScrollOffset once LayerTreeHost/Blink fully supports 145 // TODO(miletus): Use ScrollOffset once LayerTreeHost/Blink fully supports
145 // franctional scroll offset. 146 // fractional scroll offset.
146 gfx::Vector2d scroll_delta; 147 gfx::Vector2d scroll_delta;
147 148
148 ScrollUpdateInfo(); 149 ScrollUpdateInfo();
149 150
150 bool operator==(const ScrollUpdateInfo& other) const; 151 bool operator==(const ScrollUpdateInfo& other) const;
151 152
152 void ToProtobuf(proto::ScrollUpdateInfo* proto) const; 153 void ToProtobuf(proto::ScrollUpdateInfo* proto) const;
153 void FromProtobuf(const proto::ScrollUpdateInfo& proto); 154 void FromProtobuf(const proto::ScrollUpdateInfo& proto);
154 }; 155 };
156
157 struct CC_EXPORT ScrollbarsUpdateInfo {
158 int layer_id;
159 bool hidden;
160
161 ScrollbarsUpdateInfo();
162 ScrollbarsUpdateInfo(int layer_id, bool hidden);
163
164 bool operator==(const ScrollbarsUpdateInfo& other) const;
165
166 void ToProtobuf(proto::ScrollbarsUpdateInfo* proto) const;
167 void FromProtobuf(const proto::ScrollbarsUpdateInfo& proto);
168 };
155 }; 169 };
156 170
157 struct CC_EXPORT ScrollAndScaleSet { 171 struct CC_EXPORT ScrollAndScaleSet {
158 ScrollAndScaleSet(); 172 ScrollAndScaleSet();
159 ~ScrollAndScaleSet(); 173 ~ScrollAndScaleSet();
160 174
161 // The inner viewport scroll delta is kept separate since it's special. 175 // The inner viewport scroll delta is kept separate since it's special.
162 // Because the inner (visual) viewport's maximum offset depends on the 176 // Because the inner (visual) viewport's maximum offset depends on the
163 // current page scale, the two must be committed at the same time to prevent 177 // current page scale, the two must be committed at the same time to prevent
164 // clamping. 178 // clamping.
165 LayerTreeHostCommon::ScrollUpdateInfo inner_viewport_scroll; 179 LayerTreeHostCommon::ScrollUpdateInfo inner_viewport_scroll;
166 180
167 std::vector<LayerTreeHostCommon::ScrollUpdateInfo> scrolls; 181 std::vector<LayerTreeHostCommon::ScrollUpdateInfo> scrolls;
168 float page_scale_delta; 182 float page_scale_delta;
169 gfx::Vector2dF elastic_overscroll_delta; 183 gfx::Vector2dF elastic_overscroll_delta;
170 float top_controls_delta; 184 float top_controls_delta;
185 std::vector<LayerTreeHostCommon::ScrollbarsUpdateInfo> scrollbars;
171 std::vector<std::unique_ptr<SwapPromise>> swap_promises; 186 std::vector<std::unique_ptr<SwapPromise>> swap_promises;
172 187
173 bool EqualsForTesting(const ScrollAndScaleSet& other) const; 188 bool EqualsForTesting(const ScrollAndScaleSet& other) const;
174 void ToProtobuf(proto::ScrollAndScaleSet* proto) const; 189 void ToProtobuf(proto::ScrollAndScaleSet* proto) const;
175 void FromProtobuf(const proto::ScrollAndScaleSet& proto); 190 void FromProtobuf(const proto::ScrollAndScaleSet& proto);
176 191
177 private: 192 private:
178 DISALLOW_COPY_AND_ASSIGN(ScrollAndScaleSet); 193 DISALLOW_COPY_AND_ASSIGN(ScrollAndScaleSet);
179 }; 194 };
180 195
(...skipping 17 matching lines...) Expand all
198 function(tree_impl->LayerById(id)); 213 function(tree_impl->LayerById(id));
199 } 214 }
200 } 215 }
201 216
202 CC_EXPORT PropertyTrees* GetPropertyTrees(Layer* layer); 217 CC_EXPORT PropertyTrees* GetPropertyTrees(Layer* layer);
203 CC_EXPORT PropertyTrees* GetPropertyTrees(LayerImpl* layer); 218 CC_EXPORT PropertyTrees* GetPropertyTrees(LayerImpl* layer);
204 219
205 } // namespace cc 220 } // namespace cc
206 221
207 #endif // CC_TREES_LAYER_TREE_HOST_COMMON_H_ 222 #endif // CC_TREES_LAYER_TREE_HOST_COMMON_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698