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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
106 // Wrapper function for SkBitmap::extractBitmap. | 106 // Wrapper function for SkBitmap::extractBitmap. |
107 // Deprecated, use ImageSkiaOperations::ExtractSubset instead. | 107 // Deprecated, use ImageSkiaOperations::ExtractSubset instead. |
108 // TODO(pkotwicz): Remove this function. | 108 // TODO(pkotwicz): Remove this function. |
109 bool extractSubset(ImageSkia* dst, const SkIRect& subset) const; | 109 bool extractSubset(ImageSkia* dst, const SkIRect& subset) const; |
110 | 110 |
111 // Returns pointer to 1x bitmap contained by this object. If there is no 1x | 111 // Returns pointer to 1x bitmap contained by this object. If there is no 1x |
112 // bitmap, the bitmap whose scale factor is closest to 1x is returned. | 112 // bitmap, the bitmap whose scale factor is closest to 1x is returned. |
113 // This function should only be used in unittests and on platforms which do | 113 // This function should only be used in unittests and on platforms which do |
114 // not support scale factors other than 1x. | 114 // not support scale factors other than 1x. |
115 // TODO(pkotwicz): Return null SkBitmap when the object has no 1x bitmap. | 115 // TODO(pkotwicz): Return null SkBitmap when the object has no 1x bitmap. |
116 const SkBitmap* bitmap() const; | 116 const SkBitmap* bitmap() const { return &operator SkBitmap&(); } |
117 | 117 |
118 // Returns a vector with the image reps contained in this object. | 118 // Returns a vector with the image reps contained in this object. |
119 // There is no guarantee that this will return all images rep for | 119 // There is no guarantee that this will return all images rep for |
120 // supported scale factors. | 120 // supported scale factors. |
121 // TODO(oshima): Update all use of this API and make this to fail | 121 // TODO(oshima): Update all use of this API and make this to fail |
122 // when source is used. | 122 // when source is used. |
123 std::vector<gfx::ImageSkiaRep> image_reps() const; | 123 std::vector<gfx::ImageSkiaRep> image_reps() const; |
124 | 124 |
125 private: | 125 private: |
126 // Initialize ImageSkiaStorage with passed in parameters. | 126 // Initialize ImageSkiaStorage with passed in parameters. |
127 // 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. |
128 void Init(const gfx::ImageSkiaRep& image_rep); | 128 void Init(const gfx::ImageSkiaRep& image_rep); |
129 | 129 |
130 // A refptr so that ImageRepSkia can be copied cheaply. | 130 // A refptr so that ImageRepSkia can be copied cheaply. |
131 scoped_refptr<internal::ImageSkiaStorage> storage_; | 131 scoped_refptr<internal::ImageSkiaStorage> storage_; |
132 }; | 132 }; |
133 | 133 |
134 } // namespace gfx | 134 } // namespace gfx |
135 | 135 |
136 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_ | 136 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_ |
OLD | NEW |