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 <memory> | 8 #include <memory> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
88 // Note that this does NOT generate ImageSkiaReps from its source. | 88 // Note that this does NOT generate ImageSkiaReps from its source. |
89 // If you want to create a deep copy with ImageSkiaReps for supported | 89 // If you want to create a deep copy with ImageSkiaReps for supported |
90 // scale factors, you need to explicitly call | 90 // scale factors, you need to explicitly call |
91 // |EnsureRepsForSupportedScales()| first. | 91 // |EnsureRepsForSupportedScales()| first. |
92 std::unique_ptr<ImageSkia> DeepCopy() const; | 92 std::unique_ptr<ImageSkia> DeepCopy() const; |
93 | 93 |
94 // Returns true if this object is backed by the same ImageSkiaStorage as | 94 // Returns true if this object is backed by the same ImageSkiaStorage as |
95 // |other|. Will also return true if both images are isNull(). | 95 // |other|. Will also return true if both images are isNull(). |
96 bool BackedBySameObjectAs(const gfx::ImageSkia& other) const; | 96 bool BackedBySameObjectAs(const gfx::ImageSkia& other) const; |
97 | 97 |
98 // Alias for BackedBySameObjectAs(). Used by mojo EqualsTraits<> for | |
99 // comparing two ui::mojom::ImageSkia. | |
100 bool Equals(const gfx::ImageSkia& other) const; | |
James Cook
2017/04/25 00:58:28
I think this is the right way to handle comparison
xiyuan
2017/04/25 16:04:53
If gfx::ImageSkia needs an operation== in the futu
oshima
2017/04/25 17:28:04
Does this have to be named "Equals"? "equals" and
James Cook
2017/04/25 17:32:47
It must either be called Equals() or be operator==
James Cook
2017/04/25 17:50:04
Oshima, please wait on looking at this. Yuzhu had
| |
101 | |
98 // Adds |image_rep| to the image reps contained by this object. | 102 // Adds |image_rep| to the image reps contained by this object. |
99 void AddRepresentation(const gfx::ImageSkiaRep& image_rep); | 103 void AddRepresentation(const gfx::ImageSkiaRep& image_rep); |
100 | 104 |
101 // Removes the image rep of |scale| if present. | 105 // Removes the image rep of |scale| if present. |
102 void RemoveRepresentation(float scale); | 106 void RemoveRepresentation(float scale); |
103 | 107 |
104 // Returns true if the object owns an image rep whose density matches | 108 // Returns true if the object owns an image rep whose density matches |
105 // |scale| exactly. | 109 // |scale| exactly. |
106 bool HasRepresentation(float scale) const; | 110 bool HasRepresentation(float scale) const; |
107 | 111 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
170 // so that other thread can access the storage. | 174 // so that other thread can access the storage. |
171 void DetachStorageFromThread(); | 175 void DetachStorageFromThread(); |
172 | 176 |
173 // A refptr so that ImageRepSkia can be copied cheaply. | 177 // A refptr so that ImageRepSkia can be copied cheaply. |
174 scoped_refptr<internal::ImageSkiaStorage> storage_; | 178 scoped_refptr<internal::ImageSkiaStorage> storage_; |
175 }; | 179 }; |
176 | 180 |
177 } // namespace gfx | 181 } // namespace gfx |
178 | 182 |
179 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_ | 183 #endif // UI_GFX_IMAGE_IMAGE_SKIA_H_ |
OLD | NEW |