Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(342)

Side by Side Diff: src/pathops/SkPathOpsCubic.h

Issue 1037953004: add conics to path ops (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix linux build Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright 2012 Google Inc. 2 * Copyright 2012 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkPathOpsCubic_DEFINED 8 #ifndef SkPathOpsCubic_DEFINED
9 #define SkPathOpsCubic_DEFINED 9 #define SkPathOpsCubic_DEFINED
10 10
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 int findInflections(double tValues[2]) const; 63 int findInflections(double tValues[2]) const;
64 64
65 static int FindInflections(const SkPoint a[kPointCount], double tValues[2]) { 65 static int FindInflections(const SkPoint a[kPointCount], double tValues[2]) {
66 SkDCubic cubic; 66 SkDCubic cubic;
67 cubic.set(a); 67 cubic.set(a);
68 return cubic.findInflections(tValues); 68 return cubic.findInflections(tValues);
69 } 69 }
70 70
71 int findMaxCurvature(double tValues[]) const; 71 int findMaxCurvature(double tValues[]) const;
72 bool hullIntersects(const SkDCubic& c2, bool* isLinear) const; 72 bool hullIntersects(const SkDCubic& c2, bool* isLinear) const;
73 bool hullIntersects(const SkDConic& c, bool* isLinear) const;
74 bool hullIntersects(const SkDQuad& c2, bool* isLinear) const;
75 bool hullIntersects(const SkDPoint* pts, int ptCount, bool* isLinear) const;
73 bool isLinear(int startIndex, int endIndex) const; 76 bool isLinear(int startIndex, int endIndex) const;
74 bool monotonicInY() const; 77 bool monotonicInY() const;
75 void otherPts(int index, const SkDPoint* o1Pts[kPointCount - 1]) const; 78 void otherPts(int index, const SkDPoint* o1Pts[kPointCount - 1]) const;
76 SkDPoint ptAtT(double t) const; 79 SkDPoint ptAtT(double t) const;
77 static int RootsReal(double A, double B, double C, double D, double t[3]); 80 static int RootsReal(double A, double B, double C, double D, double t[3]);
78 static int RootsValidT(const double A, const double B, const double C, doubl e D, double s[3]); 81 static int RootsValidT(const double A, const double B, const double C, doubl e D, double s[3]);
79 82
80 int searchRoots(double extremes[6], int extrema, double axisIntercept, 83 int searchRoots(double extremes[6], int extrema, double axisIntercept,
81 SearchAxis xAxis, double* validRoots) const; 84 SearchAxis xAxis, double* validRoots) const;
82 85
83 void set(const SkPoint pts[kPointCount]) { 86 const SkDCubic& set(const SkPoint pts[kPointCount]) {
84 fPts[0] = pts[0]; 87 fPts[0] = pts[0];
85 fPts[1] = pts[1]; 88 fPts[1] = pts[1];
86 fPts[2] = pts[2]; 89 fPts[2] = pts[2];
87 fPts[3] = pts[3]; 90 fPts[3] = pts[3];
91 return *this;
88 } 92 }
89 93
90 SkDCubic subDivide(double t1, double t2) const; 94 SkDCubic subDivide(double t1, double t2) const;
91 95
92 static SkDCubic SubDivide(const SkPoint a[kPointCount], double t1, double t2 ) { 96 static SkDCubic SubDivide(const SkPoint a[kPointCount], double t1, double t2 ) {
93 SkDCubic cubic; 97 SkDCubic cubic;
94 cubic.set(a); 98 cubic.set(a);
95 return cubic.subDivide(t1, t2); 99 return cubic.subDivide(t1, t2);
96 } 100 }
97 101
(...skipping 26 matching lines...) Expand all
124 returned == 3 for (0, 1), (0, 2), (1, 3), (2, 3) 128 returned == 3 for (0, 1), (0, 2), (1, 3), (2, 3)
125 given that: 129 given that:
126 (0, 3) ^ 2 -> (2, 1) (1, 2) ^ 2 -> (3, 0) 130 (0, 3) ^ 2 -> (2, 1) (1, 2) ^ 2 -> (3, 0)
127 (0, 1) ^ 3 -> (3, 2) (0, 2) ^ 3 -> (3, 1) (1, 3) ^ 3 -> (2, 0) (2, 3) ^ 3 -> (1, 0) 131 (0, 1) ^ 3 -> (3, 2) (0, 2) ^ 3 -> (3, 1) (1, 3) ^ 3 -> (2, 0) (2, 3) ^ 3 -> (1, 0)
128 */ 132 */
129 inline int other_two(int one, int two) { 133 inline int other_two(int one, int two) {
130 return 1 >> (3 - (one ^ two)) ^ 3; 134 return 1 >> (3 - (one ^ two)) ^ 3;
131 } 135 }
132 136
133 #endif 137 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698