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

Unified Diff: cc/input/scrollbar_animation_controller_thinning.cc

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
Index: cc/input/scrollbar_animation_controller_thinning.cc
diff --git a/cc/input/scrollbar_animation_controller_thinning.cc b/cc/input/scrollbar_animation_controller_thinning.cc
index 5100988bc3299dfb3d4ae3bb600f1169d0c3059b..2006d98fddb44a0779c850a7be0c32edb12c5d1c 100644
--- a/cc/input/scrollbar_animation_controller_thinning.cc
+++ b/cc/input/scrollbar_animation_controller_thinning.cc
@@ -164,6 +164,10 @@ void ScrollbarAnimationControllerThinning::DidMouseMoveNear(float distance) {
StartAnimation();
}
+bool ScrollbarAnimationControllerThinning::ScrollbarsHidden() const {
+ return opacity_ == 0.0f;
+}
+
float ScrollbarAnimationControllerThinning::ThumbThicknessScaleAt(
float progress) {
if (thickness_change_ == NONE)
@@ -213,7 +217,13 @@ void ScrollbarAnimationControllerThinning::ApplyOpacity(float opacity) {
}
}
+ bool previouslyVisible = opacity_ > 0.0f;
+ bool currentlyVisible = opacity > 0.0f;
+
opacity_ = opacity;
+
+ if (previouslyVisible != currentlyVisible)
+ client_->DidChangeScrollbarVisibility();
}
void ScrollbarAnimationControllerThinning::ApplyThumbThicknessScale(
« no previous file with comments | « cc/input/scrollbar_animation_controller_thinning.h ('k') | cc/input/scrollbar_animation_controller_thinning_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698