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

Side by Side Diff: cc/animation/layer_animation_controller.h

Issue 1806223002: CC Animation: Use bitset instead of unordered_set in LayerAnimationController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Use operator[] Created 4 years, 9 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/animation/layer_animation_controller.cc » ('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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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 #ifndef CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_ 5 #ifndef CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_
6 #define CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_ 6 #define CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_
7 7
8 #include <unordered_set> 8 #include <bitset>
9 #include <vector> 9 #include <vector>
10 10
11 #include "base/macros.h" 11 #include "base/macros.h"
12 #include "base/memory/ref_counted.h" 12 #include "base/memory/ref_counted.h"
13 #include "base/memory/scoped_ptr.h" 13 #include "base/memory/scoped_ptr.h"
14 #include "base/observer_list.h" 14 #include "base/observer_list.h"
15 #include "base/time/time.h" 15 #include "base/time/time.h"
16 #include "cc/animation/animation.h" 16 #include "cc/animation/animation.h"
17 #include "cc/animation/layer_animation_event_observer.h" 17 #include "cc/animation/layer_animation_event_observer.h"
18 #include "cc/animation/target_property.h"
18 #include "cc/base/cc_export.h" 19 #include "cc/base/cc_export.h"
19 #include "ui/gfx/geometry/scroll_offset.h" 20 #include "ui/gfx/geometry/scroll_offset.h"
20 #include "ui/gfx/transform.h" 21 #include "ui/gfx/transform.h"
21 22
22 namespace gfx { 23 namespace gfx {
23 class BoxF; 24 class BoxF;
24 class Transform; 25 class Transform;
25 } 26 }
26 27
27 namespace cc { 28 namespace cc {
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
168 bool needs_to_start_animations_for_testing() { 169 bool needs_to_start_animations_for_testing() {
169 return needs_to_start_animations_; 170 return needs_to_start_animations_;
170 } 171 }
171 172
172 private: 173 private:
173 friend class base::RefCounted<LayerAnimationController>; 174 friend class base::RefCounted<LayerAnimationController>;
174 175
175 explicit LayerAnimationController(int id); 176 explicit LayerAnimationController(int id);
176 ~LayerAnimationController(); 177 ~LayerAnimationController();
177 178
178 using TargetProperties = std::unordered_set<int>; 179 // A set of target properties. TargetProperty must be 0-based enum.
180 using TargetProperties =
181 std::bitset<TargetProperty::LAST_TARGET_PROPERTY + 1>;
179 182
180 void PushNewAnimationsToImplThread( 183 void PushNewAnimationsToImplThread(
181 LayerAnimationController* controller_impl) const; 184 LayerAnimationController* controller_impl) const;
182 void MarkAbortedAnimationsForDeletion( 185 void MarkAbortedAnimationsForDeletion(
183 LayerAnimationController* controller_impl) const; 186 LayerAnimationController* controller_impl) const;
184 void RemoveAnimationsCompletedOnMainThread( 187 void RemoveAnimationsCompletedOnMainThread(
185 LayerAnimationController* controller_impl) const; 188 LayerAnimationController* controller_impl) const;
186 void PushPropertiesToImplThread(LayerAnimationController* controller_impl); 189 void PushPropertiesToImplThread(LayerAnimationController* controller_impl);
187 190
188 void StartAnimations(base::TimeTicks monotonic_time); 191 void StartAnimations(base::TimeTicks monotonic_time);
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after
247 250
248 bool potentially_animating_transform_for_active_observers_; 251 bool potentially_animating_transform_for_active_observers_;
249 bool potentially_animating_transform_for_pending_observers_; 252 bool potentially_animating_transform_for_pending_observers_;
250 253
251 DISALLOW_COPY_AND_ASSIGN(LayerAnimationController); 254 DISALLOW_COPY_AND_ASSIGN(LayerAnimationController);
252 }; 255 };
253 256
254 } // namespace cc 257 } // namespace cc
255 258
256 #endif // CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_ 259 #endif // CC_ANIMATION_LAYER_ANIMATION_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | cc/animation/layer_animation_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698