| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2015 Google Inc. | 2 * Copyright 2015 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 SkPathOpsConic_DEFINED | 8 #ifndef SkPathOpsConic_DEFINED |
| 9 #define SkPathOpsConic_DEFINED | 9 #define SkPathOpsConic_DEFINED |
| 10 | 10 |
| (...skipping 13 matching lines...) Expand all Loading... |
| 24 } | 24 } |
| 25 | 25 |
| 26 bool controlsInside() const { | 26 bool controlsInside() const { |
| 27 return fPts.controlsInside(); | 27 return fPts.controlsInside(); |
| 28 } | 28 } |
| 29 | 29 |
| 30 void debugInit() { | 30 void debugInit() { |
| 31 fPts.debugInit(); | 31 fPts.debugInit(); |
| 32 } | 32 } |
| 33 | 33 |
| 34 void debugSet(const SkDPoint* pts, SkScalar weight); |
| 35 |
| 34 SkDConic flip() const { | 36 SkDConic flip() const { |
| 35 SkDConic result = {{{fPts[2], fPts[1], fPts[0]}}, fWeight}; | 37 SkDConic result = {{{fPts[2], fPts[1], fPts[0]} |
| 38 SkDEBUGPARAMS(fPts.fDebugGlobalState) }, fWeight}; |
| 36 return result; | 39 return result; |
| 37 } | 40 } |
| 38 | 41 |
| 42 #ifdef SK_DEBUG |
| 43 SkOpGlobalState* globalState() const { return fPts.globalState(); } |
| 44 #endif |
| 45 |
| 39 static bool IsConic() { return true; } | 46 static bool IsConic() { return true; } |
| 40 | 47 |
| 41 const SkDConic& set(const SkPoint pts[kPointCount], SkScalar weight) { | 48 const SkDConic& set(const SkPoint pts[kPointCount], SkScalar weight |
| 42 fPts.set(pts); | 49 SkDEBUGPARAMS(SkOpGlobalState* state = nullptr)) { |
| 50 fPts.set(pts SkDEBUGPARAMS(state)); |
| 43 fWeight = weight; | 51 fWeight = weight; |
| 44 return *this; | 52 return *this; |
| 45 } | 53 } |
| 46 | 54 |
| 47 const SkDPoint& operator[](int n) const { return fPts[n]; } | 55 const SkDPoint& operator[](int n) const { return fPts[n]; } |
| 48 SkDPoint& operator[](int n) { return fPts[n]; } | 56 SkDPoint& operator[](int n) { return fPts[n]; } |
| 49 | 57 |
| 50 static int AddValidTs(double s[], int realRoots, double* t) { | 58 static int AddValidTs(double s[], int realRoots, double* t) { |
| 51 return SkDQuad::AddValidTs(s, realRoots, t); | 59 return SkDQuad::AddValidTs(s, realRoots, t); |
| 52 } | 60 } |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 double t1, double t2, SkScalar* newWeight) { | 118 double t1, double t2, SkScalar* newWeight) { |
| 111 SkDConic conic; | 119 SkDConic conic; |
| 112 conic.set(pts, weight); | 120 conic.set(pts, weight); |
| 113 return conic.subDivide(a, c, t1, t2, newWeight); | 121 return conic.subDivide(a, c, t1, t2, newWeight); |
| 114 } | 122 } |
| 115 | 123 |
| 116 // utilities callable by the user from the debugger when the implementation
code is linked in | 124 // utilities callable by the user from the debugger when the implementation
code is linked in |
| 117 void dump() const; | 125 void dump() const; |
| 118 void dumpID(int id) const; | 126 void dumpID(int id) const; |
| 119 void dumpInner() const; | 127 void dumpInner() const; |
| 128 |
| 120 }; | 129 }; |
| 121 | 130 |
| 122 | 131 |
| 123 #endif | 132 #endif |
| OLD | NEW |