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

Unified Diff: chrome/browser/chromeos/login/user_image.h

Issue 10831064: [cros] Remove redundant PNG enconding in UserImage. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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
Index: chrome/browser/chromeos/login/user_image.h
diff --git a/chrome/browser/chromeos/login/user_image.h b/chrome/browser/chromeos/login/user_image.h
index 4d7db9625244b67f1193572bbef2d9729b4f86d8..0afb26649330be96cc24b67cc66df17aeb05f691 100644
--- a/chrome/browser/chromeos/login/user_image.h
+++ b/chrome/browser/chromeos/login/user_image.h
@@ -12,36 +12,35 @@
namespace chromeos {
-// Wrapper class for bitmaps and raw images when it's necessary. Could
-// be used for storing profile images (including animated profile
-// images) and user wallpapers.
+// Wrapper class storing a still image and it's raw representation. Could be
+// used for storing profile images (including animated profile images) and user
+// wallpapers.
class UserImage {
public:
+ // TODO(ivankr): replace with RefCountedMemory to prevent copying.
typedef std::vector<unsigned char> RawImage;
- // Constructs UserImage from bitmap. Should be used where only
- // static image is needed (e.g. wallpapers).
+ // Create instance with an empty still frame and no raw data.
+ UserImage();
+
+ // Creates a new instance from a given still frame without any raw data.
explicit UserImage(const gfx::ImageSkia& image);
- // Constructs UserImage from raw image and bitmap that should
- // represent single frame from that one. Can be used for wrapping
- // animated images.
+ // Creates a new instance from a given still frame and raw representation.
+ // |raw_image| can be animated, in which case animated_image() will return the
+ // original |raw_image| and raw_image() will return the encoded representation
+ // of |image|.
UserImage(const gfx::ImageSkia& image, const RawImage& raw_image);
virtual ~UserImage();
- // Replaces already stored image to new |image|. Note, that
- // |raw_image| and |animated_image| will be reset after that
- // operation.
- void SetImage(const gfx::ImageSkia& image);
const gfx::ImageSkia& image() const { return image_; }
- // Returns true iff |image| argument of constructors or |SetImage|
- // can be encoded as a bitmap.
+ // Optional raw representation of the still image.
bool has_raw_image() const { return has_raw_image_; }
const RawImage& raw_image() const { return raw_image_; }
- // Returns true iff UserImage is constructed from animated image.
+ // Optional raw representation of the animated image.
bool has_animated_image() const { return has_animated_image_; }
const RawImage& animated_image() const { return animated_image_; }

Powered by Google App Engine
This is Rietveld 408576698