| 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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 SkBitmap* CopySkBitmap() const; | 113 SkBitmap* CopySkBitmap() const; |
| 114 #if defined(TOOLKIT_USES_GTK) | 114 #if defined(TOOLKIT_USES_GTK) |
| 115 GdkPixbuf* CopyGdkPixbuf() const; | 115 GdkPixbuf* CopyGdkPixbuf() const; |
| 116 #elif defined(OS_MACOSX) | 116 #elif defined(OS_MACOSX) |
| 117 NSImage* CopyNSImage() const; | 117 NSImage* CopyNSImage() const; |
| 118 #endif | 118 #endif |
| 119 | 119 |
| 120 // DEPRECATED ---------------------------------------------------------------- | 120 // DEPRECATED ---------------------------------------------------------------- |
| 121 // Conversion handlers. These wrap the ToType() variants. | 121 // Conversion handlers. These wrap the ToType() variants. |
| 122 operator const SkBitmap&() const; | 122 operator const SkBitmap&() const; |
| 123 #if defined(TOOLKIT_USES_GTK) | 123 #if defined(OS_MACOSX) |
| 124 operator GdkPixbuf*() const; | |
| 125 #elif defined(OS_MACOSX) | |
| 126 operator NSImage*() const; | 124 operator NSImage*() const; |
| 127 #endif | 125 #endif |
| 128 // --------------------------------------------------------------------------- | 126 // --------------------------------------------------------------------------- |
| 129 | 127 |
| 130 // Gets the number of bitmaps in this image. This may cause a conversion | 128 // Gets the number of bitmaps in this image. This may cause a conversion |
| 131 // to a bitmap representation. Note, this function and GetSkBitmapAtIndex() | 129 // to a bitmap representation. Note, this function and GetSkBitmapAtIndex() |
| 132 // are primarily meant to be used by the theme provider. | 130 // are primarily meant to be used by the theme provider. |
| 133 size_t GetNumberOfSkBitmaps() const; | 131 size_t GetNumberOfSkBitmaps() const; |
| 134 | 132 |
| 135 // Gets the bitmap at the given index. This may cause a conversion | 133 // Gets the bitmap at the given index. This may cause a conversion |
| (...skipping 28 matching lines...) Expand all Loading... |
| 164 // be cheaply copied. | 162 // be cheaply copied. |
| 165 scoped_refptr<internal::ImageStorage> storage_; | 163 scoped_refptr<internal::ImageStorage> storage_; |
| 166 | 164 |
| 167 friend class ::ImageTest; | 165 friend class ::ImageTest; |
| 168 friend class ::ImageMacTest; | 166 friend class ::ImageMacTest; |
| 169 }; | 167 }; |
| 170 | 168 |
| 171 } // namespace gfx | 169 } // namespace gfx |
| 172 | 170 |
| 173 #endif // UI_GFX_IMAGE_IMAGE_H_ | 171 #endif // UI_GFX_IMAGE_IMAGE_H_ |
| OLD | NEW |