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

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

Issue 2499523003: Add ink drop masking to TrayBackgroundView (Closed)
Patch Set: Addressed review comments 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 side-by-side diff with in-line comments
Download patch
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 b61932fe6cd6e020bf778cbd4cf1e198403c9a82..01b392896552051bceda44aa4da4bdf53e19a0f6 100644
--- a/ui/views/animation/ink_drop_impl.cc
+++ b/ui/views/animation/ink_drop_impl.cc
@@ -575,7 +575,7 @@ InkDropImpl::HighlightStateFactory::CreateVisibleState(
return nullptr;
}
-InkDropImpl::InkDropImpl(InkDropHost* ink_drop_host)
+InkDropImpl::InkDropImpl(InkDropHost* ink_drop_host, const gfx::Size& host_size)
: ink_drop_host_(ink_drop_host),
root_layer_(new ui::Layer(ui::LAYER_NOT_DRAWN)),
root_layer_added_to_host_(false),
@@ -585,6 +585,7 @@ InkDropImpl::InkDropImpl(InkDropHost* ink_drop_host)
is_focused_(false),
exiting_highlight_state_(false),
destroying_(false) {
+ root_layer_->SetBounds(gfx::Rect(host_size));
SetAutoHighlightMode(AutoHighlightMode::NONE);
root_layer_->set_name("InkDropImpl:RootLayer");
}
@@ -620,6 +621,13 @@ void InkDropImpl::SetAutoHighlightMode(AutoHighlightMode auto_highlight_mode) {
SetHighlightState(highlight_state_factory_->CreateStartState());
}
+void InkDropImpl::HostSizeChanged(const gfx::Size& new_size) {
+ // |root_layer_| should fill the entire host because it affects the clipping
+ // when a mask layer is applied to it. This will not affect clipping if no
+ // mask layer is set.
+ root_layer_->SetBounds(gfx::Rect(new_size));
+}
+
InkDropState InkDropImpl::GetTargetInkDropState() const {
if (!ink_drop_ripple_)
return InkDropState::HIDDEN;

Powered by Google App Engine
This is Rietveld 408576698