OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2008 Apple Inc. All Rights Reserved. | 2 * Copyright (C) 2008 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 12 matching lines...) Expand all Loading... |
23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 23 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
24 */ | 24 */ |
25 | 25 |
26 #ifndef UnitBezier_h | 26 #ifndef UnitBezier_h |
27 #define UnitBezier_h | 27 #define UnitBezier_h |
28 | 28 |
29 #include "platform/PlatformExport.h" | 29 #include "platform/PlatformExport.h" |
30 #include "wtf/Assertions.h" | 30 #include "wtf/Assertions.h" |
31 #include <math.h> | 31 #include <math.h> |
32 | 32 |
33 namespace WebCore { | 33 namespace blink { |
34 | 34 |
35 struct UnitBezier { | 35 struct UnitBezier { |
36 UnitBezier(double p1x, double p1y, double p2x, double p2y) | 36 UnitBezier(double p1x, double p1y, double p2x, double p2y) |
37 { | 37 { |
38 // Calculate the polynomial coefficients, implicit first and last contro
l points are (0,0) and (1,1). | 38 // Calculate the polynomial coefficients, implicit first and last contro
l points are (0,0) and (1,1). |
39 cx = 3.0 * p1x; | 39 cx = 3.0 * p1x; |
40 bx = 3.0 * (p2x - p1x) - cx; | 40 bx = 3.0 * (p2x - p1x) - cx; |
41 ax = 1.0 - cx -bx; | 41 ax = 1.0 - cx -bx; |
42 | 42 |
43 cy = 3.0 * p1y; | 43 cy = 3.0 * p1y; |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
152 double cx; | 152 double cx; |
153 | 153 |
154 double ay; | 154 double ay; |
155 double by; | 155 double by; |
156 double cy; | 156 double cy; |
157 | 157 |
158 double m_startGradient; | 158 double m_startGradient; |
159 double m_endGradient; | 159 double m_endGradient; |
160 }; | 160 }; |
161 | 161 |
162 } // namespace WebCore | 162 } // namespace blink |
163 | 163 |
164 #endif // UnitBezier_h | 164 #endif // UnitBezier_h |
OLD | NEW |