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 19 matching lines...) Expand all Loading... |
30 // ImageSkia is cheap to copy and intentionally supports copy semantics. | 30 // ImageSkia is cheap to copy and intentionally supports copy semantics. |
31 class UI_EXPORT ImageSkia { | 31 class UI_EXPORT ImageSkia { |
32 public: | 32 public: |
33 typedef std::vector<ImageSkiaRep> ImageSkiaReps; | 33 typedef std::vector<ImageSkiaRep> ImageSkiaReps; |
34 | 34 |
35 // Creates an instance with no bitmaps. | 35 // Creates an instance with no bitmaps. |
36 ImageSkia(); | 36 ImageSkia(); |
37 | 37 |
38 // Creates an instance that will use the |source| to get the image | 38 // Creates an instance that will use the |source| to get the image |
39 // for scale factors. |size| specifes the size of the image in DIP. | 39 // for scale factors. |size| specifes the size of the image in DIP. |
| 40 // ImageSkia owns |source|. |
40 ImageSkia(ImageSkiaSource* source, const gfx::Size& size); | 41 ImageSkia(ImageSkiaSource* source, const gfx::Size& size); |
41 | 42 |
42 // Adds ref to passed in bitmap. | 43 // Adds ref to passed in bitmap. |
43 // DIP width and height are set based on scale factor of 1x. | 44 // DIP width and height are set based on scale factor of 1x. |
44 // TODO(pkotwicz): This is temporary till conversion to gfx::ImageSkia is | 45 // TODO(pkotwicz): This is temporary till conversion to gfx::ImageSkia is |
45 // done. | 46 // done. |
46 ImageSkia(const SkBitmap& bitmap); | 47 ImageSkia(const SkBitmap& bitmap); |
47 | 48 |
48 ImageSkia(const gfx::ImageSkiaRep& image_rep); | 49 ImageSkia(const gfx::ImageSkiaRep& image_rep); |
49 | 50 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 // If the image rep's bitmap is empty, ImageStorage is set to NULL. | 128 // If the image rep's bitmap is empty, ImageStorage is set to NULL. |
128 void Init(const gfx::ImageSkiaRep& image_rep); | 129 void Init(const gfx::ImageSkiaRep& image_rep); |
129 | 130 |
130 // A refptr so that ImageRepSkia can be copied cheaply. | 131 // A refptr so that ImageRepSkia can be copied cheaply. |
131 scoped_refptr<internal::ImageSkiaStorage> storage_; | 132 scoped_refptr<internal::ImageSkiaStorage> storage_; |
132 }; | 133 }; |
133 | 134 |
134 } // namespace gfx | 135 } // namespace gfx |
135 | 136 |
136 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_ | 137 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_ |
OLD | NEW |