OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007, 2008, 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2007, 2008, 2012 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * 1. Redistributions of source code must retain the above copyright | 7 * 1. Redistributions of source code must retain the above copyright |
8 * notice, this list of conditions and the following disclaimer. | 8 * notice, this list of conditions and the following disclaimer. |
9 * 2. Redistributions in binary form must reproduce the above copyright | 9 * 2. Redistributions in binary form must reproduce the above copyright |
10 * notice, this list of conditions and the following disclaimer in the | 10 * notice, this list of conditions and the following disclaimer in the |
(...skipping 16 matching lines...) Expand all Loading... |
27 #define CSSTimingFunctionValue_h | 27 #define CSSTimingFunctionValue_h |
28 | 28 |
29 #include "core/css/CSSValue.h" | 29 #include "core/css/CSSValue.h" |
30 #include "platform/animation/TimingFunction.h" | 30 #include "platform/animation/TimingFunction.h" |
31 #include "wtf/PassRefPtr.h" | 31 #include "wtf/PassRefPtr.h" |
32 | 32 |
33 namespace blink { | 33 namespace blink { |
34 | 34 |
35 class CSSCubicBezierTimingFunctionValue : public CSSValue { | 35 class CSSCubicBezierTimingFunctionValue : public CSSValue { |
36 public: | 36 public: |
37 static PassRefPtrWillBeRawPtr<CSSCubicBezierTimingFunctionValue> create(doub
le x1, double y1, double x2, double y2) | 37 static PassRefPtr<CSSCubicBezierTimingFunctionValue> create(double x1, doubl
e y1, double x2, double y2) |
38 { | 38 { |
39 return adoptRefWillBeNoop(new CSSCubicBezierTimingFunctionValue(x1, y1,
x2, y2)); | 39 return adoptRef(new CSSCubicBezierTimingFunctionValue(x1, y1, x2, y2)); |
40 } | 40 } |
41 | 41 |
42 String customCSSText() const; | 42 String customCSSText() const; |
43 | 43 |
44 double x1() const { return m_x1; } | 44 double x1() const { return m_x1; } |
45 double y1() const { return m_y1; } | 45 double y1() const { return m_y1; } |
46 double x2() const { return m_x2; } | 46 double x2() const { return m_x2; } |
47 double y2() const { return m_y2; } | 47 double y2() const { return m_y2; } |
48 | 48 |
49 bool equals(const CSSCubicBezierTimingFunctionValue&) const; | 49 bool equals(const CSSCubicBezierTimingFunctionValue&) const; |
50 | 50 |
51 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { CSSValue::traceAfterDispatch(visitor)
; } | |
52 | |
53 private: | 51 private: |
54 CSSCubicBezierTimingFunctionValue(double x1, double y1, double x2, double y2
) | 52 CSSCubicBezierTimingFunctionValue(double x1, double y1, double x2, double y2
) |
55 : CSSValue(CubicBezierTimingFunctionClass) | 53 : CSSValue(CubicBezierTimingFunctionClass) |
56 , m_x1(x1) | 54 , m_x1(x1) |
57 , m_y1(y1) | 55 , m_y1(y1) |
58 , m_x2(x2) | 56 , m_x2(x2) |
59 , m_y2(y2) | 57 , m_y2(y2) |
60 { | 58 { |
61 } | 59 } |
62 | 60 |
63 double m_x1; | 61 double m_x1; |
64 double m_y1; | 62 double m_y1; |
65 double m_x2; | 63 double m_x2; |
66 double m_y2; | 64 double m_y2; |
67 }; | 65 }; |
68 | 66 |
69 DEFINE_CSS_VALUE_TYPE_CASTS(CSSCubicBezierTimingFunctionValue, isCubicBezierTimi
ngFunctionValue()); | 67 DEFINE_CSS_VALUE_TYPE_CASTS(CSSCubicBezierTimingFunctionValue, isCubicBezierTimi
ngFunctionValue()); |
70 | 68 |
71 class CSSStepsTimingFunctionValue : public CSSValue { | 69 class CSSStepsTimingFunctionValue : public CSSValue { |
72 public: | 70 public: |
73 static PassRefPtrWillBeRawPtr<CSSStepsTimingFunctionValue> create(int steps,
StepsTimingFunction::StepAtPosition stepAtPosition) | 71 static PassRefPtr<CSSStepsTimingFunctionValue> create(int steps, StepsTiming
Function::StepAtPosition stepAtPosition) |
74 { | 72 { |
75 return adoptRefWillBeNoop(new CSSStepsTimingFunctionValue(steps, stepAtP
osition)); | 73 return adoptRef(new CSSStepsTimingFunctionValue(steps, stepAtPosition)); |
76 } | 74 } |
77 | 75 |
78 int numberOfSteps() const { return m_steps; } | 76 int numberOfSteps() const { return m_steps; } |
79 StepsTimingFunction::StepAtPosition stepAtPosition() const { return m_stepAt
Position; } | 77 StepsTimingFunction::StepAtPosition stepAtPosition() const { return m_stepAt
Position; } |
80 | 78 |
81 String customCSSText() const; | 79 String customCSSText() const; |
82 | 80 |
83 bool equals(const CSSStepsTimingFunctionValue&) const; | 81 bool equals(const CSSStepsTimingFunctionValue&) const; |
84 | 82 |
85 DEFINE_INLINE_TRACE_AFTER_DISPATCH() { CSSValue::traceAfterDispatch(visitor)
; } | |
86 | |
87 private: | 83 private: |
88 CSSStepsTimingFunctionValue(int steps, StepsTimingFunction::StepAtPosition s
tepAtPosition) | 84 CSSStepsTimingFunctionValue(int steps, StepsTimingFunction::StepAtPosition s
tepAtPosition) |
89 : CSSValue(StepsTimingFunctionClass) | 85 : CSSValue(StepsTimingFunctionClass) |
90 , m_steps(steps) | 86 , m_steps(steps) |
91 , m_stepAtPosition(stepAtPosition) | 87 , m_stepAtPosition(stepAtPosition) |
92 { | 88 { |
93 } | 89 } |
94 | 90 |
95 int m_steps; | 91 int m_steps; |
96 StepsTimingFunction::StepAtPosition m_stepAtPosition; | 92 StepsTimingFunction::StepAtPosition m_stepAtPosition; |
97 }; | 93 }; |
98 | 94 |
99 DEFINE_CSS_VALUE_TYPE_CASTS(CSSStepsTimingFunctionValue, isStepsTimingFunctionVa
lue()); | 95 DEFINE_CSS_VALUE_TYPE_CASTS(CSSStepsTimingFunctionValue, isStepsTimingFunctionVa
lue()); |
100 | 96 |
101 } // namespace | 97 } // namespace |
102 | 98 |
103 #endif | 99 #endif |
OLD | NEW |