Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1749)

Unified Diff: cc/paint/paint_image.h

Issue 2899483002: cc: Audit and static_assert the types in PaintOpBuffer can be moved.
Patch Set: check-copy better-better-comment Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/paint/paint_op_buffer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/paint/paint_image.h
diff --git a/cc/paint/paint_image.h b/cc/paint/paint_image.h
index 489cef27bd21647b902b0c85367b9f8447904dcd..97c4a28f19de5ee7a6cba7ff199c38f61c628944 100644
--- a/cc/paint/paint_image.h
+++ b/cc/paint/paint_image.h
@@ -55,6 +55,13 @@ class CC_PAINT_EXPORT PaintImage {
CompletionState completion_state() const { return completion_state_; }
private:
+ // Because PaintImage is stored in PaintOpBuffer it must be able to be moved
danakj 2017/05/19 20:35:35 I iterated on this comment a couple times to get s
+ // in memory. This is satisfied since it has a default move constructor, and
+ // the same is satisfied by each of its members. But otherwise would need to
+ // ensure it directly or indirectly owns no pointers back to itself.
+ // sk_sp<SkImage> satisfies this since the SkImage does not contain a pointer
+ // to the sk_sp<> itself. The other types are trivial types.
+
Id id_ = kUnknownStableId;
sk_sp<SkImage> sk_image_;
AnimationType animation_type_ = AnimationType::UNKNOWN;
« no previous file with comments | « no previous file | cc/paint/paint_op_buffer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698