Chromium Code Reviews| Index: ui/gfx/image/image.h |
| diff --git a/ui/gfx/image/image.h b/ui/gfx/image/image.h |
| index 6f0e9266e7b8a017f94ccda3e4e94fdc12960ec4..e3ee6091f9d685a43c23609cd81a28b5dfcb3254 100644 |
| --- a/ui/gfx/image/image.h |
| +++ b/ui/gfx/image/image.h |
| @@ -49,6 +49,12 @@ class ImageRep; |
| class ImageStorage; |
| } |
| +// An image, backed by zero or more equivalent representations. When a specific |
|
Robert Sesek
2014/04/17 16:56:58
The comment for this class is at the top of the fi
|
| +// representation is requested, the image data is converted to the desired |
| +// representation and cached, if it is not already. |
| +// |
| +// Image objects are copyable and thread safe. However, there are no thread |
| +// safety guarantees about the individual representations. |
| class GFX_EXPORT Image { |
| public: |
| enum RepresentationType { |
| @@ -60,8 +66,6 @@ class GFX_EXPORT Image { |
| kImageRepPNG, |
| }; |
| - typedef std::map<RepresentationType, internal::ImageRep*> RepresentationMap; |
| - |
| // Creates an empty image with no representations. |
| Image(); |
| @@ -188,6 +192,10 @@ class GFX_EXPORT Image { |
| RepresentationType rep_type, bool must_exist) const; |
| // Stores a representation into the map. |
| + // NOTE: This is const, despite modifying the object's internal storage. It |
| + // should only be used to add representations that are equivalent to an |
| + // existing representation (i.e., it should not affect the externally visible |
| + // state of the object). |
| void AddRepresentation(internal::ImageRep* rep) const; |
| // Internal class that holds all the representations. This allows the Image to |