Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / Source / platform / animation / CubicBezierControlPoints.h
blobe82dc19fa3185a4fa187e75de8923e715e44d2c6
1 // Copyright 2015 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.
5 #ifndef CubicBezierControlPoints_h
6 #define CubicBezierControlPoints_h
8 namespace blink {
10 struct CubicBezierControlPoints {
11 double x0, y0;
12 double x1, y1;
13 double x2, y2;
14 double x3, y3;
16 CubicBezierControlPoints()
17 : x0(0)
18 , y0(0)
19 , x1(0)
20 , y1(0)
21 , x2(0)
22 , y2(0)
23 , x3(0)
24 , y3(0)
25 { }
27 CubicBezierControlPoints(double x0, double y0, double x1, double y1,
28 double x2, double y2, double x3, double y3)
29 : x0(x0)
30 , y0(y0)
31 , x1(x1)
32 , y1(y1)
33 , x2(x2)
34 , y2(y2)
35 , x3(x3)
36 , y3(y3)
37 { }
39 void divide(double t, CubicBezierControlPoints& left, CubicBezierControlPoints& right) const;
40 size_t findTurningPoints(double& left, double& right) const;
41 bool findIntersection(double intersectionY, double& intersectionX) const;
43 private:
44 bool findInflexionPoint(double& solution) const;
47 } // namespace blink
49 #endif