| 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 89 // Returns true if this is a null object. | 89 // Returns true if this is a null object. |
| 90 // TODO(pkotwicz): Merge this function into empty(). | 90 // TODO(pkotwicz): Merge this function into empty(). |
| 91 bool isNull() const { return storage_ == NULL; } | 91 bool isNull() const { return storage_ == NULL; } |
| 92 | 92 |
| 93 // Width and height of image in DIP coordinate system. | 93 // Width and height of image in DIP coordinate system. |
| 94 int width() const; | 94 int width() const; |
| 95 int height() const; | 95 int height() const; |
| 96 gfx::Size size() const; | 96 gfx::Size size() const; |
| 97 | 97 |
| 98 // Wrapper function for SkBitmap::extractBitmap. | 98 // Wrapper function for SkBitmap::extractBitmap. |
| 99 // Operates on each stored image rep. Note that it may not have | 99 // Deprecated, use ImageSkiaOperations::ExtractSubset instead. |
| 100 // all image reps for supported scale factors. | 100 // TODO(pkotwicz): Remove this function. |
| 101 // TODO(oshima|pkotwicz): Investigate if this can be eliminated | |
| 102 // after ImageSkiaSource conversion. | |
| 103 bool extractSubset(ImageSkia* dst, const SkIRect& subset) const; | 101 bool extractSubset(ImageSkia* dst, const SkIRect& subset) const; |
| 104 | 102 |
| 105 // Returns pointer to an SkBitmap contained by this object. | 103 // Returns pointer to an SkBitmap contained by this object. |
| 106 // TODO(pkotwicz): This is temporary till conversion to gfx::ImageSkia is | 104 // TODO(pkotwicz): This is temporary till conversion to gfx::ImageSkia is |
| 107 // done. | 105 // done. |
| 108 const SkBitmap* bitmap() const; | 106 const SkBitmap* bitmap() const; |
| 109 | 107 |
| 110 // Returns a vector with the image reps contained in this object. | 108 // Returns a vector with the image reps contained in this object. |
| 111 // There is no guarantee that this will return all images rep for | 109 // There is no guarantee that this will return all images rep for |
| 112 // supported scale factors. | 110 // supported scale factors. |
| 113 // TODO(oshima): Update all use of this API and make this to fail | 111 // TODO(oshima): Update all use of this API and make this to fail |
| 114 // when source is used. | 112 // when source is used. |
| 115 std::vector<gfx::ImageSkiaRep> image_reps() const; | 113 std::vector<gfx::ImageSkiaRep> image_reps() const; |
| 116 | 114 |
| 117 private: | 115 private: |
| 118 // Initialize ImageSkiaStorage with passed in parameters. | 116 // Initialize ImageSkiaStorage with passed in parameters. |
| 119 // If the image rep's bitmap is empty, ImageStorage is set to NULL. | 117 // If the image rep's bitmap is empty, ImageStorage is set to NULL. |
| 120 void Init(const gfx::ImageSkiaRep& image_rep); | 118 void Init(const gfx::ImageSkiaRep& image_rep); |
| 121 | 119 |
| 122 // A refptr so that ImageRepSkia can be copied cheaply. | 120 // A refptr so that ImageRepSkia can be copied cheaply. |
| 123 scoped_refptr<internal::ImageSkiaStorage> storage_; | 121 scoped_refptr<internal::ImageSkiaStorage> storage_; |
| 124 }; | 122 }; |
| 125 | 123 |
| 126 } // namespace gfx | 124 } // namespace gfx |
| 127 | 125 |
| 128 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_ | 126 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_ |
| OLD | NEW |