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 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
94 | 94 |
95 // Returns true if this is a null object. | 95 // Returns true if this is a null object. |
96 // TODO(pkotwicz): Merge this function into empty(). | 96 // TODO(pkotwicz): Merge this function into empty(). |
97 bool isNull() const { return storage_ == NULL; } | 97 bool isNull() const { return storage_ == NULL; } |
98 | 98 |
99 // Width and height of image in DIP coordinate system. | 99 // Width and height of image in DIP coordinate system. |
100 int width() const; | 100 int width() const; |
101 int height() const; | 101 int height() const; |
102 | 102 |
103 // Wrapper function for SkBitmap::extractBitmap. | 103 // Wrapper function for SkBitmap::extractBitmap. |
104 // Operates on bitmap at index 0 if available. | 104 // Operates on each stored bitmap. |
105 // TODO(pkotwicz): This is temporary till conversion to gfx::ImageSkia is | |
106 // done. | |
107 bool extractSubset(ImageSkia* dst, const SkIRect& subset) const; | 105 bool extractSubset(ImageSkia* dst, const SkIRect& subset) const; |
108 | 106 |
109 // Returns pointer to an SkBitmap contained by this object. | 107 // Returns pointer to an SkBitmap contained by this object. |
110 // TODO(pkotwicz): This is temporary till conversion to gfx::ImageSkia is | 108 // TODO(pkotwicz): This is temporary till conversion to gfx::ImageSkia is |
111 // done. | 109 // done. |
112 const SkBitmap* bitmap() const; | 110 const SkBitmap* bitmap() const; |
113 | 111 |
114 // Returns a vector with the SkBitmaps contained in this object. | 112 // Returns a vector with the SkBitmaps contained in this object. |
115 const std::vector<SkBitmap> bitmaps() const; | 113 const std::vector<SkBitmap> bitmaps() const; |
116 | 114 |
(...skipping 21 matching lines...) Expand all Loading... |
138 // A null bitmap to return as not to return a temporary. | 136 // A null bitmap to return as not to return a temporary. |
139 static SkBitmap* null_bitmap_; | 137 static SkBitmap* null_bitmap_; |
140 | 138 |
141 // A refptr so that ImageRepSkia can be copied cheaply. | 139 // A refptr so that ImageRepSkia can be copied cheaply. |
142 scoped_refptr<internal::ImageSkiaStorage> storage_; | 140 scoped_refptr<internal::ImageSkiaStorage> storage_; |
143 }; | 141 }; |
144 | 142 |
145 } // namespace gfx | 143 } // namespace gfx |
146 | 144 |
147 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_ | 145 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_ |
OLD | NEW |