| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 // so the result should be considered immutable. | 130 // so the result should be considered immutable. |
| 131 std::vector<unsigned char>* CopyImagePNG() const; | 131 std::vector<unsigned char>* CopyImagePNG() const; |
| 132 ImageSkia* CopyImageSkia() const; | 132 ImageSkia* CopyImageSkia() const; |
| 133 SkBitmap* CopySkBitmap() const; | 133 SkBitmap* CopySkBitmap() const; |
| 134 #if defined(TOOLKIT_GTK) | 134 #if defined(TOOLKIT_GTK) |
| 135 GdkPixbuf* CopyGdkPixbuf() const; | 135 GdkPixbuf* CopyGdkPixbuf() const; |
| 136 #elif defined(OS_MACOSX) | 136 #elif defined(OS_MACOSX) |
| 137 NSImage* CopyNSImage() const; | 137 NSImage* CopyNSImage() const; |
| 138 #endif | 138 #endif |
| 139 | 139 |
| 140 // DEPRECATED ---------------------------------------------------------------- | |
| 141 // Conversion handlers. These wrap the ToType() variants. | |
| 142 #if defined(OS_MACOSX) | |
| 143 operator NSImage*() const; | |
| 144 #endif | |
| 145 // --------------------------------------------------------------------------- | |
| 146 | |
| 147 // Inspects the representations map to see if the given type exists. | 140 // Inspects the representations map to see if the given type exists. |
| 148 bool HasRepresentation(RepresentationType type) const; | 141 bool HasRepresentation(RepresentationType type) const; |
| 149 | 142 |
| 150 // Returns the number of representations. | 143 // Returns the number of representations. |
| 151 size_t RepresentationCount() const; | 144 size_t RepresentationCount() const; |
| 152 | 145 |
| 153 // Returns true if this Image has no representations. | 146 // Returns true if this Image has no representations. |
| 154 bool IsEmpty() const; | 147 bool IsEmpty() const; |
| 155 | 148 |
| 156 // Swaps this image's internal representations with |other|. | 149 // Swaps this image's internal representations with |other|. |
| (...skipping 15 matching lines...) Expand all Loading... |
| 172 // be cheaply copied. | 165 // be cheaply copied. |
| 173 scoped_refptr<internal::ImageStorage> storage_; | 166 scoped_refptr<internal::ImageStorage> storage_; |
| 174 | 167 |
| 175 friend class ::ImageTest; | 168 friend class ::ImageTest; |
| 176 friend class ::ImageMacTest; | 169 friend class ::ImageMacTest; |
| 177 }; | 170 }; |
| 178 | 171 |
| 179 } // namespace gfx | 172 } // namespace gfx |
| 180 | 173 |
| 181 #endif // UI_GFX_IMAGE_IMAGE_H_ | 174 #endif // UI_GFX_IMAGE_IMAGE_H_ |
| OLD | NEW |