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

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

Issue 2786543002: Make updates to InkDropHighlight to pave the way for improved ink drops (Closed)
Patch Set: improved docs Created 3 years, 9 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/ink_drop_highlight.h
diff --git a/ui/views/animation/ink_drop_highlight.h b/ui/views/animation/ink_drop_highlight.h
index a4088f25dd75341d6054c18bce7c8f348421281f..827d43e18ecd2f25a45aa052f36d6e59580b63a5 100644
--- a/ui/views/animation/ink_drop_highlight.h
+++ b/ui/views/animation/ink_drop_highlight.h
@@ -14,6 +14,7 @@
#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/point_f.h"
#include "ui/gfx/geometry/size.h"
+#include "ui/gfx/geometry/size_f.h"
#include "ui/gfx/transform.h"
#include "ui/views/views_export.h"
@@ -43,17 +44,25 @@ class VIEWS_EXPORT InkDropHighlight {
// Creates a highlight that paints a partially transparent roundrect with
// color |color|.
+ InkDropHighlight(const gfx::SizeF& size,
+ int corner_radius,
+ const gfx::PointF& center_point,
+ SkColor color);
+
+ // Deprecated version of the above that takes a Size instead of SizeF.
+ // TODO(estade): remove. See crbug.com/706228
InkDropHighlight(const gfx::Size& size,
int corner_radius,
const gfx::PointF& center_point,
SkColor color);
+
virtual ~InkDropHighlight();
void set_observer(InkDropHighlightObserver* observer) {
observer_ = observer;
}
- void set_explode_size(const gfx::Size& size) { explode_size_ = size; }
+ void set_explode_size(const gfx::SizeF& size) { explode_size_ = size; }
void set_visible_opacity(float visible_opacity) {
visible_opacity_ = visible_opacity;
@@ -87,11 +96,11 @@ class VIEWS_EXPORT InkDropHighlight {
// |duration|.
void AnimateFade(AnimationType animation_type,
const base::TimeDelta& duration,
- const gfx::Size& initial_size,
- const gfx::Size& target_size);
+ const gfx::SizeF& initial_size,
+ const gfx::SizeF& target_size);
// Calculates the Transform to apply to |layer_| for the given |size|.
- gfx::Transform CalculateTransform(const gfx::Size& size) const;
+ gfx::Transform CalculateTransform(const gfx::SizeF& size) const;
// The callback that will be invoked when a fade in/out animation is started.
void AnimationStartedCallback(
@@ -104,11 +113,11 @@ class VIEWS_EXPORT InkDropHighlight {
const ui::CallbackLayerAnimationObserver& observer);
// The size of the highlight shape when fully faded in.
- gfx::Size size_;
+ gfx::SizeF size_;
// The target size of the highlight shape when it expands during a fade out
// animation.
- gfx::Size explode_size_;
+ gfx::SizeF explode_size_;
// The center point of the highlight shape in the parent Layer's coordinate
// space.

Powered by Google App Engine
This is Rietveld 408576698