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

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

Issue 1107353004: align top and bounds computations (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: clean up code Created 5 years, 7 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
« no previous file with comments | « src/pathops/SkPathOpsOp.cpp ('k') | src/pathops/SkPathOpsQuad.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 SkPathOpsQuad_DEFINED 8 #ifndef SkPathOpsQuad_DEFINED
9 #define SkPathOpsQuad_DEFINED 9 #define SkPathOpsQuad_DEFINED
10 10
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 } 55 }
56 56
57 const SkDPoint& operator[](int n) const { SkASSERT(n >= 0 && n < kPointCount ); return fPts[n]; } 57 const SkDPoint& operator[](int n) const { SkASSERT(n >= 0 && n < kPointCount ); return fPts[n]; }
58 SkDPoint& operator[](int n) { SkASSERT(n >= 0 && n < kPointCount); return fP ts[n]; } 58 SkDPoint& operator[](int n) { SkASSERT(n >= 0 && n < kPointCount); return fP ts[n]; }
59 59
60 static int AddValidTs(double s[], int realRoots, double* t); 60 static int AddValidTs(double s[], int realRoots, double* t);
61 void align(int endIndex, SkDPoint* dstPt) const; 61 void align(int endIndex, SkDPoint* dstPt) const;
62 SkDQuadPair chopAt(double t) const; 62 SkDQuadPair chopAt(double t) const;
63 static bool Clockwise(const SkOpCurve& edge, bool* swap); 63 static bool Clockwise(const SkOpCurve& edge, bool* swap);
64 SkDVector dxdyAtT(double t) const; 64 SkDVector dxdyAtT(double t) const;
65 static int FindExtrema(double a, double b, double c, double tValue[1]); 65 static int FindExtrema(const double src[], double tValue[1]);
66 bool hullIntersects(const SkDQuad& , bool* isLinear) const; 66 bool hullIntersects(const SkDQuad& , bool* isLinear) const;
67 bool hullIntersects(const SkDConic& , bool* isLinear) const; 67 bool hullIntersects(const SkDConic& , bool* isLinear) const;
68 bool hullIntersects(const SkDCubic& , bool* isLinear) const; 68 bool hullIntersects(const SkDCubic& , bool* isLinear) const;
69 bool isLinear(int startIndex, int endIndex) const; 69 bool isLinear(int startIndex, int endIndex) const;
70 bool monotonicInX() const;
70 bool monotonicInY() const; 71 bool monotonicInY() const;
71 double nearestT(const SkDPoint&) const; 72 double nearestT(const SkDPoint&) const;
72 void otherPts(int oddMan, const SkDPoint* endPt[2]) const; 73 void otherPts(int oddMan, const SkDPoint* endPt[2]) const;
73 SkDPoint ptAtT(double t) const; 74 SkDPoint ptAtT(double t) const;
74 static int RootsReal(double A, double B, double C, double t[2]); 75 static int RootsReal(double A, double B, double C, double t[2]);
75 static int RootsValidT(const double A, const double B, const double C, doubl e s[2]); 76 static int RootsValidT(const double A, const double B, const double C, doubl e s[2]);
76 static void SetABC(const double* quad, double* a, double* b, double* c); 77 static void SetABC(const double* quad, double* a, double* b, double* c);
77 SkDQuad subDivide(double t1, double t2) const; 78 SkDQuad subDivide(double t1, double t2) const;
78 static SkDQuad SubDivide(const SkPoint a[kPointCount], double t1, double t2) { 79 static SkDQuad SubDivide(const SkPoint a[kPointCount], double t1, double t2) {
79 SkDQuad quad; 80 SkDQuad quad;
80 quad.set(a); 81 quad.set(a);
81 return quad.subDivide(t1, t2); 82 return quad.subDivide(t1, t2);
82 } 83 }
83 SkDPoint subDivide(const SkDPoint& a, const SkDPoint& c, double t1, double t 2) const; 84 SkDPoint subDivide(const SkDPoint& a, const SkDPoint& c, double t1, double t 2) const;
84 static SkDPoint SubDivide(const SkPoint pts[kPointCount], const SkDPoint& a, const SkDPoint& c, 85 static SkDPoint SubDivide(const SkPoint pts[kPointCount], const SkDPoint& a, const SkDPoint& c,
85 double t1, double t2) { 86 double t1, double t2) {
86 SkDQuad quad; 87 SkDQuad quad;
87 quad.set(pts); 88 quad.set(pts);
88 return quad.subDivide(a, c, t1, t2); 89 return quad.subDivide(a, c, t1, t2);
89 } 90 }
90 SkDConic toConic() const; 91 SkDConic toConic() const;
91 SkDCubic toCubic() const; 92 SkDCubic toCubic() const;
92 SkDPoint top(double startT, double endT, double* topT) const;
93 93
94 // utilities callable by the user from the debugger when the implementation code is linked in 94 // utilities callable by the user from the debugger when the implementation code is linked in
95 void dump() const; 95 void dump() const;
96 void dumpID(int id) const; 96 void dumpID(int id) const;
97 void dumpInner() const; 97 void dumpInner() const;
98 98
99 private: 99 private:
100 // static double Tangent(const double* quadratic, double t); // uncalled 100 // static double Tangent(const double* quadratic, double t); // uncalled
101 }; 101 };
102 102
103 #endif 103 #endif
OLDNEW
« no previous file with comments | « src/pathops/SkPathOpsOp.cpp ('k') | src/pathops/SkPathOpsQuad.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698