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

Unified Diff: cc/trees/layer_tree_host_common.h

Issue 2453553003: Disable overlay scrollbars in Blink when hidden by the compositor. (Closed)
Patch Set: Rebase Created 4 years, 2 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « cc/proto/begin_main_frame_and_commit_state.proto ('k') | cc/trees/layer_tree_host_common.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_common.h
diff --git a/cc/trees/layer_tree_host_common.h b/cc/trees/layer_tree_host_common.h
index a3b261baa5887dccd2a58fe552816454eac4d9f5..46eb212fc3868d2c19a281b3a4a0e76dc450bbdf 100644
--- a/cc/trees/layer_tree_host_common.h
+++ b/cc/trees/layer_tree_host_common.h
@@ -28,6 +28,7 @@ namespace cc {
namespace proto {
class ScrollUpdateInfo;
+class ScrollbarsUpdateInfo;
class ScrollAndScaleSet;
}
@@ -142,7 +143,7 @@ class CC_EXPORT LayerTreeHostCommon {
struct CC_EXPORT ScrollUpdateInfo {
int layer_id;
// TODO(miletus): Use ScrollOffset once LayerTreeHost/Blink fully supports
- // franctional scroll offset.
+ // fractional scroll offset.
gfx::Vector2d scroll_delta;
ScrollUpdateInfo();
@@ -152,6 +153,24 @@ class CC_EXPORT LayerTreeHostCommon {
void ToProtobuf(proto::ScrollUpdateInfo* proto) const;
void FromProtobuf(const proto::ScrollUpdateInfo& proto);
};
+
+ // Used to communicate scrollbar visibility from Impl thread to Blink.
+ // Scrollbar input is handled by Blink but the compositor thread animates
+ // opacity on scrollbars to fade them out when they're overlay. Blink needs
+ // to be told when they're faded out so it can stop handling input for
+ // invisible scrollbars.
+ struct CC_EXPORT ScrollbarsUpdateInfo {
+ int layer_id;
+ bool hidden;
+
+ ScrollbarsUpdateInfo();
+ ScrollbarsUpdateInfo(int layer_id, bool hidden);
+
+ bool operator==(const ScrollbarsUpdateInfo& other) const;
+
+ void ToProtobuf(proto::ScrollbarsUpdateInfo* proto) const;
+ void FromProtobuf(const proto::ScrollbarsUpdateInfo& proto);
+ };
};
struct CC_EXPORT ScrollAndScaleSet {
@@ -168,6 +187,7 @@ struct CC_EXPORT ScrollAndScaleSet {
float page_scale_delta;
gfx::Vector2dF elastic_overscroll_delta;
float top_controls_delta;
+ std::vector<LayerTreeHostCommon::ScrollbarsUpdateInfo> scrollbars;
std::vector<std::unique_ptr<SwapPromise>> swap_promises;
bool EqualsForTesting(const ScrollAndScaleSet& other) const;
« no previous file with comments | « cc/proto/begin_main_frame_and_commit_state.proto ('k') | cc/trees/layer_tree_host_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698