summaryrefslogtreecommitdiffstats
path: root/cc/animation_events.h
blob: de1aa886962542fe324fe2b28d4fc3bb6c2ca888 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CC_ANIMATION_EVENTS_H_
#define CC_ANIMATION_EVENTS_H_

#include <vector>

#include "cc/animation.h"
#include "ui/gfx/transform.h"

namespace cc {

struct AnimationEvent {
  enum Type { Started, Finished, PropertyUpdate };

  AnimationEvent(Type type,
                 int layer_id,
                 int group_id,
                 Animation::TargetProperty target_property,
                 double monotonic_time)
      : type(type),
        layer_id(layer_id),
        group_id(group_id),
        target_property(target_property),
        monotonic_time(monotonic_time),
        opacity(0.f) {}

  Type type;
  int layer_id;
  int group_id;
  Animation::TargetProperty target_property;
  double monotonic_time;
  float opacity;
  gfx::Transform transform;
};

typedef std::vector<AnimationEvent> AnimationEventsVector;

}  // namespace cc

#endif  // CC_ANIMATION_EVENTS_H_