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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 #elif defined(OS_MACOSX) | 103 #elif defined(OS_MACOSX) |
104 NSImage* ToNSImage() const; | 104 NSImage* ToNSImage() const; |
105 #endif | 105 #endif |
106 | 106 |
107 // Performs a conversion, like above, but returns a copy of the result rather | 107 // Performs a conversion, like above, but returns a copy of the result rather |
108 // than a weak pointer. The caller is responsible for deleting the result. | 108 // than a weak pointer. The caller is responsible for deleting the result. |
109 // Note that the result is only a copy in terms of memory management; the | 109 // Note that the result is only a copy in terms of memory management; the |
110 // backing pixels are shared amongst all copies (a fact of each of the | 110 // backing pixels are shared amongst all copies (a fact of each of the |
111 // converted representations, rather than a limitation imposed by Image) and | 111 // converted representations, rather than a limitation imposed by Image) and |
112 // so the result should be considered immutable. | 112 // so the result should be considered immutable. |
113 const 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 operator const SkBitmap&() const; | 123 operator const SkBitmap&() const; |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
165 // be cheaply copied. | 165 // be cheaply copied. |
166 scoped_refptr<internal::ImageStorage> storage_; | 166 scoped_refptr<internal::ImageStorage> storage_; |
167 | 167 |
168 friend class ::ImageTest; | 168 friend class ::ImageTest; |
169 friend class ::ImageMacTest; | 169 friend class ::ImageMacTest; |
170 }; | 170 }; |
171 | 171 |
172 } // namespace gfx | 172 } // namespace gfx |
173 | 173 |
174 #endif // UI_GFX_IMAGE_IMAGE_H_ | 174 #endif // UI_GFX_IMAGE_IMAGE_H_ |
OLD | NEW |