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

Unified Diff: ui/gfx/paint_vector_icon.h

Issue 2892563004: Use animated vector icon for app menu notification animation. (Closed)
Patch Set: one more f Created 3 years, 7 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
« no previous file with comments | « chrome/browser/ui/views/toolbar/app_menu_button.cc ('k') | ui/gfx/paint_vector_icon.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/paint_vector_icon.h
diff --git a/ui/gfx/paint_vector_icon.h b/ui/gfx/paint_vector_icon.h
index 22000438accdd24e950f6b818e9adaf45c715438..b953dce13a2dcbb36b39b14e5431e18d8bf79cfa 100644
--- a/ui/gfx/paint_vector_icon.h
+++ b/ui/gfx/paint_vector_icon.h
@@ -15,6 +15,26 @@ namespace gfx {
class Canvas;
struct VectorIcon;
+// Describes an instance of an icon: an icon definition and a set of drawing
+// parameters.
+struct GFX_EXPORT IconDescription {
+ IconDescription(const IconDescription& other);
+
+ IconDescription(const VectorIcon& icon,
+ int dip_size,
+ SkColor color,
+ const base::TimeDelta& elapsed_time,
+ const VectorIcon& badge_icon);
+
+ ~IconDescription();
+
+ const VectorIcon& icon;
+ int dip_size;
+ SkColor color;
+ const base::TimeDelta elapsed_time;
+ const VectorIcon& badge_icon;
+};
+
GFX_EXPORT extern const VectorIcon kNoneIcon;
// Draws a vector icon identified by |id| onto |canvas| at (0, 0). |color| is
@@ -36,6 +56,11 @@ GFX_EXPORT void PaintVectorIcon(
SkColor color,
const base::TimeDelta& elapsed_time = base::TimeDelta());
+// Creates an ImageSkia which will render the icon on demand.
+// TODO(estade): update clients to use this version and remove the other
+// CreateVectorIcon()s.
+GFX_EXPORT ImageSkia CreateVectorIcon(const IconDescription& params);
+
// Creates an ImageSkia which will render the icon on demand. The size will come
// from the .icon file (the 1x version, if multiple versions exist).
GFX_EXPORT ImageSkia CreateVectorIcon(const VectorIcon& icon, SkColor color);
@@ -66,7 +91,7 @@ GFX_EXPORT int GetDefaultSizeOfVectorIcon(const gfx::VectorIcon& icon);
// Calculates and returns the elapsed time at which all animations/transitions
// will be finished.
-base::TimeDelta GetDurationOfAnimation(const VectorIcon& icon);
+GFX_EXPORT base::TimeDelta GetDurationOfAnimation(const VectorIcon& icon);
} // namespace gfx
« no previous file with comments | « chrome/browser/ui/views/toolbar/app_menu_button.cc ('k') | ui/gfx/paint_vector_icon.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698