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

Unified Diff: cc/input/scrollbar_animation_controller.cc

Issue 2866733002: Remove owning_id from EffectNode and replace it by an opaque stable_id (Closed)
Patch Set: none Created 3 years, 7 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/input/scrollbar_animation_controller.h ('k') | cc/input/scrollbar_animation_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/input/scrollbar_animation_controller.cc
diff --git a/cc/input/scrollbar_animation_controller.cc b/cc/input/scrollbar_animation_controller.cc
index 14dfe30a5ef5312c4bc693260022cea074e493c5..1f066dbc610944779ae68a55a25427e0b404448c 100644
--- a/cc/input/scrollbar_animation_controller.cc
+++ b/cc/input/scrollbar_animation_controller.cc
@@ -164,6 +164,7 @@ void ScrollbarAnimationController::RunAnimationFrame(float progress) {
opacity = std::min(1.f - progress, opacity_);
}
+ NotifyScrollbarLayersOfOpacityAnimation(opacity);
ApplyOpacityToScrollbars(opacity);
if (progress == 1.f)
StopAnimation();
@@ -330,16 +331,20 @@ bool ScrollbarAnimationController::Captured() const {
void ScrollbarAnimationController::Show() {
delayed_scrollbar_animation_.Cancel();
+ NotifyScrollbarLayersOfOpacityAnimation(1.0f);
ApplyOpacityToScrollbars(1.0f);
}
-void ScrollbarAnimationController::ApplyOpacityToScrollbars(float opacity) {
+void ScrollbarAnimationController::NotifyScrollbarLayersOfOpacityAnimation(
+ float opacity) {
for (ScrollbarLayerImplBase* scrollbar : Scrollbars()) {
DCHECK(scrollbar->is_overlay_scrollbar());
float effective_opacity = scrollbar->CanScrollOrientation() ? opacity : 0;
scrollbar->SetOverlayScrollbarLayerOpacityAnimated(effective_opacity);
}
+}
+void ScrollbarAnimationController::ApplyOpacityToScrollbars(float opacity) {
bool previouslyVisible = opacity_ > 0.0f;
bool currentlyVisible = opacity > 0.0f;
« no previous file with comments | « cc/input/scrollbar_animation_controller.h ('k') | cc/input/scrollbar_animation_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698