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

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

Issue 2639203007: Update SetPaintToLayer to accept LayerType (Closed)
Patch Set: address comments Created 3 years, 11 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.cc ('k') | ui/views/bubble/tray_bubble_view.cc » ('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 f5a7df26a74b78e2ebe6329e9b389e7cf915c5ba..af280baeca84d2d2b8c4823c354a7ec17d1df11c 100644
--- a/ui/views/animation/ink_drop_host_view.cc
+++ b/ui/views/animation/ink_drop_host_view.cc
@@ -130,7 +130,7 @@ InkDropHostView::~InkDropHostView() {
void InkDropHostView::AddInkDropLayer(ui::Layer* ink_drop_layer) {
old_paint_to_layer_ = layer() != nullptr;
- SetPaintToLayer(true);
+ SetPaintToLayer();
layer()->SetFillsBoundsOpaquely(false);
ink_drop_mask_ = CreateInkDropMask();
if (ink_drop_mask_)
@@ -148,7 +148,11 @@ void InkDropHostView::RemoveInkDropLayer(ui::Layer* ink_drop_layer) {
layer()->Remove(ink_drop_layer);
// Layers safely handle destroying a mask layer before the masked layer.
ink_drop_mask_.reset();
- SetPaintToLayer(old_paint_to_layer_);
+ if (old_paint_to_layer_) {
+ SetPaintToLayer();
bruthig 2017/01/23 16:25:02 nit: It's unnecessary to call SetPaintToLayer() he
yiyix 2017/01/23 16:49:48 Thanks, I didn't really read this code. The create
+ } else {
+ DetachLayer();
+ }
}
std::unique_ptr<InkDrop> InkDropHostView::CreateInkDrop() {
« no previous file with comments | « ui/views/animation/ink_drop.cc ('k') | ui/views/bubble/tray_bubble_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698