Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef UI_GFX_IMAGE_IMAGE_SKIA_H_ | 5 #ifndef UI_GFX_IMAGE_IMAGE_SKIA_H_ |
| 6 #define UI_GFX_IMAGE_IMAGE_SKIA_H_ | 6 #define UI_GFX_IMAGE_IMAGE_SKIA_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 60 // done. | 60 // done. |
| 61 ImageSkia& operator=(const SkBitmap& other); | 61 ImageSkia& operator=(const SkBitmap& other); |
| 62 | 62 |
| 63 // Converts to gfx::ImageSkiaRep and SkBitmap. | 63 // Converts to gfx::ImageSkiaRep and SkBitmap. |
| 64 // TODO(pkotwicz): This is temporary till conversion to gfx::ImageSkia is | 64 // TODO(pkotwicz): This is temporary till conversion to gfx::ImageSkia is |
| 65 // done. | 65 // done. |
| 66 operator SkBitmap&() const; | 66 operator SkBitmap&() const; |
| 67 | 67 |
| 68 ~ImageSkia(); | 68 ~ImageSkia(); |
| 69 | 69 |
| 70 // Returns true if this object is backed by the same ImageSkiaStorage as | |
| 71 // |other|. Will also return true if both images are isNull(). | |
| 72 bool Equals(const gfx::ImageSkia& other) const; | |
|
Nico
2012/08/14 20:19:36
I'd call this RefersToSamePixelsAs() or something.
pkotwicz
2012/08/14 20:22:38
I agree.
| |
| 73 | |
| 70 // Adds |image_rep| to the image reps contained by this object. | 74 // Adds |image_rep| to the image reps contained by this object. |
| 71 void AddRepresentation(const gfx::ImageSkiaRep& image_rep); | 75 void AddRepresentation(const gfx::ImageSkiaRep& image_rep); |
| 72 | 76 |
| 73 // Removes the image rep of |scale_factor| if present. | 77 // Removes the image rep of |scale_factor| if present. |
| 74 void RemoveRepresentation(ui::ScaleFactor scale_factor); | 78 void RemoveRepresentation(ui::ScaleFactor scale_factor); |
| 75 | 79 |
| 76 // Returns true if the object owns an image rep whose density matches | 80 // Returns true if the object owns an image rep whose density matches |
| 77 // |scale_factor| exactly. | 81 // |scale_factor| exactly. |
| 78 bool HasRepresentation(ui::ScaleFactor scale_factor) const; | 82 bool HasRepresentation(ui::ScaleFactor scale_factor) const; |
| 79 | 83 |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 127 // If the image rep's bitmap is empty, ImageStorage is set to NULL. | 131 // If the image rep's bitmap is empty, ImageStorage is set to NULL. |
| 128 void Init(const gfx::ImageSkiaRep& image_rep); | 132 void Init(const gfx::ImageSkiaRep& image_rep); |
| 129 | 133 |
| 130 // A refptr so that ImageRepSkia can be copied cheaply. | 134 // A refptr so that ImageRepSkia can be copied cheaply. |
| 131 scoped_refptr<internal::ImageSkiaStorage> storage_; | 135 scoped_refptr<internal::ImageSkiaStorage> storage_; |
| 132 }; | 136 }; |
| 133 | 137 |
| 134 } // namespace gfx | 138 } // namespace gfx |
| 135 | 139 |
| 136 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_ | 140 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_ |
| OLD | NEW |