Index: ui/gfx/image/image_skia.h |
diff --git a/ui/gfx/image/image_skia.h b/ui/gfx/image/image_skia.h |
index 24422d2f09a5559c1f28a53532925a83daa35130..f215434e70a98a7d15fef0f1b9fe470bc108ec93 100644 |
--- a/ui/gfx/image/image_skia.h |
+++ b/ui/gfx/image/image_skia.h |
@@ -28,6 +28,9 @@ class ImageSkiaStorage; |
// returned from ImageSkia::GetRepresentation, not on ImageSkia. |
// |
// ImageSkia is cheap to copy and intentionally supports copy semantics. |
+// |
+// TODO(oshima): ImageSkia can and may contain multiple reps |
+// with the same scale factor. Fix the client code and pro |
class UI_EXPORT ImageSkia { |
public: |
typedef std::vector<ImageSkiaRep> ImageSkiaReps; |
@@ -37,6 +40,7 @@ class UI_EXPORT ImageSkia { |
// Creates an instance that will use the |source| to get the image |
// for scale factors. |size| specifes the size of the image in DIP. |
+ // ImageSkia owns |source|. |
ImageSkia(ImageSkiaSource* source, const gfx::Size& size); |
// Adds ref to passed in bitmap. |
@@ -120,6 +124,14 @@ class UI_EXPORT ImageSkia { |
// when source is used. |
std::vector<gfx::ImageSkiaRep> image_reps() const; |
+ // Delete the ImageSkiaSource if any. It will make GetRepresentation |
+ // thread safe because it will no longer update the storage. |
+ void DeleteSource(); |
+ |
+ // When the soruce is available, generates all ImageReps for |
+ // supported scale factors. |
+ void EnsureRepsForSupportedScaleFactors() const; |
+ |
private: |
// Initialize ImageSkiaStorage with passed in parameters. |
// If the image rep's bitmap is empty, ImageStorage is set to NULL. |