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

Unified Diff: ui/compositor/layer_animation_element.h

Issue 134453004: Use a bitfield to store animatable properties. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix win build error 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 side-by-side diff with in-line comments
Download patch
Index: ui/compositor/layer_animation_element.h
diff --git a/ui/compositor/layer_animation_element.h b/ui/compositor/layer_animation_element.h
index 1127424087fc015f0a1903a9839d422fb4c3d0e6..edf0a39d52aba4b00a86f4cd023914e0fae183a4 100644
--- a/ui/compositor/layer_animation_element.h
+++ b/ui/compositor/layer_animation_element.h
@@ -28,13 +28,18 @@ class LayerAnimationDelegate;
class COMPOSITOR_EXPORT LayerAnimationElement {
public:
enum AnimatableProperty {
- TRANSFORM = 0,
- BOUNDS,
- OPACITY,
- VISIBILITY,
- BRIGHTNESS,
- GRAYSCALE,
- COLOR,
+ UNKNOWN = 0,
+ TRANSFORM = (1 << 0),
+ BOUNDS = (1 << 1),
+ OPACITY = (1 << 2),
+ VISIBILITY = (1 << 3),
+ BRIGHTNESS = (1 << 4),
+ GRAYSCALE = (1 << 5),
+ COLOR = (1 << 6),
+
+ // Used when iterating over properties.
+ FIRST_PROPERTY = TRANSFORM,
+ SENTINEL = (1 << 7)
};
static AnimatableProperty ToAnimatableProperty(
@@ -54,9 +59,9 @@ class COMPOSITOR_EXPORT LayerAnimationElement {
SkColor color;
};
- typedef std::set<AnimatableProperty> AnimatableProperties;
+ typedef unsigned AnimatableProperties;
sky 2014/01/13 14:26:42 I believe we generally use uint32 for these.
Ian Vollick 2014/01/13 19:03:59 Done.
- LayerAnimationElement(const AnimatableProperties& properties,
+ LayerAnimationElement(AnimatableProperties properties,
base::TimeDelta duration);
virtual ~LayerAnimationElement();
@@ -124,7 +129,7 @@ class COMPOSITOR_EXPORT LayerAnimationElement {
// Creates an element that pauses the given properties. The caller owns the
// return value.
static LayerAnimationElement* CreatePauseElement(
- const AnimatableProperties& properties,
+ AnimatableProperties properties,
base::TimeDelta duration);
// Creates an element that transitions to the given color. The caller owns the
@@ -178,7 +183,7 @@ class COMPOSITOR_EXPORT LayerAnimationElement {
void GetTargetValue(TargetValue* target) const;
// The properties that the element modifies.
- const AnimatableProperties& properties() const { return properties_; }
+ AnimatableProperties properties() const { return properties_; }
// Whether this element animates on the compositor thread.
virtual bool IsThreaded() const;

Powered by Google App Engine
This is Rietveld 408576698