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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
65 // default representation. | 65 // default representation. |
66 explicit Image(const std::vector<ImagePNGRep>& image_reps); | 66 explicit Image(const std::vector<ImagePNGRep>& image_reps); |
67 | 67 |
68 // Creates a new image by copying the ImageSkia for use as the default | 68 // Creates a new image by copying the ImageSkia for use as the default |
69 // representation. | 69 // representation. |
70 explicit Image(const ImageSkia& image); | 70 explicit Image(const ImageSkia& image); |
71 | 71 |
72 #if defined(OS_IOS) | 72 #if defined(OS_IOS) |
73 // Does not retain |image|; expects to take ownership. | 73 // Does not retain |image|; expects to take ownership. |
74 explicit Image(UIImage* image); | 74 explicit Image(UIImage* image); |
75 | |
76 // Retains argument if |retain_argument| is true. | |
77 explicit Image(UIImage* image, bool retain_argument); | |
sdefresne
2016/11/22 14:23:16
"explicit" is only for constructor that can be inv
stkhapugin
2016/12/06 10:41:57
Done
| |
78 | |
75 #elif defined(OS_MACOSX) | 79 #elif defined(OS_MACOSX) |
76 // Does not retain |image|; expects to take ownership. | 80 // Does not retain |image|; expects to take ownership. |
77 // A single NSImage object can contain multiple bitmaps so there's no reason | 81 // A single NSImage object can contain multiple bitmaps so there's no reason |
78 // to pass a vector of these. | 82 // to pass a vector of these. |
79 explicit Image(NSImage* image); | 83 explicit Image(NSImage* image); |
80 #endif | 84 #endif |
81 | 85 |
82 // Initializes a new Image by AddRef()ing |other|'s internal storage. | 86 // Initializes a new Image by AddRef()ing |other|'s internal storage. |
83 Image(const Image& other); | 87 Image(const Image& other); |
84 | 88 |
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
190 std::unique_ptr<internal::ImageRep> rep) const; | 194 std::unique_ptr<internal::ImageRep> rep) const; |
191 | 195 |
192 // Internal class that holds all the representations. This allows the Image to | 196 // Internal class that holds all the representations. This allows the Image to |
193 // be cheaply copied. | 197 // be cheaply copied. |
194 scoped_refptr<internal::ImageStorage> storage_; | 198 scoped_refptr<internal::ImageStorage> storage_; |
195 }; | 199 }; |
196 | 200 |
197 } // namespace gfx | 201 } // namespace gfx |
198 | 202 |
199 #endif // UI_GFX_IMAGE_IMAGE_H_ | 203 #endif // UI_GFX_IMAGE_IMAGE_H_ |
OLD | NEW |