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

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

Issue 2805813007: Improve toolbar button ink drop ripples at 1.25x (Closed)
Patch Set: relax dcheck 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
Index: ui/views/animation/square_ink_drop_ripple.h
diff --git a/ui/views/animation/square_ink_drop_ripple.h b/ui/views/animation/square_ink_drop_ripple.h
index 99913360c89527fe3b67da833127b0d5ec947065..7ee5baf7bd507b0c332d1b9282254b5c0521beff 100644
--- a/ui/views/animation/square_ink_drop_ripple.h
+++ b/ui/views/animation/square_ink_drop_ripple.h
@@ -131,15 +131,25 @@ class VIEWS_EXPORT SquareInkDropRipple : public InkDropRipple {
// Updates all of the Transforms in |transforms_out| for a circle of the given
// |size|.
- void CalculateCircleTransforms(const gfx::Size& size,
+ void CalculateCircleTransforms(const gfx::Size& desired_size,
InkDropTransforms* transforms_out) const;
// Updates all of the Transforms in |transforms_out| for a rounded rectangle
- // of the given |size| and |corner_radius|.
- void CalculateRectTransforms(const gfx::Size& size,
+ // of the given |desired_size| and |corner_radius|. |desired_size| may be
bruthig 2017/04/12 17:57:39 nit: Consider 'The effective size may differ from
Evan Stade 2017/04/12 23:48:28 I will apply this suggestion
+ // modified slightly at certain scale factors to make sure the ripple is
+ // pixel-aligned.
+ void CalculateRectTransforms(const gfx::Size& desired_size,
float corner_radius,
InkDropTransforms* transforms_out) const;
+ // Calculates a Transform for a circle layer.
+ gfx::Transform CalculateCircleTransform(float scale,
+ float target_center_x,
+ float target_center_y) const;
+
+ // Calculates a Transform for a rectangle layer.
+ gfx::Transform CalculateRectTransform(float x_scale, float y_scale) const;
+
// Updates all of the Transforms in |transforms_out| to the current Transforms
// of the painted shape Layers.
void GetCurrentTransforms(InkDropTransforms* transforms_out) const;
@@ -159,7 +169,7 @@ class VIEWS_EXPORT SquareInkDropRipple : public InkDropRipple {
ActivatedShape activated_shape_;
// Ink drop opacity when it is visible.
- const float visible_opacity_;
+ float visible_opacity_;
// Maximum size that an ink drop will be drawn to for any InkDropState whose
// final frame should be large.
@@ -177,6 +187,9 @@ class VIEWS_EXPORT SquareInkDropRipple : public InkDropRipple {
// InkDropState whose final frame should be small.
const int small_corner_radius_;
+ // The center point of the ripple, relative to the root layer's origin.
+ gfx::Point center_point_;
+
// ui::LayerDelegate to paint circles for all the circle layers.
std::unique_ptr<CircleLayerDelegate> circle_layer_delegate_;
« no previous file with comments | « no previous file | ui/views/animation/square_ink_drop_ripple.cc » ('j') | ui/views/animation/square_ink_drop_ripple.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698