| 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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 // Creates a new image by copying the raw PNG-encoded input for use as the | 65 // Creates a new image by copying the raw PNG-encoded input for use as the |
| 66 // default representation. | 66 // default representation. |
| 67 explicit Image(const std::vector<ImagePNGRep>& image_reps); | 67 explicit Image(const std::vector<ImagePNGRep>& image_reps); |
| 68 | 68 |
| 69 // Creates a new image by copying the ImageSkia for use as the default | 69 // Creates a new image by copying the ImageSkia for use as the default |
| 70 // representation. | 70 // representation. |
| 71 explicit Image(const ImageSkia& image); | 71 explicit Image(const ImageSkia& image); |
| 72 | 72 |
| 73 #if defined(OS_IOS) | 73 #if defined(OS_IOS) |
| 74 // Does not retain |image|; expects to take ownership. | 74 // Retains |image|. |
| 75 explicit Image(UIImage* image); | 75 explicit Image(UIImage* image); |
| 76 | 76 |
| 77 // Retains argument according to |policy|. | 77 // Retains argument according to |policy|. |
| 78 Image(UIImage* image, base::scoped_policy::OwnershipPolicy policy); | 78 Image(UIImage* image, base::scoped_policy::OwnershipPolicy policy); |
| 79 | 79 |
| 80 #elif defined(OS_MACOSX) | 80 #elif defined(OS_MACOSX) |
| 81 // Does not retain |image|; expects to take ownership. | 81 // Does not retain |image|; expects to take ownership. |
| 82 // A single NSImage object can contain multiple bitmaps so there's no reason | 82 // A single NSImage object can contain multiple bitmaps so there's no reason |
| 83 // to pass a vector of these. | 83 // to pass a vector of these. |
| 84 explicit Image(NSImage* image); | 84 explicit Image(NSImage* image); |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 195 std::unique_ptr<internal::ImageRep> rep) const; | 195 std::unique_ptr<internal::ImageRep> rep) const; |
| 196 | 196 |
| 197 // Internal class that holds all the representations. This allows the Image to | 197 // Internal class that holds all the representations. This allows the Image to |
| 198 // be cheaply copied. | 198 // be cheaply copied. |
| 199 scoped_refptr<internal::ImageStorage> storage_; | 199 scoped_refptr<internal::ImageStorage> storage_; |
| 200 }; | 200 }; |
| 201 | 201 |
| 202 } // namespace gfx | 202 } // namespace gfx |
| 203 | 203 |
| 204 #endif // UI_GFX_IMAGE_IMAGE_H_ | 204 #endif // UI_GFX_IMAGE_IMAGE_H_ |
| OLD | NEW |