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

Side by Side Diff: ui/compositor/layer_animation_observer.cc

Issue 134453004: Use a bitfield to store animatable properties. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix another win build error (signed/unsigned comp). Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
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 #include "ui/compositor/layer_animation_observer.h" 5 #include "ui/compositor/layer_animation_observer.h"
6 6
7 #include "ui/compositor/layer_animation_sequence.h" 7 #include "ui/compositor/layer_animation_sequence.h"
8 8
9 namespace ui { 9 namespace ui {
10 10
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after
133 void ImplicitAnimationObserver::CheckCompleted() { 133 void ImplicitAnimationObserver::CheckCompleted() {
134 if (active_ && attached_sequences().empty()) { 134 if (active_ && attached_sequences().empty()) {
135 active_ = false; 135 active_ = false;
136 OnImplicitAnimationsCompleted(); 136 OnImplicitAnimationsCompleted();
137 } 137 }
138 } 138 }
139 139
140 void ImplicitAnimationObserver::UpdatePropertyAnimationStatus( 140 void ImplicitAnimationObserver::UpdatePropertyAnimationStatus(
141 LayerAnimationSequence* sequence, 141 LayerAnimationSequence* sequence,
142 AnimationStatus status) { 142 AnimationStatus status) {
143 const LayerAnimationElement::AnimatableProperties& properties = 143 LayerAnimationElement::AnimatableProperties properties =
144 sequence->properties(); 144 sequence->properties();
145 for (LayerAnimationElement::AnimatableProperties::const_iterator i = 145 for (unsigned i = LayerAnimationElement::FIRST_PROPERTY;
146 properties.begin(); i != properties.end(); ++i) { 146 i != LayerAnimationElement::SENTINEL;
147 property_animation_status_[(*i)] = status; 147 i = i << 1) {
148 if (i & properties) {
149 LayerAnimationElement::AnimatableProperty property =
150 static_cast<LayerAnimationElement::AnimatableProperty>(i);
151 property_animation_status_[property] = status;
152 }
148 } 153 }
149 } 154 }
150 155
151 ImplicitAnimationObserver::AnimationStatus 156 ImplicitAnimationObserver::AnimationStatus
152 ImplicitAnimationObserver::AnimationStatusForProperty( 157 ImplicitAnimationObserver::AnimationStatusForProperty(
153 LayerAnimationElement::AnimatableProperty property) const { 158 LayerAnimationElement::AnimatableProperty property) const {
154 PropertyAnimationStatusMap::const_iterator iter = 159 PropertyAnimationStatusMap::const_iterator iter =
155 property_animation_status_.find(property); 160 property_animation_status_.find(property);
156 return iter == property_animation_status_.end() ? ANIMATION_STATUS_UNKNOWN : 161 return iter == property_animation_status_.end() ? ANIMATION_STATUS_UNKNOWN :
157 iter->second; 162 iter->second;
158 } 163 }
159 164
160 } // namespace ui 165 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/layer_animation_element_unittest.cc ('k') | ui/compositor/layer_animation_sequence.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698