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

Unified Diff: ui/views/animation/ink_drop_mask.h

Issue 2510603003: Add ink drop ripple to status tray (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
« no previous file with comments | « ui/views/animation/ink_drop_host_view.cc ('k') | ui/views/animation/ink_drop_mask.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/animation/ink_drop_mask.h
diff --git a/ui/views/animation/ink_drop_mask.h b/ui/views/animation/ink_drop_mask.h
index 3146cbaaa51b2d375ff2258a75ed2d0bc655e9b6..347e54f0ffb88a0cdc897dc63a621a50e7089539 100644
--- a/ui/views/animation/ink_drop_mask.h
+++ b/ui/views/animation/ink_drop_mask.h
@@ -8,6 +8,7 @@
#include "base/macros.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_delegate.h"
+#include "ui/gfx/geometry/insets.h"
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/rect.h"
#include "ui/views/views_export.h"
@@ -15,11 +16,17 @@
namespace views {
// Base class for different ink drop masks. It is responsible for creating the
-// ui::Layer that can be set as the mask layer for ink drop layer.
+// ui::Layer that can be set as the mask layer for ink drop layer. Note that the
+// mask's layer size (passed in the constructor) should always match size of the
+// layer it is masking.
class VIEWS_EXPORT InkDropMask : public ui::LayerDelegate {
public:
~InkDropMask() override;
+ // Should be called whenever the masked layer is resized so that the mask
+ // layer size always matches that of the layer it is masking.
+ void UpdateLayerSize(const gfx::Size& new_layer_size);
+
ui::Layer* layer() { return &layer_; }
protected:
@@ -40,14 +47,14 @@ class VIEWS_EXPORT InkDropMask : public ui::LayerDelegate {
class VIEWS_EXPORT RoundRectInkDropMask : public InkDropMask {
public:
RoundRectInkDropMask(const gfx::Size& layer_size,
- const gfx::Rect& mask_bounds,
+ const gfx::Insets& mask_insets,
int corner_radius);
private:
// Overriden from InkDropMask:
void OnPaintLayer(const ui::PaintContext& context) override;
- gfx::Rect mask_bounds_;
+ gfx::Insets mask_insets_;
int corner_radius_;
DISALLOW_COPY_AND_ASSIGN(RoundRectInkDropMask);
« no previous file with comments | « ui/views/animation/ink_drop_host_view.cc ('k') | ui/views/animation/ink_drop_mask.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698