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 22000438accdd24e950f6b818e9adaf45c715438..76dc444ce60cb1a84f541a87b6052338cf60a6cf 100644 |
| --- a/ui/gfx/paint_vector_icon.h |
| +++ b/ui/gfx/paint_vector_icon.h |
| @@ -15,6 +15,28 @@ 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(); |
| + |
| + bool operator<(const IconDescription& other) const; |
|
sadrul
2017/05/23 18:01:14
I don't think < operator makes sense for IconDescr
Evan Stade
2017/05/23 23:38:42
Why not? This is just used as an ordering operatio
sadrul
2017/05/24 17:35:14
I don't know what the result of comparing two non-
Evan Stade
2017/05/24 17:47:53
Does it matter what the meaning of the comparison
sadrul
2017/05/26 19:50:27
Let's create a separate function for that, then, a
Evan Stade
2017/05/26 20:48:52
I moved this to a separate struct, although I'd st
|
| + |
| + 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 +58,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); |