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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
54 // Copies a reference to |other|'s storage. | 54 // Copies a reference to |other|'s storage. |
55 ImageSkia& operator=(const ImageSkia& other); | 55 ImageSkia& operator=(const ImageSkia& other); |
56 | 56 |
57 // Converts from SkBitmap. | 57 // Converts from SkBitmap. |
58 // Adds ref to passed in bitmap. | 58 // Adds ref to passed in bitmap. |
59 // DIP width and height are set based on scale factor of 1x. | 59 // DIP width and height are set based on scale factor of 1x. |
60 // TODO(pkotwicz): This is temporary till conversion to gfx::ImageSkia is | 60 // TODO(pkotwicz): This is temporary till conversion to gfx::ImageSkia is |
61 // done. | 61 // done. |
62 ImageSkia& operator=(const SkBitmap& other); | 62 ImageSkia& operator=(const SkBitmap& other); |
63 | 63 |
64 // Converts from gfx::ImageSkiaRep. | |
65 // Adds ref to passed in image rep. | |
66 // TODO(pkotwicz): This is temporary till conversion to gfx::ImageSkia is | |
67 // done. | |
68 ImageSkia& operator=(const gfx::ImageSkiaRep& other); | |
69 | |
70 // Converts to gfx::ImageSkiaRep and SkBitmap. | 64 // Converts to gfx::ImageSkiaRep and SkBitmap. |
71 // TODO(pkotwicz): This is temporary till conversion to gfx::ImageSkia is | 65 // TODO(pkotwicz): This is temporary till conversion to gfx::ImageSkia is |
72 // done. | 66 // done. |
73 operator SkBitmap&() const; | 67 operator SkBitmap&() const; |
74 operator gfx::ImageSkiaRep&() const; | |
75 | 68 |
76 ~ImageSkia(); | 69 ~ImageSkia(); |
77 | 70 |
78 // Adds |image_rep| to the image reps contained by this object. | 71 // Adds |image_rep| to the image reps contained by this object. |
79 void AddRepresentation(const gfx::ImageSkiaRep& image_rep); | 72 void AddRepresentation(const gfx::ImageSkiaRep& image_rep); |
80 | 73 |
81 // Removes the image rep of |scale_factor| if present. | 74 // Removes the image rep of |scale_factor| if present. |
82 void RemoveRepresentation(ui::ScaleFactor scale_factor); | 75 void RemoveRepresentation(ui::ScaleFactor scale_factor); |
83 | 76 |
84 // Returns true if the object owns a image rep whose density matches | 77 // Returns true if the object owns a image rep whose density matches |
(...skipping 42 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. | 120 // If the image rep's bitmap is empty, ImageStorage is set to NULL. |
128 void Init(const gfx::ImageSkiaRep& image_rep); | 121 void Init(const gfx::ImageSkiaRep& image_rep); |
129 | 122 |
130 // A refptr so that ImageRepSkia can be copied cheaply. | 123 // A refptr so that ImageRepSkia can be copied cheaply. |
131 scoped_refptr<internal::ImageSkiaStorage> storage_; | 124 scoped_refptr<internal::ImageSkiaStorage> storage_; |
132 }; | 125 }; |
133 | 126 |
134 } // namespace gfx | 127 } // namespace gfx |
135 | 128 |
136 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_ | 129 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_ |
OLD | NEW |