OLD | NEW |
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 #include "cc/paint/paint_image.h" | 5 #include "cc/paint/paint_image.h" |
6 #include "base/atomic_sequence_num.h" | 6 #include "base/atomic_sequence_num.h" |
7 | 7 |
8 namespace cc { | 8 namespace cc { |
9 namespace { | 9 namespace { |
10 base::StaticAtomicSequenceNumber s_next_id_; | 10 base::StaticAtomicSequenceNumber s_next_id_; |
11 } | 11 } |
12 | 12 |
13 PaintImage::PaintImage() = default; | 13 PaintImage::PaintImage() = default; |
14 PaintImage::PaintImage(Id id, | 14 PaintImage::PaintImage(Id id, |
15 sk_sp<SkImage> sk_image, | 15 sk_sp<SkImage> sk_image, |
16 AnimationType animation_type, | 16 AnimationType animation_type, |
17 CompletionState completion_state) | 17 CompletionState completion_state) |
18 : id_(id), | 18 : id_(id), |
19 sk_image_(std::move(sk_image)), | 19 sk_image_(std::move(sk_image)), |
20 animation_type_(animation_type), | 20 animation_type_(animation_type), |
21 completion_state_(completion_state) {} | 21 completion_state_(completion_state) {} |
22 PaintImage::PaintImage(const PaintImage& other) = default; | 22 PaintImage::PaintImage(const PaintImage& other) = default; |
23 PaintImage::PaintImage(PaintImage&& other) = default; | 23 PaintImage::PaintImage(PaintImage&& other) = default; |
24 PaintImage::~PaintImage() = default; | 24 PaintImage::~PaintImage() = default; |
25 | 25 |
26 PaintImage& PaintImage::operator=(const PaintImage& other) = default; | 26 PaintImage& PaintImage::operator=(const PaintImage& other) = default; |
27 PaintImage& PaintImage::operator=(PaintImage&& other) = default; | 27 PaintImage& PaintImage::operator=(PaintImage&& other) = default; |
28 | 28 |
29 bool PaintImage::operator==(const PaintImage& other) { | 29 bool PaintImage::operator==(const PaintImage& other) const { |
30 return id_ == other.id_ && sk_image_ == other.sk_image_ && | 30 return id_ == other.id_ && sk_image_ == other.sk_image_ && |
31 animation_type_ == other.animation_type_ && | 31 animation_type_ == other.animation_type_ && |
32 completion_state_ == other.completion_state_; | 32 completion_state_ == other.completion_state_; |
33 } | 33 } |
34 | 34 |
35 PaintImage::Id PaintImage::GetNextId() { | 35 PaintImage::Id PaintImage::GetNextId() { |
36 return s_next_id_.GetNext(); | 36 return s_next_id_.GetNext(); |
37 } | 37 } |
38 | 38 |
39 } // namespace cc | 39 } // namespace cc |
OLD | NEW |