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

Unified Diff: ui/gfx/paint_vector_icon.h

Issue 2870643003: Add support for animations in vector icons. (Closed)
Patch Set: 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 | « no previous file | ui/gfx/paint_vector_icon.cc » ('j') | ui/gfx/paint_vector_icon.cc » ('J')
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 799e43663d163b001ef005597c6e27b6f55eba0b..6c35485a674b8347281924f9ad718c8ae1668d06 100644
--- a/ui/gfx/paint_vector_icon.h
+++ b/ui/gfx/paint_vector_icon.h
@@ -5,6 +5,7 @@
#ifndef UI_GFX_PAINT_VECTOR_ICON_H_
#define UI_GFX_PAINT_VECTOR_ICON_H_
+#include "base/time/time.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/gfx/gfx_export.h"
#include "ui/gfx/image/image_skia.h"
@@ -21,14 +22,16 @@ GFX_EXPORT extern const VectorIcon kNoneIcon;
// multiple versions exist).
GFX_EXPORT void PaintVectorIcon(Canvas* canvas,
const VectorIcon& icon,
- SkColor color);
+ SkColor color,
+ const base::TimeDelta* elapsed_time = nullptr);
// As above, with a specificed size. |dip_size| is the length of a single edge
// of the square icon, in device independent pixels.
GFX_EXPORT void PaintVectorIcon(Canvas* canvas,
const VectorIcon& icon,
int dip_size,
- SkColor color);
+ SkColor color,
+ const base::TimeDelta* elapsed_time = nullptr);
// 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).
@@ -58,6 +61,10 @@ GFX_EXPORT ImageSkia CreateVectorIconFromSource(const std::string& source,
// Calculates the size that will be default for |icon|, in dip.
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);
+
} // namespace gfx
#endif // UI_GFX_PAINT_VECTOR_ICON_H_
« no previous file with comments | « no previous file | ui/gfx/paint_vector_icon.cc » ('j') | ui/gfx/paint_vector_icon.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698