OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/views/animation/ink_drop.h" | 5 #include "ui/views/animation/ink_drop.h" |
6 | 6 |
7 #include "ui/compositor/layer_type.h" | |
8 | |
7 namespace views { | 9 namespace views { |
8 | 10 |
9 InkDropContainerView::InkDropContainerView() {} | 11 InkDropContainerView::InkDropContainerView() {} |
10 | 12 |
11 void InkDropContainerView::AddInkDropLayer(ui::Layer* ink_drop_layer) { | 13 void InkDropContainerView::AddInkDropLayer(ui::Layer* ink_drop_layer) { |
12 SetPaintToLayer(true); | 14 SetPaintToLayer(ui::LAYER_TEXTURED); |
bruthig
2017/01/20 20:14:18
nit: This may not need to be a textured layer. A
sadrul
2017/01/20 20:32:52
I think for cases like this, we can probably do a
| |
13 SetVisible(true); | 15 SetVisible(true); |
14 layer()->SetFillsBoundsOpaquely(false); | 16 layer()->SetFillsBoundsOpaquely(false); |
15 layer()->Add(ink_drop_layer); | 17 layer()->Add(ink_drop_layer); |
16 } | 18 } |
17 | 19 |
18 void InkDropContainerView::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { | 20 void InkDropContainerView::RemoveInkDropLayer(ui::Layer* ink_drop_layer) { |
19 layer()->Remove(ink_drop_layer); | 21 layer()->Remove(ink_drop_layer); |
20 SetVisible(false); | 22 SetVisible(false); |
21 SetPaintToLayer(false); | 23 SetPaintToLayer(ui::LAYER_NOT_DRAWN); |
22 } | 24 } |
23 | 25 |
24 bool InkDropContainerView::CanProcessEventsWithinSubtree() const { | 26 bool InkDropContainerView::CanProcessEventsWithinSubtree() const { |
25 // Ensure the container View is found as the EventTarget instead of this. | 27 // Ensure the container View is found as the EventTarget instead of this. |
26 return false; | 28 return false; |
27 } | 29 } |
28 | 30 |
29 } // namespace views | 31 } // namespace views |
OLD | NEW |