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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « no previous file | cc/paint/paint_op_buffer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 CC_PAINT_PAINT_IMAGE_H_ 5 #ifndef CC_PAINT_PAINT_IMAGE_H_
6 #define CC_PAINT_PAINT_IMAGE_H_ 6 #define CC_PAINT_PAINT_IMAGE_H_
7 7
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "cc/paint/paint_export.h" 9 #include "cc/paint/paint_export.h"
10 #include "third_party/skia/include/core/SkImage.h" 10 #include "third_party/skia/include/core/SkImage.h"
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
48 48
49 bool operator==(const PaintImage& other) const; 49 bool operator==(const PaintImage& other) const;
50 explicit operator bool() const { return sk_image_; } 50 explicit operator bool() const { return sk_image_; }
51 51
52 Id stable_id() const { return id_; } 52 Id stable_id() const { return id_; }
53 const sk_sp<SkImage>& sk_image() const { return sk_image_; } 53 const sk_sp<SkImage>& sk_image() const { return sk_image_; }
54 AnimationType animation_type() const { return animation_type_; } 54 AnimationType animation_type() const { return animation_type_; }
55 CompletionState completion_state() const { return completion_state_; } 55 CompletionState completion_state() const { return completion_state_; }
56 56
57 private: 57 private:
58 // 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
59 // in memory. This is satisfied since it has a default move constructor, and
60 // the same is satisfied by each of its members. But otherwise would need to
61 // ensure it directly or indirectly owns no pointers back to itself.
62 // sk_sp<SkImage> satisfies this since the SkImage does not contain a pointer
63 // to the sk_sp<> itself. The other types are trivial types.
64
58 Id id_ = kUnknownStableId; 65 Id id_ = kUnknownStableId;
59 sk_sp<SkImage> sk_image_; 66 sk_sp<SkImage> sk_image_;
60 AnimationType animation_type_ = AnimationType::UNKNOWN; 67 AnimationType animation_type_ = AnimationType::UNKNOWN;
61 CompletionState completion_state_ = CompletionState::UNKNOWN; 68 CompletionState completion_state_ = CompletionState::UNKNOWN;
62 }; 69 };
63 70
64 } // namespace cc 71 } // namespace cc
65 72
66 #endif // CC_PAINT_PAINT_IMAGE_H_ 73 #endif // CC_PAINT_PAINT_IMAGE_H_
OLDNEW
« 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