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 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 // Returns true if the object owns a image rep whose density matches | 76 // Returns true if the object owns a image rep whose density matches |
77 // |scale_factor| exactly. | 77 // |scale_factor| exactly. |
78 bool HasRepresentation(ui::ScaleFactor scale_factor); | 78 bool HasRepresentation(ui::ScaleFactor scale_factor); |
79 | 79 |
80 // Returns the image rep whose density best matches | 80 // Returns the image rep whose density best matches |
81 // |scale_factor|. | 81 // |scale_factor|. |
82 // Returns a null image rep if the object contains no image reps. | 82 // Returns a null image rep if the object contains no image reps. |
83 const gfx::ImageSkiaRep& GetRepresentation( | 83 const gfx::ImageSkiaRep& GetRepresentation( |
84 ui::ScaleFactor scale_factor) const; | 84 ui::ScaleFactor scale_factor) const; |
85 | 85 |
| 86 #if defined(OS_MACOSX) |
| 87 // Returns the image reps contained by this object. |
| 88 // If the image has a source, this method will attempt to generate |
| 89 // representations from the source for all supported scale factors. |
| 90 // Mac only for now. |
| 91 std::vector<ImageSkiaRep> GetRepresentations() const; |
| 92 #endif // OS_MACOSX |
| 93 |
86 // Returns true if object is null or its size is empty. | 94 // Returns true if object is null or its size is empty. |
87 bool empty() const; | 95 bool empty() const; |
88 | 96 |
89 // Returns true if this is a null object. | 97 // Returns true if this is a null object. |
90 // TODO(pkotwicz): Merge this function into empty(). | 98 // TODO(pkotwicz): Merge this function into empty(). |
91 bool isNull() const { return storage_ == NULL; } | 99 bool isNull() const { return storage_ == NULL; } |
92 | 100 |
93 // Width and height of image in DIP coordinate system. | 101 // Width and height of image in DIP coordinate system. |
94 int width() const; | 102 int width() const; |
95 int height() const; | 103 int height() const; |
(...skipping 23 matching lines...) Expand all Loading... |
119 // If the image rep's bitmap is empty, ImageStorage is set to NULL. | 127 // If the image rep's bitmap is empty, ImageStorage is set to NULL. |
120 void Init(const gfx::ImageSkiaRep& image_rep); | 128 void Init(const gfx::ImageSkiaRep& image_rep); |
121 | 129 |
122 // A refptr so that ImageRepSkia can be copied cheaply. | 130 // A refptr so that ImageRepSkia can be copied cheaply. |
123 scoped_refptr<internal::ImageSkiaStorage> storage_; | 131 scoped_refptr<internal::ImageSkiaStorage> storage_; |
124 }; | 132 }; |
125 | 133 |
126 } // namespace gfx | 134 } // namespace gfx |
127 | 135 |
128 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_ | 136 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_ |
OLD | NEW |