| 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 // An Image wraps an image any flavor, be it platform-native GdkBitmap/NSImage, | 5 // An Image wraps an image any flavor, be it platform-native GdkBitmap/NSImage, |
| 6 // or a SkBitmap. This also provides easy conversion to other image types | 6 // or a SkBitmap. This also provides easy conversion to other image types |
| 7 // through operator overloading. It will cache the converted representations | 7 // through operator overloading. It will cache the converted representations |
| 8 // internally to prevent double-conversion. | 8 // internally to prevent double-conversion. |
| 9 // | 9 // |
| 10 // The lifetime of both the initial representation and any converted ones are | 10 // The lifetime of both the initial representation and any converted ones are |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 ImageSkia* CopyImageSkia() const; | 138 ImageSkia* CopyImageSkia() const; |
| 139 SkBitmap* CopySkBitmap() const; | 139 SkBitmap* CopySkBitmap() const; |
| 140 #if defined(TOOLKIT_GTK) | 140 #if defined(TOOLKIT_GTK) |
| 141 GdkPixbuf* CopyGdkPixbuf() const; | 141 GdkPixbuf* CopyGdkPixbuf() const; |
| 142 #elif defined(OS_IOS) | 142 #elif defined(OS_IOS) |
| 143 UIImage* CopyUIImage() const; | 143 UIImage* CopyUIImage() const; |
| 144 #elif defined(OS_MACOSX) | 144 #elif defined(OS_MACOSX) |
| 145 NSImage* CopyNSImage() const; | 145 NSImage* CopyNSImage() const; |
| 146 #endif | 146 #endif |
| 147 | 147 |
| 148 // DEPRECATED ---------------------------------------------------------------- | |
| 149 // Conversion handlers. These wrap the ToType() variants. | |
| 150 #if defined(OS_MACOSX) && !defined(OS_IOS) | |
| 151 operator NSImage*() const; | |
| 152 #endif | |
| 153 // --------------------------------------------------------------------------- | |
| 154 | |
| 155 // Inspects the representations map to see if the given type exists. | 148 // Inspects the representations map to see if the given type exists. |
| 156 bool HasRepresentation(RepresentationType type) const; | 149 bool HasRepresentation(RepresentationType type) const; |
| 157 | 150 |
| 158 // Returns the number of representations. | 151 // Returns the number of representations. |
| 159 size_t RepresentationCount() const; | 152 size_t RepresentationCount() const; |
| 160 | 153 |
| 161 // Returns true if this Image has no representations. | 154 // Returns true if this Image has no representations. |
| 162 bool IsEmpty() const; | 155 bool IsEmpty() const; |
| 163 | 156 |
| 164 // Swaps this image's internal representations with |other|. | 157 // Swaps this image's internal representations with |other|. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 180 // be cheaply copied. | 173 // be cheaply copied. |
| 181 scoped_refptr<internal::ImageStorage> storage_; | 174 scoped_refptr<internal::ImageStorage> storage_; |
| 182 | 175 |
| 183 friend class ::ImageTest; | 176 friend class ::ImageTest; |
| 184 friend class ::ImageMacTest; | 177 friend class ::ImageMacTest; |
| 185 }; | 178 }; |
| 186 | 179 |
| 187 } // namespace gfx | 180 } // namespace gfx |
| 188 | 181 |
| 189 #endif // UI_GFX_IMAGE_IMAGE_H_ | 182 #endif // UI_GFX_IMAGE_IMAGE_H_ |
| OLD | NEW |