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

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

Issue 2839953005: Round the corners of bookmark button ink drop effects. (Closed)
Patch Set: move macro Created 3 years, 8 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 | « ui/views/animation/ink_drop_host_view.h ('k') | ui/views/animation/ink_drop_mask.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/animation/ink_drop_host_view.cc
diff --git a/ui/views/animation/ink_drop_host_view.cc b/ui/views/animation/ink_drop_host_view.cc
index 789f1b5e76eb05885906fafa8285d549cbc0dc59..9ffa42c843402ede9908f44916f07dff6279140f 100644
--- a/ui/views/animation/ink_drop_host_view.cc
+++ b/ui/views/animation/ink_drop_host_view.cc
@@ -132,9 +132,7 @@ void InkDropHostView::AddInkDropLayer(ui::Layer* ink_drop_layer) {
SetPaintToLayer();
layer()->SetFillsBoundsOpaquely(false);
- ink_drop_mask_ = CreateInkDropMask();
- if (ink_drop_mask_)
- ink_drop_layer->SetMaskLayer(ink_drop_mask_->layer());
+ InstallInkDropMask(ink_drop_layer);
layer()->Add(ink_drop_layer);
layer()->StackAtBottom(ink_drop_layer);
}
@@ -280,6 +278,19 @@ InkDrop* InkDropHostView::GetInkDrop() {
return ink_drop_.get();
}
+void InkDropHostView::InstallInkDropMask(ui::Layer* ink_drop_layer) {
+// Layer masks don't work on Windows. See crbug.com/713359
+#if !defined(OS_WIN)
+ ink_drop_mask_ = CreateInkDropMask();
+ if (ink_drop_mask_)
+ ink_drop_layer->SetMaskLayer(ink_drop_mask_->layer());
+#endif
+}
+
+void InkDropHostView::ResetInkDropMask() {
+ ink_drop_mask_.reset();
+}
+
std::unique_ptr<InkDropImpl> InkDropHostView::CreateDefaultInkDropImpl() {
std::unique_ptr<InkDropImpl> ink_drop =
base::MakeUnique<InkDropImpl>(this, size());
« no previous file with comments | « ui/views/animation/ink_drop_host_view.h ('k') | ui/views/animation/ink_drop_mask.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698