Allow impl-only animations, and return opacity values via AnimationEvents.
We would like to allow animations to run only on the impl thread, so we need to make sure they don't get clobbered when finished animations are removed. Also, we need a mechanism to allow opacity values to propagate back to the main-thread so that impl-only opacity animations have their values reflected on the main thread when the animation is complete.
BUG=165842
Review URL: https://chromiumcodereview.appspot.com/12453010
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@186725 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/cc/animation_events.h b/cc/animation_events.h
index 69b44bc..41e82e51 100644
--- a/cc/animation_events.h
+++ b/cc/animation_events.h
@@ -8,11 +8,12 @@
#include <vector>
#include "cc/animation.h"
+#include "ui/gfx/transform.h"
namespace cc {
struct AnimationEvent {
- enum Type { Started, Finished };
+ enum Type { Started, Finished, PropertyUpdate };
AnimationEvent(Type type, int layerId, int groupId, Animation::TargetProperty targetProperty, double monotonicTime)
: type(type)
@@ -20,6 +21,7 @@
, groupId(groupId)
, targetProperty(targetProperty)
, monotonicTime(monotonicTime)
+ , opacity(0)
{
}
@@ -28,6 +30,8 @@
int groupId;
Animation::TargetProperty targetProperty;
double monotonicTime;
+ float opacity;
+ gfx::Transform transform;
};
typedef std::vector<AnimationEvent> AnimationEventsVector;