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

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

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_mask.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/animation/ink_drop_mask.cc
diff --git a/ui/views/animation/ink_drop_mask.cc b/ui/views/animation/ink_drop_mask.cc
index dda88e27a0387af405388494fd9e67a2e1cefbeb..3e231bcd2f323a55cd828ea9ee32a2696ed1e2ff 100644
--- a/ui/views/animation/ink_drop_mask.cc
+++ b/ui/views/animation/ink_drop_mask.cc
@@ -24,6 +24,10 @@ InkDropMask::~InkDropMask() {
layer_.set_delegate(nullptr);
}
+void InkDropMask::UpdateLayerSize(const gfx::Size& new_layer_size) {
+ layer_.SetBounds(gfx::Rect(new_layer_size));
+}
+
void InkDropMask::OnDelegatedFrameDamage(const gfx::Rect& damage_rect_in_dip) {}
void InkDropMask::OnDeviceScaleFactorChanged(float device_scale_factor) {}
@@ -31,10 +35,10 @@ void InkDropMask::OnDeviceScaleFactorChanged(float device_scale_factor) {}
// RoundRectInkDropMask
RoundRectInkDropMask::RoundRectInkDropMask(const gfx::Size& layer_size,
- const gfx::Rect& mask_bounds,
+ const gfx::Insets& mask_insets,
int corner_radius)
: InkDropMask(layer_size),
- mask_bounds_(mask_bounds),
+ mask_insets_(mask_insets),
corner_radius_(corner_radius) {}
void RoundRectInkDropMask::OnPaintLayer(const ui::PaintContext& context) {
@@ -44,7 +48,9 @@ void RoundRectInkDropMask::OnPaintLayer(const ui::PaintContext& context) {
paint.setAntiAlias(true);
ui::PaintRecorder recorder(context, layer()->size());
- recorder.canvas()->DrawRoundRect(mask_bounds_, corner_radius_, paint);
+ gfx::Rect bounds = layer()->bounds();
+ bounds.Inset(mask_insets_);
+ recorder.canvas()->DrawRoundRect(bounds, corner_radius_, paint);
}
// CircleInkDropMask
« no previous file with comments | « ui/views/animation/ink_drop_mask.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698