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

Side by Side Diff: cc/animation/property_animation_state.cc

Issue 2502663003: CC Animation: Move PropertyAnimationState and TargetProperty to trees. (Closed)
Patch Set: Created 4 years, 1 month 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 | « cc/animation/property_animation_state.h ('k') | cc/animation/target_property.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "cc/animation/property_animation_state.h"
6
7 #include "base/logging.h"
8
9 namespace cc {
10
11 PropertyAnimationState::PropertyAnimationState() {}
12
13 PropertyAnimationState::PropertyAnimationState(
14 const PropertyAnimationState& rhs)
15 : currently_running(rhs.currently_running),
16 potentially_animating(rhs.potentially_animating) {}
17
18 PropertyAnimationState::~PropertyAnimationState() {}
19
20 bool PropertyAnimationState::operator==(
21 const PropertyAnimationState& other) const {
22 return currently_running == other.currently_running &&
23 potentially_animating == other.potentially_animating;
24 }
25
26 bool PropertyAnimationState::operator!=(
27 const PropertyAnimationState& other) const {
28 return !operator==(other);
29 }
30
31 PropertyAnimationState& PropertyAnimationState::operator|=(
32 const PropertyAnimationState& other) {
33 currently_running |= other.currently_running;
34 potentially_animating |= other.potentially_animating;
35
36 return *this;
37 }
38
39 PropertyAnimationState& PropertyAnimationState::operator^=(
40 const PropertyAnimationState& other) {
41 currently_running ^= other.currently_running;
42 potentially_animating ^= other.potentially_animating;
43
44 return *this;
45 }
46
47 PropertyAnimationState& PropertyAnimationState::operator&=(
48 const PropertyAnimationState& other) {
49 currently_running &= other.currently_running;
50 potentially_animating &= other.potentially_animating;
51
52 return *this;
53 }
54
55 PropertyAnimationState operator^(const PropertyAnimationState& lhs,
56 const PropertyAnimationState& rhs) {
57 PropertyAnimationState result = lhs;
58 result ^= rhs;
59 return result;
60 }
61
62 bool PropertyAnimationState::IsValid() const {
63 // currently_running must be a subset for potentially_animating.
64 // currently <= potentially i.e. potentially || !currently.
65 TargetProperties result = potentially_animating | ~currently_running;
66 return result.all();
67 }
68
69 void PropertyAnimationState::Clear() {
70 currently_running.reset();
71 potentially_animating.reset();
72 }
73
74 } // namespace cc
OLDNEW
« no previous file with comments | « cc/animation/property_animation_state.h ('k') | cc/animation/target_property.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698