• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef CSSTimingData_h
6 #define CSSTimingData_h
7 
8 #include "platform/animation/TimingFunction.h"
9 #include "platform/heap/Handle.h"
10 #include "wtf/Vector.h"
11 
12 namespace blink {
13 
14 struct Timing;
15 
16 class CSSTimingData : public NoBaseWillBeGarbageCollectedFinalized<CSSTimingData> {
17 public:
~CSSTimingData()18     ~CSSTimingData() { }
19 
trace(Visitor *)20     void trace(Visitor*) { }
21 
delayList()22     const Vector<double>& delayList() const { return m_delayList; }
durationList()23     const Vector<double>& durationList() const { return m_durationList; }
timingFunctionList()24     const Vector<RefPtr<TimingFunction> >& timingFunctionList() const { return m_timingFunctionList; }
25 
delayList()26     Vector<double>& delayList() { return m_delayList; }
durationList()27     Vector<double>& durationList() { return m_durationList; }
timingFunctionList()28     Vector<RefPtr<TimingFunction> >& timingFunctionList() { return m_timingFunctionList; }
29 
initialDelay()30     static double initialDelay() { return 0; }
initialDuration()31     static double initialDuration() { return 0; }
initialTimingFunction()32     static PassRefPtr<TimingFunction> initialTimingFunction() { return CubicBezierTimingFunction::preset(CubicBezierTimingFunction::Ease); }
33 
getRepeated(const Vector<T> & v,size_t index)34     template <class T> static const T& getRepeated(const Vector<T>& v, size_t index) { return v[index % v.size()]; }
35 
36 protected:
37     CSSTimingData();
38     explicit CSSTimingData(const CSSTimingData&);
39 
40     Timing convertToTiming(size_t index) const;
41 
42 private:
43     Vector<double> m_delayList;
44     Vector<double> m_durationList;
45     Vector<RefPtr<TimingFunction> > m_timingFunctionList;
46 };
47 
48 } // namespace blink
49 
50 #endif // CSSTimingData_h
51