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 #ifndef UI_GFX_IMAGE_IMAGE_SKIA_H_ | 5 #ifndef UI_GFX_IMAGE_IMAGE_SKIA_H_ |
6 #define UI_GFX_IMAGE_IMAGE_SKIA_H_ | 6 #define UI_GFX_IMAGE_IMAGE_SKIA_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 15 matching lines...) Expand all Loading... |
26 class TestOnThread; | 26 class TestOnThread; |
27 } | 27 } |
28 | 28 |
29 // Container for the same image at different densities, similar to NSImage. | 29 // Container for the same image at different densities, similar to NSImage. |
30 // Image height and width are in DIP (Density Indepent Pixel) coordinates. | 30 // Image height and width are in DIP (Density Indepent Pixel) coordinates. |
31 // | 31 // |
32 // ImageSkia should be used whenever possible instead of SkBitmap. | 32 // ImageSkia should be used whenever possible instead of SkBitmap. |
33 // Functions that mutate the image should operate on the gfx::ImageSkiaRep | 33 // Functions that mutate the image should operate on the gfx::ImageSkiaRep |
34 // returned from ImageSkia::GetRepresentation, not on ImageSkia. | 34 // returned from ImageSkia::GetRepresentation, not on ImageSkia. |
35 // | 35 // |
| 36 // NOTE: This class should *not* be used to store multiple logical sizes of an |
| 37 // image (e.g., small, medium and large versions of an icon); use an ImageFamily |
| 38 // for that. An ImageSkia represents an image of a single logical size, with |
| 39 // potentially many different densities for high-DPI displays. |
| 40 // |
36 // ImageSkia is cheap to copy and intentionally supports copy semantics. | 41 // ImageSkia is cheap to copy and intentionally supports copy semantics. |
37 class GFX_EXPORT ImageSkia { | 42 class GFX_EXPORT ImageSkia { |
38 public: | 43 public: |
39 typedef std::vector<ImageSkiaRep> ImageSkiaReps; | 44 typedef std::vector<ImageSkiaRep> ImageSkiaReps; |
40 | 45 |
41 // Creates an instance with no bitmaps. | 46 // Creates an instance with no bitmaps. |
42 ImageSkia(); | 47 ImageSkia(); |
43 | 48 |
44 // Creates an instance that will use the |source| to get the image | 49 // Creates an instance that will use the |source| to get the image |
45 // for scale factors. |size| specifes the size of the image in DIP. | 50 // for scale factors. |size| specifes the size of the image in DIP. |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 // so that other thread can access the storage. | 171 // so that other thread can access the storage. |
167 void DetachStorageFromThread(); | 172 void DetachStorageFromThread(); |
168 | 173 |
169 // A refptr so that ImageRepSkia can be copied cheaply. | 174 // A refptr so that ImageRepSkia can be copied cheaply. |
170 scoped_refptr<internal::ImageSkiaStorage> storage_; | 175 scoped_refptr<internal::ImageSkiaStorage> storage_; |
171 }; | 176 }; |
172 | 177 |
173 } // namespace gfx | 178 } // namespace gfx |
174 | 179 |
175 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_ | 180 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_ |
OLD | NEW |