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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
46 ImageSkia(const SkBitmap& bitmap); | 46 ImageSkia(const SkBitmap& bitmap); |
47 | 47 |
48 ImageSkia(const gfx::ImageSkiaRep& image_rep); | 48 ImageSkia(const gfx::ImageSkiaRep& image_rep); |
49 | 49 |
50 // Copies a reference to |other|'s storage. | 50 // Copies a reference to |other|'s storage. |
51 ImageSkia(const ImageSkia& other); | 51 ImageSkia(const ImageSkia& other); |
52 | 52 |
53 // Copies a reference to |other|'s storage. | 53 // Copies a reference to |other|'s storage. |
54 ImageSkia& operator=(const ImageSkia& other); | 54 ImageSkia& operator=(const ImageSkia& other); |
55 | 55 |
56 // Converts from SkBitmap. | |
57 // Adds ref to passed in bitmap. | |
58 // DIP width and height are set based on scale factor of 1x. | |
59 // TODO(pkotwicz): This is temporary till conversion to gfx::ImageSkia is | |
60 // done. | |
61 ImageSkia& operator=(const SkBitmap& other); | |
62 | |
63 #if defined(OS_WIN) | 56 #if defined(OS_WIN) |
64 // Converts to gfx::ImageSkiaRep and SkBitmap. | 57 // Converts to gfx::ImageSkiaRep and SkBitmap. |
65 // TODO(pkotwicz): This is temporary till conversion to gfx::ImageSkia is | 58 // TODO(pkotwicz): This is temporary till conversion to gfx::ImageSkia is |
66 // done. | 59 // done. |
67 operator SkBitmap&() const { return GetBitmap(); } | 60 operator SkBitmap&() const { return GetBitmap(); } |
68 #endif | 61 #endif |
69 | 62 |
70 ~ImageSkia(); | 63 ~ImageSkia(); |
71 | 64 |
72 // Returns true if this object is backed by the same ImageSkiaStorage as | 65 // Returns true if this object is backed by the same ImageSkiaStorage as |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 | 120 |
128 SkBitmap& GetBitmap() const; | 121 SkBitmap& GetBitmap() const; |
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 |