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 16 matching lines...) Expand all Loading... |
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 // ImageSkia is cheap to copy and intentionally supports copy semantics. | 36 // ImageSkia is cheap to copy and intentionally supports copy semantics. |
37 class UI_EXPORT ImageSkia { | 37 class GFX_EXPORT ImageSkia { |
38 public: | 38 public: |
39 typedef std::vector<ImageSkiaRep> ImageSkiaReps; | 39 typedef std::vector<ImageSkiaRep> ImageSkiaReps; |
40 | 40 |
41 // Creates an instance with no bitmaps. | 41 // Creates an instance with no bitmaps. |
42 ImageSkia(); | 42 ImageSkia(); |
43 | 43 |
44 // Creates an instance that will use the |source| to get the image | 44 // 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. | 45 // for scale factors. |size| specifes the size of the image in DIP. |
46 // ImageSkia owns |source|. | 46 // ImageSkia owns |source|. |
47 ImageSkia(ImageSkiaSource* source, const gfx::Size& size); | 47 ImageSkia(ImageSkiaSource* source, const gfx::Size& size); |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 // so that other thread can access the storage. | 166 // so that other thread can access the storage. |
167 void DetachStorageFromThread(); | 167 void DetachStorageFromThread(); |
168 | 168 |
169 // A refptr so that ImageRepSkia can be copied cheaply. | 169 // A refptr so that ImageRepSkia can be copied cheaply. |
170 scoped_refptr<internal::ImageSkiaStorage> storage_; | 170 scoped_refptr<internal::ImageSkiaStorage> storage_; |
171 }; | 171 }; |
172 | 172 |
173 } // namespace gfx | 173 } // namespace gfx |
174 | 174 |
175 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_ | 175 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_ |
OLD | NEW |