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

Unified Diff: ui/views/animation/ink_drop_impl.cc

Issue 2431493002: MD Buttons: Don't add layers for hidden -> hidden transitions. (Closed)
Patch Set: Additional test 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 | « no previous file | ui/views/animation/ink_drop_impl_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/animation/ink_drop_impl.cc
diff --git a/ui/views/animation/ink_drop_impl.cc b/ui/views/animation/ink_drop_impl.cc
index 9d65896d2848b73d939d963653480a669c01e7a9..c252d325fb0893d7fdee6f6d11d11caacf0f4670 100644
--- a/ui/views/animation/ink_drop_impl.cc
+++ b/ui/views/animation/ink_drop_impl.cc
@@ -74,6 +74,12 @@ InkDropState InkDropImpl::GetTargetInkDropState() const {
}
void InkDropImpl::AnimateToState(InkDropState ink_drop_state) {
+ // Never animate hidden -> hidden, since that will add layers which may never
+ // be needed. Other same-state transitions may restart animations.
+ if (ink_drop_state == InkDropState::HIDDEN &&
+ GetTargetInkDropState() == InkDropState::HIDDEN)
+ return;
+
DestroyHiddenTargetedAnimations();
if (!ink_drop_ripple_)
CreateInkDropRipple();
« no previous file with comments | « no previous file | ui/views/animation/ink_drop_impl_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698