Chromium Code Reviews| 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..12fcb879141ca4802dd8ba273c10c7cb8cad7265 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" |
| @@ -18,17 +19,21 @@ GFX_EXPORT extern const VectorIcon kNoneIcon; |
| // Draws a vector icon identified by |id| onto |canvas| at (0, 0). |color| is |
| // used as the fill. The size will come from the .icon file (the 1x version, if |
| -// multiple versions exist). |
| +// multiple versions exist). |elapsed_time|, when non-null, is used to determine |
| +// the state of any transitions the icon may define. Null is equivalent to zero |
| +// elapsed time. |
| GFX_EXPORT void PaintVectorIcon(Canvas* canvas, |
| const VectorIcon& icon, |
| - SkColor color); |
| + SkColor color, |
| + const base::TimeDelta* elapsed_time = nullptr); |
|
sadrul
2017/05/11 04:22:55
Make these const-refs (TimeDelta() being the defau
Evan Stade
2017/05/11 16:16:26
Done.
|
| // 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 +63,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_ |