caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014 Google Inc. |
| 3 | * |
| 4 | * Use of this source code is governed by a BSD-style license that can be |
| 5 | * found in the LICENSE file. |
| 6 | */ |
| 7 | |
Cary Clark | f394912 | 2018-08-07 16:38:21 -0400 | [diff] [blame] | 8 | #include "PathOpsDebug.h" |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 9 | #include "PathOpsTSectDebug.h" |
| 10 | #include "SkOpCoincidence.h" |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 11 | #include "SkOpContour.h" |
| 12 | #include "SkIntersectionHelper.h" |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 13 | #include "SkMutex.h" |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 14 | #include "SkOpSegment.h" |
caryclark | 19eb3b2 | 2014-07-18 05:08:14 -0700 | [diff] [blame] | 15 | #include "SkString.h" |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 16 | |
Cary Clark | f394912 | 2018-08-07 16:38:21 -0400 | [diff] [blame] | 17 | bool PathOpsDebug::gJson; |
Cary Clark | da6289c | 2018-08-27 16:10:28 -0400 | [diff] [blame] | 18 | bool PathOpsDebug::gMarkJsonFlaky; |
Cary Clark | f394912 | 2018-08-07 16:38:21 -0400 | [diff] [blame] | 19 | bool PathOpsDebug::gOutFirst; |
Cary Clark | 4533f3d | 2018-08-08 09:48:09 -0400 | [diff] [blame] | 20 | bool PathOpsDebug::gCheckForDuplicateNames; |
Cary Clark | 9c9611f | 2018-08-08 13:17:25 -0400 | [diff] [blame] | 21 | bool PathOpsDebug::gOutputSVG; |
Cary Clark | f394912 | 2018-08-07 16:38:21 -0400 | [diff] [blame] | 22 | FILE* PathOpsDebug::gOut; |
| 23 | |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 24 | inline void DebugDumpDouble(double x) { |
| 25 | if (x == floor(x)) { |
| 26 | SkDebugf("%.0f", x); |
| 27 | } else { |
| 28 | SkDebugf("%1.19g", x); |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | inline void DebugDumpFloat(float x) { |
| 33 | if (x == floorf(x)) { |
| 34 | SkDebugf("%.0f", x); |
| 35 | } else { |
| 36 | SkDebugf("%1.9gf", x); |
| 37 | } |
| 38 | } |
| 39 | |
caryclark | 65f5531 | 2014-11-13 06:58:52 -0800 | [diff] [blame] | 40 | inline void DebugDumpHexFloat(float x) { |
| 41 | SkDebugf("SkBits2Float(0x%08x)", SkFloat2Bits(x)); |
| 42 | } |
caryclark | 19eb3b2 | 2014-07-18 05:08:14 -0700 | [diff] [blame] | 43 | |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 44 | // if not defined by PathOpsDebug.cpp ... |
| 45 | #if !defined SK_DEBUG && FORCE_RELEASE |
| 46 | bool SkPathOpsDebug::ValidWind(int wind) { |
| 47 | return wind > SK_MinS32 + 0xFFFF && wind < SK_MaxS32 - 0xFFFF; |
| 48 | } |
| 49 | |
| 50 | void SkPathOpsDebug::WindingPrintf(int wind) { |
| 51 | if (wind == SK_MinS32) { |
| 52 | SkDebugf("?"); |
| 53 | } else { |
| 54 | SkDebugf("%d", wind); |
| 55 | } |
| 56 | } |
| 57 | #endif |
| 58 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 59 | static void DumpID(int id) { |
| 60 | SkDebugf("} "); |
| 61 | if (id >= 0) { |
| 62 | SkDebugf("id=%d", id); |
| 63 | } |
| 64 | SkDebugf("\n"); |
| 65 | } |
| 66 | |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 67 | void SkDConic::dump() const { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 68 | dumpInner(); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 69 | SkDebugf("},\n"); |
| 70 | } |
| 71 | |
| 72 | void SkDConic::dumpID(int id) const { |
| 73 | dumpInner(); |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 74 | DumpID(id); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 75 | } |
| 76 | |
| 77 | void SkDConic::dumpInner() const { |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 78 | SkDebugf("{"); |
| 79 | fPts.dumpInner(); |
| 80 | SkDebugf("}}, %1.9gf", fWeight); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 81 | } |
| 82 | |
| 83 | void SkDCubic::dump() const { |
| 84 | this->dumpInner(); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 85 | SkDebugf("}},\n"); |
reed | 0dc4dd6 | 2015-03-24 13:55:33 -0700 | [diff] [blame] | 86 | } |
| 87 | |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 88 | void SkDCubic::dumpID(int id) const { |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 89 | this->dumpInner(); |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 90 | SkDebugf("}"); |
| 91 | DumpID(id); |
reed | 0dc4dd6 | 2015-03-24 13:55:33 -0700 | [diff] [blame] | 92 | } |
| 93 | |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 94 | static inline bool double_is_NaN(double x) { return x != x; } |
| 95 | |
| 96 | void SkDCubic::dumpInner() const { |
| 97 | SkDebugf("{{"); |
| 98 | int index = 0; |
reed | 0dc4dd6 | 2015-03-24 13:55:33 -0700 | [diff] [blame] | 99 | do { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 100 | if (index != 0) { |
| 101 | if (double_is_NaN(fPts[index].fX) && double_is_NaN(fPts[index].fY)) { |
| 102 | return; |
reed | 0dc4dd6 | 2015-03-24 13:55:33 -0700 | [diff] [blame] | 103 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 104 | SkDebugf(", "); |
reed | 0dc4dd6 | 2015-03-24 13:55:33 -0700 | [diff] [blame] | 105 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 106 | fPts[index].dump(); |
| 107 | } while (++index < 3); |
| 108 | if (double_is_NaN(fPts[index].fX) && double_is_NaN(fPts[index].fY)) { |
reed | 0dc4dd6 | 2015-03-24 13:55:33 -0700 | [diff] [blame] | 109 | return; |
| 110 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 111 | SkDebugf(", "); |
reed | 0dc4dd6 | 2015-03-24 13:55:33 -0700 | [diff] [blame] | 112 | fPts[index].dump(); |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 113 | } |
| 114 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 115 | void SkDCurve::dump() const { |
| 116 | dumpID(-1); |
| 117 | } |
| 118 | |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 119 | void SkDCurve::dumpID(int id) const { |
| 120 | #ifndef SK_RELEASE |
| 121 | switch(fVerb) { |
| 122 | case SkPath::kLine_Verb: |
| 123 | fLine.dumpID(id); |
| 124 | break; |
| 125 | case SkPath::kQuad_Verb: |
| 126 | fQuad.dumpID(id); |
| 127 | break; |
| 128 | case SkPath::kConic_Verb: |
| 129 | fConic.dumpID(id); |
| 130 | break; |
| 131 | case SkPath::kCubic_Verb: |
| 132 | fCubic.dumpID(id); |
| 133 | break; |
| 134 | default: |
| 135 | SkASSERT(0); |
| 136 | } |
| 137 | #else |
| 138 | fCubic.dumpID(id); |
| 139 | #endif |
| 140 | } |
| 141 | |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 142 | void SkDLine::dump() const { |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 143 | this->dumpInner(); |
| 144 | SkDebugf("}},\n"); |
| 145 | } |
| 146 | |
| 147 | void SkDLine::dumpID(int id) const { |
| 148 | this->dumpInner(); |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 149 | SkDebugf("}"); |
| 150 | DumpID(id); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 151 | } |
| 152 | |
| 153 | void SkDLine::dumpInner() const { |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 154 | SkDebugf("{{"); |
| 155 | fPts[0].dump(); |
| 156 | SkDebugf(", "); |
| 157 | fPts[1].dump(); |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 158 | } |
| 159 | |
| 160 | void SkDPoint::dump() const { |
| 161 | SkDebugf("{"); |
| 162 | DebugDumpDouble(fX); |
| 163 | SkDebugf(", "); |
| 164 | DebugDumpDouble(fY); |
| 165 | SkDebugf("}"); |
| 166 | } |
| 167 | |
| 168 | void SkDPoint::Dump(const SkPoint& pt) { |
| 169 | SkDebugf("{"); |
| 170 | DebugDumpFloat(pt.fX); |
| 171 | SkDebugf(", "); |
| 172 | DebugDumpFloat(pt.fY); |
| 173 | SkDebugf("}"); |
| 174 | } |
| 175 | |
caryclark | 65f5531 | 2014-11-13 06:58:52 -0800 | [diff] [blame] | 176 | void SkDPoint::DumpHex(const SkPoint& pt) { |
| 177 | SkDebugf("{"); |
| 178 | DebugDumpHexFloat(pt.fX); |
| 179 | SkDebugf(", "); |
| 180 | DebugDumpHexFloat(pt.fY); |
| 181 | SkDebugf("}"); |
| 182 | } |
| 183 | |
| 184 | void SkDQuad::dump() const { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 185 | dumpInner(); |
| 186 | SkDebugf("}},\n"); |
caryclark | 65f5531 | 2014-11-13 06:58:52 -0800 | [diff] [blame] | 187 | } |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 188 | |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 189 | void SkDQuad::dumpID(int id) const { |
| 190 | dumpInner(); |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 191 | SkDebugf("}"); |
| 192 | DumpID(id); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 193 | } |
| 194 | |
| 195 | void SkDQuad::dumpInner() const { |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 196 | SkDebugf("{{"); |
| 197 | int index = 0; |
| 198 | do { |
| 199 | fPts[index].dump(); |
| 200 | SkDebugf(", "); |
| 201 | } while (++index < 2); |
| 202 | fPts[index].dump(); |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 203 | } |
| 204 | |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 205 | void SkIntersections::dump() const { |
| 206 | SkDebugf("used=%d of %d", fUsed, fMax); |
| 207 | for (int index = 0; index < fUsed; ++index) { |
| 208 | SkDebugf(" t=(%s%1.9g,%s%1.9g) pt=(%1.9g,%1.9g)", |
| 209 | fIsCoincident[0] & (1 << index) ? "*" : "", fT[0][index], |
| 210 | fIsCoincident[1] & (1 << index) ? "*" : "", fT[1][index], |
| 211 | fPt[index].fX, fPt[index].fY); |
| 212 | if (index < 2 && fNearlySame[index]) { |
| 213 | SkDebugf(" pt2=(%1.9g,%1.9g)",fPt2[index].fX, fPt2[index].fY); |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 214 | } |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 215 | } |
| 216 | SkDebugf("\n"); |
| 217 | } |
| 218 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 219 | namespace SkOpDebug { |
| 220 | |
| 221 | const ::SkOpAngle* AngleAngle(const ::SkOpAngle* angle, int id) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 222 | return angle->debugAngle(id); |
| 223 | } |
| 224 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 225 | ::SkOpContour* AngleContour(::SkOpAngle* angle, int id) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 226 | return angle->debugContour(id); |
| 227 | } |
| 228 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 229 | const ::SkOpPtT* AnglePtT(const ::SkOpAngle* angle, int id) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 230 | return angle->debugPtT(id); |
| 231 | } |
| 232 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 233 | const ::SkOpSegment* AngleSegment(const ::SkOpAngle* angle, int id) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 234 | return angle->debugSegment(id); |
| 235 | } |
| 236 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 237 | const ::SkOpSpanBase* AngleSpan(const ::SkOpAngle* angle, int id) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 238 | return angle->debugSpan(id); |
| 239 | } |
| 240 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 241 | const ::SkOpAngle* ContourAngle(::SkOpContour* contour, int id) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 242 | return contour->debugAngle(id); |
| 243 | } |
| 244 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 245 | ::SkOpContour* ContourContour(::SkOpContour* contour, int id) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 246 | return contour->debugContour(id); |
| 247 | } |
| 248 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 249 | const ::SkOpPtT* ContourPtT(::SkOpContour* contour, int id) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 250 | return contour->debugPtT(id); |
| 251 | } |
| 252 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 253 | const ::SkOpSegment* ContourSegment(::SkOpContour* contour, int id) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 254 | return contour->debugSegment(id); |
| 255 | } |
| 256 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 257 | const ::SkOpSpanBase* ContourSpan(::SkOpContour* contour, int id) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 258 | return contour->debugSpan(id); |
| 259 | } |
| 260 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 261 | const ::SkOpAngle* CoincidenceAngle(::SkOpCoincidence* coin, int id) { |
caryclark | 27c8eb8 | 2015-07-06 11:38:33 -0700 | [diff] [blame] | 262 | return coin->debugAngle(id); |
| 263 | } |
| 264 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 265 | ::SkOpContour* CoincidenceContour(::SkOpCoincidence* coin, int id) { |
caryclark | 27c8eb8 | 2015-07-06 11:38:33 -0700 | [diff] [blame] | 266 | return coin->debugContour(id); |
| 267 | } |
| 268 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 269 | const ::SkOpPtT* CoincidencePtT(::SkOpCoincidence* coin, int id) { |
caryclark | 27c8eb8 | 2015-07-06 11:38:33 -0700 | [diff] [blame] | 270 | return coin->debugPtT(id); |
| 271 | } |
| 272 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 273 | const ::SkOpSegment* CoincidenceSegment(::SkOpCoincidence* coin, int id) { |
caryclark | 27c8eb8 | 2015-07-06 11:38:33 -0700 | [diff] [blame] | 274 | return coin->debugSegment(id); |
| 275 | } |
| 276 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 277 | const ::SkOpSpanBase* CoincidenceSpan(::SkOpCoincidence* coin, int id) { |
caryclark | 27c8eb8 | 2015-07-06 11:38:33 -0700 | [diff] [blame] | 278 | return coin->debugSpan(id); |
| 279 | } |
| 280 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 281 | const ::SkOpAngle* PtTAngle(const ::SkOpPtT* ptT, int id) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 282 | return ptT->debugAngle(id); |
| 283 | } |
| 284 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 285 | ::SkOpContour* PtTContour(::SkOpPtT* ptT, int id) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 286 | return ptT->debugContour(id); |
| 287 | } |
| 288 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 289 | const ::SkOpPtT* PtTPtT(const ::SkOpPtT* ptT, int id) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 290 | return ptT->debugPtT(id); |
| 291 | } |
| 292 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 293 | const ::SkOpSegment* PtTSegment(const ::SkOpPtT* ptT, int id) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 294 | return ptT->debugSegment(id); |
| 295 | } |
| 296 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 297 | const ::SkOpSpanBase* PtTSpan(const ::SkOpPtT* ptT, int id) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 298 | return ptT->debugSpan(id); |
| 299 | } |
| 300 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 301 | const ::SkOpAngle* SegmentAngle(const ::SkOpSegment* span, int id) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 302 | return span->debugAngle(id); |
| 303 | } |
| 304 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 305 | ::SkOpContour* SegmentContour(::SkOpSegment* span, int id) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 306 | return span->debugContour(id); |
| 307 | } |
| 308 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 309 | const ::SkOpPtT* SegmentPtT(const ::SkOpSegment* span, int id) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 310 | return span->debugPtT(id); |
| 311 | } |
| 312 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 313 | const ::SkOpSegment* SegmentSegment(const ::SkOpSegment* span, int id) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 314 | return span->debugSegment(id); |
| 315 | } |
| 316 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 317 | const ::SkOpSpanBase* SegmentSpan(const ::SkOpSegment* span, int id) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 318 | return span->debugSpan(id); |
| 319 | } |
| 320 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 321 | const ::SkOpAngle* SpanAngle(const ::SkOpSpanBase* span, int id) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 322 | return span->debugAngle(id); |
| 323 | } |
| 324 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 325 | ::SkOpContour* SpanContour(::SkOpSpanBase* span, int id) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 326 | return span->debugContour(id); |
| 327 | } |
| 328 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 329 | const ::SkOpPtT* SpanPtT(const ::SkOpSpanBase* span, int id) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 330 | return span->debugPtT(id); |
| 331 | } |
| 332 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 333 | const ::SkOpSegment* SpanSegment(const ::SkOpSpanBase* span, int id) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 334 | return span->debugSegment(id); |
| 335 | } |
| 336 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 337 | const ::SkOpSpanBase* SpanSpan(const ::SkOpSpanBase* span, int id) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 338 | return span->debugSpan(id); |
| 339 | } |
| 340 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 341 | } // namespace SkPathOpsDebug |
| 342 | |
Cary Clark | ab87d7a | 2016-10-04 10:01:04 -0400 | [diff] [blame] | 343 | #if DEBUG_COIN |
| 344 | void SkPathOpsDebug::DumpCoinDict() { |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 345 | SkPathOpsDebug::gCoinSumChangedDict.dump("unused coin algorithm", false); |
| 346 | SkPathOpsDebug::gCoinSumVisitedDict.dump("visited coin function", true); |
Cary Clark | ab87d7a | 2016-10-04 10:01:04 -0400 | [diff] [blame] | 347 | } |
| 348 | |
| 349 | void SkPathOpsDebug::CoinDict::dump(const char* str, bool visitCheck) const { |
| 350 | int count = fDict.count(); |
| 351 | for (int index = 0; index < count; ++index) { |
| 352 | const auto& entry = fDict[index]; |
| 353 | if (visitCheck || entry.fGlitchType == kUninitialized_Glitch) { |
| 354 | SkDebugf("%s %s : line %d iteration %d", str, entry.fFunctionName, |
| 355 | entry.fLineNumber, entry.fIteration); |
| 356 | DumpGlitchType(entry.fGlitchType); |
| 357 | SkDebugf("\n"); |
| 358 | } |
| 359 | } |
| 360 | } |
| 361 | #endif |
| 362 | |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 363 | void SkOpContour::dumpContours() const { |
| 364 | SkOpContour* contour = this->globalState()->contourHead(); |
| 365 | do { |
| 366 | contour->dump(); |
| 367 | } while ((contour = contour->next())); |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 368 | } |
| 369 | |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 370 | void SkOpContour::dumpContoursAll() const { |
| 371 | SkOpContour* contour = this->globalState()->contourHead(); |
| 372 | do { |
| 373 | contour->dumpAll(); |
| 374 | } while ((contour = contour->next())); |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 375 | } |
| 376 | |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 377 | void SkOpContour::dumpContoursAngles() const { |
| 378 | SkOpContour* contour = this->globalState()->contourHead(); |
| 379 | do { |
| 380 | contour->dumpAngles(); |
| 381 | } while ((contour = contour->next())); |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 382 | } |
| 383 | |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 384 | void SkOpContour::dumpContoursPts() const { |
| 385 | SkOpContour* contour = this->globalState()->contourHead(); |
| 386 | do { |
| 387 | contour->dumpPts(); |
| 388 | } while ((contour = contour->next())); |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 389 | } |
| 390 | |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 391 | void SkOpContour::dumpContoursPt(int segmentID) const { |
| 392 | SkOpContour* contour = this->globalState()->contourHead(); |
| 393 | do { |
| 394 | contour->dumpPt(segmentID); |
| 395 | } while ((contour = contour->next())); |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 396 | } |
| 397 | |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 398 | void SkOpContour::dumpContoursSegment(int segmentID) const { |
| 399 | SkOpContour* contour = this->globalState()->contourHead(); |
| 400 | do { |
| 401 | contour->dumpSegment(segmentID); |
| 402 | } while ((contour = contour->next())); |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 403 | } |
| 404 | |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 405 | void SkOpContour::dumpContoursSpan(int spanID) const { |
| 406 | SkOpContour* contour = this->globalState()->contourHead(); |
| 407 | do { |
| 408 | contour->dumpSpan(spanID); |
| 409 | } while ((contour = contour->next())); |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 410 | } |
| 411 | |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 412 | void SkOpContour::dumpContoursSpans() const { |
| 413 | SkOpContour* contour = this->globalState()->contourHead(); |
| 414 | do { |
| 415 | contour->dumpSpans(); |
| 416 | } while ((contour = contour->next())); |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 417 | } |
| 418 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 419 | template <typename TCurve, typename OppCurve> |
| 420 | const SkTSpan<TCurve, OppCurve>* DebugSpan(const SkTSect<TCurve, OppCurve>* sect, int id) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 421 | return sect->debugSpan(id); |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 422 | } |
| 423 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 424 | void DontCallDebugSpan(int id); |
| 425 | void DontCallDebugSpan(int id) { // exists to instantiate the templates |
| 426 | #if !PATH_OP_COMPILE_FOR_SIZE |
| 427 | SkDQuad quad; |
| 428 | SkDConic conic; |
| 429 | SkDCubic cubic; |
| 430 | SkTSect<SkDQuad, SkDQuad> q1q2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 431 | SkTSect<SkDQuad, SkDConic> q1k2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 432 | SkTSect<SkDQuad, SkDCubic> q1c2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 433 | SkTSect<SkDConic, SkDQuad> k1q2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 434 | SkTSect<SkDConic, SkDConic> k1k2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 435 | SkTSect<SkDConic, SkDCubic> k1c2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 436 | SkTSect<SkDCubic, SkDQuad> c1q2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 437 | SkTSect<SkDCubic, SkDConic> c1k2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 438 | SkTSect<SkDCubic, SkDCubic> c1c2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 439 | DebugSpan(&q1q2, id); |
| 440 | DebugSpan(&q1k2, id); |
| 441 | DebugSpan(&q1c2, id); |
| 442 | DebugSpan(&k1q2, id); |
| 443 | DebugSpan(&k1k2, id); |
| 444 | DebugSpan(&k1c2, id); |
| 445 | DebugSpan(&c1q2, id); |
| 446 | DebugSpan(&c1k2, id); |
| 447 | DebugSpan(&c1c2, id); |
| 448 | #endif |
| 449 | } |
| 450 | |
| 451 | template <typename TCurve, typename OppCurve> |
| 452 | const SkTSpan<TCurve, OppCurve>* DebugT(const SkTSect<TCurve, OppCurve>* sect, double t) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 453 | return sect->debugT(t); |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 454 | } |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 455 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 456 | void DontCallDebugT(double t); |
| 457 | void DontCallDebugT(double t) { // exists to instantiate the templates |
| 458 | #if !PATH_OP_COMPILE_FOR_SIZE |
| 459 | SkDQuad quad; |
| 460 | SkDConic conic; |
| 461 | SkDCubic cubic; |
| 462 | SkTSect<SkDQuad, SkDQuad> q1q2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 463 | SkTSect<SkDQuad, SkDConic> q1k2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 464 | SkTSect<SkDQuad, SkDCubic> q1c2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 465 | SkTSect<SkDConic, SkDQuad> k1q2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 466 | SkTSect<SkDConic, SkDConic> k1k2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 467 | SkTSect<SkDConic, SkDCubic> k1c2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 468 | SkTSect<SkDCubic, SkDQuad> c1q2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 469 | SkTSect<SkDCubic, SkDConic> c1k2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 470 | SkTSect<SkDCubic, SkDCubic> c1c2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 471 | DebugT(&q1q2, t); |
| 472 | DebugT(&q1k2, t); |
| 473 | DebugT(&q1c2, t); |
| 474 | DebugT(&k1q2, t); |
| 475 | DebugT(&k1k2, t); |
| 476 | DebugT(&k1c2, t); |
| 477 | DebugT(&c1q2, t); |
| 478 | DebugT(&c1k2, t); |
| 479 | DebugT(&c1c2, t); |
| 480 | #endif |
| 481 | } |
| 482 | |
| 483 | template <typename TCurve, typename OppCurve> |
| 484 | void Dump(const SkTSect<TCurve, OppCurve>* sect) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 485 | sect->dump(); |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 486 | } |
| 487 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 488 | void DontCallDumpTSect(); |
| 489 | void DontCallDumpTSect() { // exists to instantiate the templates |
| 490 | #if !PATH_OP_COMPILE_FOR_SIZE |
| 491 | SkDQuad quad; |
| 492 | SkDConic conic; |
| 493 | SkDCubic cubic; |
| 494 | SkTSect<SkDQuad, SkDQuad> q1q2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 495 | SkTSect<SkDQuad, SkDConic> q1k2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 496 | SkTSect<SkDQuad, SkDCubic> q1c2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 497 | SkTSect<SkDConic, SkDQuad> k1q2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 498 | SkTSect<SkDConic, SkDConic> k1k2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 499 | SkTSect<SkDConic, SkDCubic> k1c2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 500 | SkTSect<SkDCubic, SkDQuad> c1q2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 501 | SkTSect<SkDCubic, SkDConic> c1k2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 502 | SkTSect<SkDCubic, SkDCubic> c1c2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 503 | Dump(&q1q2); |
| 504 | Dump(&q1k2); |
| 505 | Dump(&q1c2); |
| 506 | Dump(&k1q2); |
| 507 | Dump(&k1k2); |
| 508 | Dump(&k1c2); |
| 509 | Dump(&c1q2); |
| 510 | Dump(&c1k2); |
| 511 | Dump(&c1c2); |
| 512 | #endif |
| 513 | } |
| 514 | |
| 515 | template <typename TCurve, typename OppCurve> |
| 516 | void DumpBoth(SkTSect<TCurve, OppCurve>* sect1, SkTSect<OppCurve, TCurve>* sect2) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 517 | sect1->dumpBoth(sect2); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 518 | } |
| 519 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 520 | void DontCallDumpBoth(); |
| 521 | void DontCallDumpBoth() { // exists to instantiate the templates |
| 522 | #if !PATH_OP_COMPILE_FOR_SIZE |
| 523 | SkDQuad quad; |
| 524 | SkDConic conic; |
| 525 | SkDCubic cubic; |
| 526 | SkTSect<SkDQuad, SkDQuad> q1q2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 527 | SkTSect<SkDQuad, SkDConic> q1k2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 528 | SkTSect<SkDQuad, SkDCubic> q1c2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 529 | SkTSect<SkDConic, SkDQuad> k1q2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 530 | SkTSect<SkDConic, SkDConic> k1k2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 531 | SkTSect<SkDConic, SkDCubic> k1c2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 532 | SkTSect<SkDCubic, SkDQuad> c1q2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 533 | SkTSect<SkDCubic, SkDConic> c1k2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 534 | SkTSect<SkDCubic, SkDCubic> c1c2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 535 | DumpBoth(&q1q2, &q1q2); |
| 536 | DumpBoth(&q1k2, &k1q2); |
| 537 | DumpBoth(&q1c2, &c1q2); |
| 538 | DumpBoth(&k1q2, &q1k2); |
| 539 | DumpBoth(&k1k2, &k1k2); |
| 540 | DumpBoth(&k1c2, &c1k2); |
| 541 | DumpBoth(&c1q2, &q1c2); |
| 542 | DumpBoth(&c1k2, &k1c2); |
| 543 | DumpBoth(&c1c2, &c1c2); |
| 544 | #endif |
| 545 | } |
| 546 | |
| 547 | template <typename TCurve, typename OppCurve> |
| 548 | void DumpBounded(SkTSect<TCurve, OppCurve>* sect1, int id) { |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 549 | sect1->dumpBounded(id); |
| 550 | } |
| 551 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 552 | void DontCallDumpBounded(); |
| 553 | void DontCallDumpBounded() { |
| 554 | #if !PATH_OP_COMPILE_FOR_SIZE |
| 555 | SkDQuad quad; |
| 556 | SkDConic conic; |
| 557 | SkDCubic cubic; |
| 558 | SkTSect<SkDQuad, SkDQuad> q1q2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 559 | SkTSect<SkDQuad, SkDConic> q1k2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 560 | SkTSect<SkDQuad, SkDCubic> q1c2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 561 | SkTSect<SkDConic, SkDQuad> k1q2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 562 | SkTSect<SkDConic, SkDConic> k1k2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 563 | SkTSect<SkDConic, SkDCubic> k1c2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 564 | SkTSect<SkDCubic, SkDQuad> c1q2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 565 | SkTSect<SkDCubic, SkDConic> c1k2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 566 | SkTSect<SkDCubic, SkDCubic> c1c2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 567 | DumpBounded(&q1q2, 0); |
| 568 | DumpBounded(&q1k2, 0); |
| 569 | DumpBounded(&q1c2, 0); |
| 570 | DumpBounded(&k1q2, 0); |
| 571 | DumpBounded(&k1k2, 0); |
| 572 | DumpBounded(&k1c2, 0); |
| 573 | DumpBounded(&c1q2, 0); |
| 574 | DumpBounded(&c1k2, 0); |
| 575 | DumpBounded(&c1c2, 0); |
| 576 | #endif |
| 577 | } |
| 578 | |
| 579 | template <typename TCurve, typename OppCurve> |
| 580 | void DumpBounds(SkTSect<TCurve, OppCurve>* sect1) { |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 581 | sect1->dumpBounds(); |
| 582 | } |
| 583 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 584 | void DontCallDumpBounds(); |
| 585 | void DontCallDumpBounds() { |
| 586 | #if !PATH_OP_COMPILE_FOR_SIZE |
| 587 | SkDQuad quad; |
| 588 | SkDConic conic; |
| 589 | SkDCubic cubic; |
| 590 | SkTSect<SkDQuad, SkDQuad> q1q2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 591 | SkTSect<SkDQuad, SkDConic> q1k2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 592 | SkTSect<SkDQuad, SkDCubic> q1c2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 593 | SkTSect<SkDConic, SkDQuad> k1q2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 594 | SkTSect<SkDConic, SkDConic> k1k2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 595 | SkTSect<SkDConic, SkDCubic> k1c2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 596 | SkTSect<SkDCubic, SkDQuad> c1q2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 597 | SkTSect<SkDCubic, SkDConic> c1k2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 598 | SkTSect<SkDCubic, SkDCubic> c1c2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 599 | DumpBounds(&q1q2); |
| 600 | DumpBounds(&q1k2); |
| 601 | DumpBounds(&q1c2); |
| 602 | DumpBounds(&k1q2); |
| 603 | DumpBounds(&k1k2); |
| 604 | DumpBounds(&k1c2); |
| 605 | DumpBounds(&c1q2); |
| 606 | DumpBounds(&c1k2); |
| 607 | DumpBounds(&c1c2); |
| 608 | #endif |
| 609 | } |
| 610 | |
| 611 | template <typename TCurve, typename OppCurve> |
| 612 | void DumpCoin(SkTSect<TCurve, OppCurve>* sect1) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 613 | sect1->dumpCoin(); |
caryclark | dac1d17 | 2014-06-17 05:15:38 -0700 | [diff] [blame] | 614 | } |
| 615 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 616 | void DontCallDumpCoin(); |
| 617 | void DontCallDumpCoin() { // exists to instantiate the templates |
| 618 | #if !PATH_OP_COMPILE_FOR_SIZE |
| 619 | SkDQuad quad; |
| 620 | SkDConic conic; |
| 621 | SkDCubic cubic; |
| 622 | SkTSect<SkDQuad, SkDQuad> q1q2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 623 | SkTSect<SkDQuad, SkDConic> q1k2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 624 | SkTSect<SkDQuad, SkDCubic> q1c2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 625 | SkTSect<SkDConic, SkDQuad> k1q2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 626 | SkTSect<SkDConic, SkDConic> k1k2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 627 | SkTSect<SkDConic, SkDCubic> k1c2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 628 | SkTSect<SkDCubic, SkDQuad> c1q2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 629 | SkTSect<SkDCubic, SkDConic> c1k2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 630 | SkTSect<SkDCubic, SkDCubic> c1c2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 631 | DumpCoin(&q1q2); |
| 632 | DumpCoin(&q1k2); |
| 633 | DumpCoin(&q1c2); |
| 634 | DumpCoin(&k1q2); |
| 635 | DumpCoin(&k1k2); |
| 636 | DumpCoin(&k1c2); |
| 637 | DumpCoin(&c1q2); |
| 638 | DumpCoin(&c1k2); |
| 639 | DumpCoin(&c1c2); |
| 640 | #endif |
| 641 | } |
| 642 | |
| 643 | template <typename TCurve, typename OppCurve> |
| 644 | void DumpCoinCurves(SkTSect<TCurve, OppCurve>* sect1) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 645 | sect1->dumpCoinCurves(); |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 646 | } |
| 647 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 648 | void DontCallDumpCoinCurves(); |
| 649 | void DontCallDumpCoinCurves() { // exists to instantiate the templates |
| 650 | #if !PATH_OP_COMPILE_FOR_SIZE |
| 651 | SkDQuad quad; |
| 652 | SkDConic conic; |
| 653 | SkDCubic cubic; |
| 654 | SkTSect<SkDQuad, SkDQuad> q1q2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 655 | SkTSect<SkDQuad, SkDConic> q1k2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 656 | SkTSect<SkDQuad, SkDCubic> q1c2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 657 | SkTSect<SkDConic, SkDQuad> k1q2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 658 | SkTSect<SkDConic, SkDConic> k1k2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 659 | SkTSect<SkDConic, SkDCubic> k1c2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 660 | SkTSect<SkDCubic, SkDQuad> c1q2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 661 | SkTSect<SkDCubic, SkDConic> c1k2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 662 | SkTSect<SkDCubic, SkDCubic> c1c2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 663 | DumpCoinCurves(&q1q2); |
| 664 | DumpCoinCurves(&q1k2); |
| 665 | DumpCoinCurves(&q1c2); |
| 666 | DumpCoinCurves(&k1q2); |
| 667 | DumpCoinCurves(&k1k2); |
| 668 | DumpCoinCurves(&k1c2); |
| 669 | DumpCoinCurves(&c1q2); |
| 670 | DumpCoinCurves(&c1k2); |
| 671 | DumpCoinCurves(&c1c2); |
| 672 | #endif |
| 673 | } |
| 674 | |
| 675 | template <typename TCurve, typename OppCurve> |
| 676 | void DumpCurves(const SkTSect<TCurve, OppCurve>* sect) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 677 | sect->dumpCurves(); |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 678 | } |
| 679 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 680 | void DontCallDumpCurves(); |
| 681 | void DontCallDumpCurves() { // exists to instantiate the templates |
| 682 | #if !PATH_OP_COMPILE_FOR_SIZE |
| 683 | SkDQuad quad; |
| 684 | SkDConic conic; |
| 685 | SkDCubic cubic; |
| 686 | SkTSect<SkDQuad, SkDQuad> q1q2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 687 | SkTSect<SkDQuad, SkDConic> q1k2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 688 | SkTSect<SkDQuad, SkDCubic> q1c2(quad SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 689 | SkTSect<SkDConic, SkDQuad> k1q2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 690 | SkTSect<SkDConic, SkDConic> k1k2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 691 | SkTSect<SkDConic, SkDCubic> k1c2(conic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 692 | SkTSect<SkDCubic, SkDQuad> c1q2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 693 | SkTSect<SkDCubic, SkDConic> c1k2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 694 | SkTSect<SkDCubic, SkDCubic> c1c2(cubic SkDEBUGPARAMS(nullptr) PATH_OPS_DEBUG_T_SECT_PARAMS(1)); |
| 695 | DumpCurves(&q1q2); |
| 696 | DumpCurves(&q1k2); |
| 697 | DumpCurves(&q1c2); |
| 698 | DumpCurves(&k1q2); |
| 699 | DumpCurves(&k1k2); |
| 700 | DumpCurves(&k1c2); |
| 701 | DumpCurves(&c1q2); |
| 702 | DumpCurves(&c1k2); |
| 703 | DumpCurves(&c1c2); |
| 704 | #endif |
| 705 | } |
| 706 | |
| 707 | template <typename TCurve, typename OppCurve> |
| 708 | void Dump(const SkTSpan<TCurve, OppCurve>* span) { |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 709 | span->dump(); |
| 710 | } |
| 711 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 712 | void DontCallDumpTSpan(); |
| 713 | void DontCallDumpTSpan() { // exists to instantiate the templates |
| 714 | #if !PATH_OP_COMPILE_FOR_SIZE |
| 715 | SkArenaAlloc heap(0); |
| 716 | SkDQuad quad; |
| 717 | SkTSpan<SkDQuad, SkDQuad> q1q2(quad, heap); q1q2.debugInit(); |
| 718 | SkTSpan<SkDQuad, SkDConic> q1k2(quad, heap); q1k2.debugInit(); |
| 719 | SkTSpan<SkDQuad, SkDCubic> q1c2(quad, heap); q1c2.debugInit(); |
| 720 | SkDConic conic; |
| 721 | SkTSpan<SkDConic, SkDQuad> k1q2(conic, heap); k1q2.debugInit(); |
| 722 | SkTSpan<SkDConic, SkDConic> k1k2(conic, heap); k1k2.debugInit(); |
| 723 | SkTSpan<SkDConic, SkDCubic> k1c2(conic, heap); k1c2.debugInit(); |
| 724 | SkDCubic cubic; |
| 725 | SkTSpan<SkDCubic, SkDQuad> c1q2(cubic, heap); c1q2.debugInit(); |
| 726 | SkTSpan<SkDCubic, SkDConic> c1k2(cubic, heap); c1k2.debugInit(); |
| 727 | SkTSpan<SkDCubic, SkDCubic> c1c2(cubic, heap); c1c2.debugInit(); |
| 728 | Dump(&q1q2); |
| 729 | Dump(&q1k2); |
| 730 | Dump(&q1c2); |
| 731 | Dump(&k1q2); |
| 732 | Dump(&k1k2); |
| 733 | Dump(&k1c2); |
| 734 | Dump(&c1q2); |
| 735 | Dump(&c1k2); |
| 736 | Dump(&c1c2); |
| 737 | #endif |
| 738 | } |
| 739 | |
| 740 | template <typename TCurve, typename OppCurve> |
| 741 | void DumpAll(const SkTSpan<TCurve, OppCurve>* span) { |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 742 | span->dumpAll(); |
| 743 | } |
| 744 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 745 | void DontCallDumpSpanAll(); |
| 746 | void DontCallDumpSpanAll() { // exists to instantiate the templates |
| 747 | #if !PATH_OP_COMPILE_FOR_SIZE |
| 748 | SkArenaAlloc heap(0); |
| 749 | SkDQuad quad; |
| 750 | SkTSpan<SkDQuad, SkDQuad> q1q2(quad, heap); q1q2.debugInit(); |
| 751 | SkTSpan<SkDQuad, SkDConic> q1k2(quad, heap); q1k2.debugInit(); |
| 752 | SkTSpan<SkDQuad, SkDCubic> q1c2(quad, heap); q1c2.debugInit(); |
| 753 | SkDConic conic; |
| 754 | SkTSpan<SkDConic, SkDQuad> k1q2(conic, heap); k1q2.debugInit(); |
| 755 | SkTSpan<SkDConic, SkDConic> k1k2(conic, heap); k1k2.debugInit(); |
| 756 | SkTSpan<SkDConic, SkDCubic> k1c2(conic, heap); k1c2.debugInit(); |
| 757 | SkDCubic cubic; |
| 758 | SkTSpan<SkDCubic, SkDQuad> c1q2(cubic, heap); c1q2.debugInit(); |
| 759 | SkTSpan<SkDCubic, SkDConic> c1k2(cubic, heap); c1k2.debugInit(); |
| 760 | SkTSpan<SkDCubic, SkDCubic> c1c2(cubic, heap); c1c2.debugInit(); |
| 761 | DumpAll(&q1q2); |
| 762 | DumpAll(&q1k2); |
| 763 | DumpAll(&q1c2); |
| 764 | DumpAll(&k1q2); |
| 765 | DumpAll(&k1k2); |
| 766 | DumpAll(&k1c2); |
| 767 | DumpAll(&c1q2); |
| 768 | DumpAll(&c1k2); |
| 769 | DumpAll(&c1c2); |
| 770 | #endif |
| 771 | } |
| 772 | |
| 773 | template <typename TCurve, typename OppCurve> |
| 774 | void DumpBounded(const SkTSpan<TCurve, OppCurve>* span) { |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 775 | span->dumpBounded(0); |
| 776 | } |
| 777 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 778 | void DontCallDumpSpanBounded(); |
| 779 | void DontCallDumpSpanBounded() { // exists to instantiate the templates |
| 780 | #if !PATH_OP_COMPILE_FOR_SIZE |
| 781 | SkArenaAlloc heap(0); |
| 782 | SkDQuad quad; |
| 783 | SkTSpan<SkDQuad, SkDQuad> q1q2(quad, heap); q1q2.debugInit(); |
| 784 | SkTSpan<SkDQuad, SkDConic> q1k2(quad, heap); q1k2.debugInit(); |
| 785 | SkTSpan<SkDQuad, SkDCubic> q1c2(quad, heap); q1c2.debugInit(); |
| 786 | SkDConic conic; |
| 787 | SkTSpan<SkDConic, SkDQuad> k1q2(conic, heap); k1q2.debugInit(); |
| 788 | SkTSpan<SkDConic, SkDConic> k1k2(conic, heap); k1k2.debugInit(); |
| 789 | SkTSpan<SkDConic, SkDCubic> k1c2(conic, heap); k1c2.debugInit(); |
| 790 | SkDCubic cubic; |
| 791 | SkTSpan<SkDCubic, SkDQuad> c1q2(cubic, heap); c1q2.debugInit(); |
| 792 | SkTSpan<SkDCubic, SkDConic> c1k2(cubic, heap); c1k2.debugInit(); |
| 793 | SkTSpan<SkDCubic, SkDCubic> c1c2(cubic, heap); c1c2.debugInit(); |
| 794 | DumpBounded(&q1q2); |
| 795 | DumpBounded(&q1k2); |
| 796 | DumpBounded(&q1c2); |
| 797 | DumpBounded(&k1q2); |
| 798 | DumpBounded(&k1k2); |
| 799 | DumpBounded(&k1c2); |
| 800 | DumpBounded(&c1q2); |
| 801 | DumpBounded(&c1k2); |
| 802 | DumpBounded(&c1c2); |
| 803 | #endif |
| 804 | } |
| 805 | |
| 806 | template <typename TCurve, typename OppCurve> |
| 807 | void DumpCoin(const SkTSpan<TCurve, OppCurve>* span) { |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 808 | span->dumpCoin(); |
| 809 | } |
| 810 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 811 | void DontCallDumpSpanCoin(); |
| 812 | void DontCallDumpSpanCoin() { // exists to instantiate the templates |
| 813 | #if !PATH_OP_COMPILE_FOR_SIZE |
| 814 | SkArenaAlloc heap(0); |
| 815 | SkDQuad quad; |
| 816 | SkTSpan<SkDQuad, SkDQuad> q1q2(quad, heap); q1q2.debugInit(); |
| 817 | SkTSpan<SkDQuad, SkDConic> q1k2(quad, heap); q1k2.debugInit(); |
| 818 | SkTSpan<SkDQuad, SkDCubic> q1c2(quad, heap); q1c2.debugInit(); |
| 819 | SkDConic conic; |
| 820 | SkTSpan<SkDConic, SkDQuad> k1q2(conic, heap); k1q2.debugInit(); |
| 821 | SkTSpan<SkDConic, SkDConic> k1k2(conic, heap); k1k2.debugInit(); |
| 822 | SkTSpan<SkDConic, SkDCubic> k1c2(conic, heap); k1c2.debugInit(); |
| 823 | SkDCubic cubic; |
| 824 | SkTSpan<SkDCubic, SkDQuad> c1q2(cubic, heap); c1q2.debugInit(); |
| 825 | SkTSpan<SkDCubic, SkDConic> c1k2(cubic, heap); c1k2.debugInit(); |
| 826 | SkTSpan<SkDCubic, SkDCubic> c1c2(cubic, heap); c1c2.debugInit(); |
| 827 | DumpCoin(&q1q2); |
| 828 | DumpCoin(&q1k2); |
| 829 | DumpCoin(&q1c2); |
| 830 | DumpCoin(&k1q2); |
| 831 | DumpCoin(&k1k2); |
| 832 | DumpCoin(&k1c2); |
| 833 | DumpCoin(&c1q2); |
| 834 | DumpCoin(&c1k2); |
| 835 | DumpCoin(&c1c2); |
| 836 | #endif |
| 837 | } |
| 838 | |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 839 | static void dumpTestCase(const SkDQuad& quad1, const SkDQuad& quad2, int testNo) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 840 | SkDebugf("\n<div id=\"quad%d\">\n", testNo); |
| 841 | quad1.dumpInner(); |
| 842 | SkDebugf("}}, "); |
commit-bot@chromium.org | 4431e77 | 2014-04-14 17:08:59 +0000 | [diff] [blame] | 843 | quad2.dump(); |
| 844 | SkDebugf("</div>\n\n"); |
| 845 | } |
| 846 | |
| 847 | static void dumpTestTrailer() { |
| 848 | SkDebugf("</div>\n\n<script type=\"text/javascript\">\n\n"); |
| 849 | SkDebugf(" var testDivs = [\n"); |
| 850 | } |
| 851 | |
| 852 | static void dumpTestList(int testNo, double min) { |
| 853 | SkDebugf(" quad%d,", testNo); |
| 854 | if (min > 0) { |
| 855 | SkDebugf(" // %1.9g", min); |
| 856 | } |
| 857 | SkDebugf("\n"); |
| 858 | } |
| 859 | |
| 860 | void DumpQ(const SkDQuad& quad1, const SkDQuad& quad2, int testNo) { |
| 861 | SkDebugf("\n"); |
| 862 | dumpTestCase(quad1, quad2, testNo); |
| 863 | dumpTestTrailer(); |
| 864 | dumpTestList(testNo, 0); |
| 865 | SkDebugf("\n"); |
| 866 | } |
| 867 | |
| 868 | void DumpT(const SkDQuad& quad, double t) { |
| 869 | SkDLine line = {{quad.ptAtT(t), quad[0]}}; |
| 870 | line.dump(); |
| 871 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 872 | |
| 873 | const SkOpAngle* SkOpAngle::debugAngle(int id) const { |
| 874 | return this->segment()->debugAngle(id); |
| 875 | } |
| 876 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 877 | const SkOpCoincidence* SkOpAngle::debugCoincidence() const { |
| 878 | return this->segment()->debugCoincidence(); |
| 879 | } |
| 880 | |
caryclark | 30b9fdd | 2016-08-31 14:36:29 -0700 | [diff] [blame] | 881 | SkOpContour* SkOpAngle::debugContour(int id) const { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 882 | return this->segment()->debugContour(id); |
| 883 | } |
| 884 | |
| 885 | const SkOpPtT* SkOpAngle::debugPtT(int id) const { |
| 886 | return this->segment()->debugPtT(id); |
| 887 | } |
| 888 | |
| 889 | const SkOpSegment* SkOpAngle::debugSegment(int id) const { |
| 890 | return this->segment()->debugSegment(id); |
| 891 | } |
| 892 | |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 893 | int SkOpAngle::debugSign() const { |
| 894 | SkASSERT(fStart->t() != fEnd->t()); |
| 895 | return fStart->t() < fEnd->t() ? -1 : 1; |
| 896 | } |
| 897 | |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 898 | const SkOpSpanBase* SkOpAngle::debugSpan(int id) const { |
| 899 | return this->segment()->debugSpan(id); |
| 900 | } |
| 901 | |
| 902 | void SkOpAngle::dump() const { |
| 903 | dumpOne(true); |
| 904 | SkDebugf("\n"); |
| 905 | } |
| 906 | |
| 907 | void SkOpAngle::dumpOne(bool functionHeader) const { |
| 908 | // fSegment->debugValidate(); |
| 909 | const SkOpSegment* segment = this->segment(); |
| 910 | const SkOpSpan& mSpan = *fStart->starter(fEnd); |
| 911 | if (functionHeader) { |
| 912 | SkDebugf("%s ", __FUNCTION__); |
| 913 | } |
| 914 | SkDebugf("[%d", segment->debugID()); |
| 915 | SkDebugf("/%d", debugID()); |
| 916 | SkDebugf("] next="); |
| 917 | if (fNext) { |
| 918 | SkDebugf("%d", fNext->fStart->segment()->debugID()); |
| 919 | SkDebugf("/%d", fNext->debugID()); |
| 920 | } else { |
| 921 | SkDebugf("?"); |
| 922 | } |
| 923 | SkDebugf(" sect=%d/%d ", fSectorStart, fSectorEnd); |
| 924 | SkDebugf(" s=%1.9g [%d] e=%1.9g [%d]", fStart->t(), fStart->debugID(), |
| 925 | fEnd->t(), fEnd->debugID()); |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 926 | SkDebugf(" sgn=%d windVal=%d", this->debugSign(), mSpan.windValue()); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 927 | |
| 928 | SkDebugf(" windSum="); |
| 929 | SkPathOpsDebug::WindingPrintf(mSpan.windSum()); |
| 930 | if (mSpan.oppValue() != 0 || mSpan.oppSum() != SK_MinS32) { |
| 931 | SkDebugf(" oppVal=%d", mSpan.oppValue()); |
| 932 | SkDebugf(" oppSum="); |
| 933 | SkPathOpsDebug::WindingPrintf(mSpan.oppSum()); |
| 934 | } |
| 935 | if (mSpan.done()) { |
| 936 | SkDebugf(" done"); |
| 937 | } |
| 938 | if (unorderable()) { |
| 939 | SkDebugf(" unorderable"); |
| 940 | } |
| 941 | if (segment->operand()) { |
| 942 | SkDebugf(" operand"); |
| 943 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 944 | } |
| 945 | |
| 946 | void SkOpAngle::dumpTo(const SkOpSegment* segment, const SkOpAngle* to) const { |
| 947 | const SkOpAngle* first = this; |
| 948 | const SkOpAngle* next = this; |
| 949 | const char* indent = ""; |
| 950 | do { |
| 951 | SkDebugf("%s", indent); |
| 952 | next->dumpOne(false); |
| 953 | if (segment == next->fStart->segment()) { |
| 954 | if (this == fNext) { |
| 955 | SkDebugf(" << from"); |
| 956 | } |
| 957 | if (to == fNext) { |
| 958 | SkDebugf(" << to"); |
| 959 | } |
| 960 | } |
| 961 | SkDebugf("\n"); |
| 962 | indent = " "; |
| 963 | next = next->fNext; |
| 964 | } while (next && next != first); |
| 965 | } |
| 966 | |
| 967 | void SkOpAngle::dumpCurves() const { |
| 968 | const SkOpAngle* first = this; |
| 969 | const SkOpAngle* next = this; |
| 970 | do { |
caryclark | eed356d | 2016-09-14 07:18:20 -0700 | [diff] [blame] | 971 | next->fPart.fCurve.dumpID(next->segment()->debugID()); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 972 | next = next->fNext; |
| 973 | } while (next && next != first); |
| 974 | } |
| 975 | |
| 976 | void SkOpAngle::dumpLoop() const { |
| 977 | const SkOpAngle* first = this; |
| 978 | const SkOpAngle* next = this; |
| 979 | do { |
| 980 | next->dumpOne(false); |
| 981 | SkDebugf("\n"); |
| 982 | next = next->fNext; |
| 983 | } while (next && next != first); |
| 984 | } |
| 985 | |
| 986 | void SkOpAngle::dumpTest() const { |
| 987 | const SkOpAngle* first = this; |
| 988 | const SkOpAngle* next = this; |
| 989 | do { |
| 990 | SkDebugf("{ "); |
| 991 | SkOpSegment* segment = next->segment(); |
| 992 | segment->dumpPts(); |
| 993 | SkDebugf(", %d, %1.9g, %1.9g, {} },\n", SkPathOpsVerbToPoints(segment->verb()) + 1, |
| 994 | next->start()->t(), next->end()->t()); |
| 995 | next = next->fNext; |
| 996 | } while (next && next != first); |
| 997 | } |
| 998 | |
| 999 | bool SkOpPtT::debugMatchID(int id) const { |
| 1000 | int limit = this->debugLoopLimit(false); |
| 1001 | int loop = 0; |
| 1002 | const SkOpPtT* ptT = this; |
| 1003 | do { |
| 1004 | if (ptT->debugID() == id) { |
| 1005 | return true; |
| 1006 | } |
| 1007 | } while ((!limit || ++loop <= limit) && (ptT = ptT->next()) && ptT != this); |
| 1008 | return false; |
| 1009 | } |
| 1010 | |
| 1011 | const SkOpAngle* SkOpPtT::debugAngle(int id) const { |
| 1012 | return this->span()->debugAngle(id); |
| 1013 | } |
| 1014 | |
caryclark | 30b9fdd | 2016-08-31 14:36:29 -0700 | [diff] [blame] | 1015 | SkOpContour* SkOpPtT::debugContour(int id) const { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1016 | return this->span()->debugContour(id); |
| 1017 | } |
| 1018 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1019 | const SkOpCoincidence* SkOpPtT::debugCoincidence() const { |
| 1020 | return this->span()->debugCoincidence(); |
| 1021 | } |
| 1022 | |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1023 | const SkOpPtT* SkOpPtT::debugPtT(int id) const { |
| 1024 | return this->span()->debugPtT(id); |
| 1025 | } |
| 1026 | |
| 1027 | const SkOpSegment* SkOpPtT::debugSegment(int id) const { |
| 1028 | return this->span()->debugSegment(id); |
| 1029 | } |
| 1030 | |
| 1031 | const SkOpSpanBase* SkOpPtT::debugSpan(int id) const { |
| 1032 | return this->span()->debugSpan(id); |
| 1033 | } |
| 1034 | |
| 1035 | void SkOpPtT::dump() const { |
| 1036 | SkDebugf("seg=%d span=%d ptT=%d", |
| 1037 | this->segment()->debugID(), this->span()->debugID(), this->debugID()); |
| 1038 | this->dumpBase(); |
| 1039 | SkDebugf("\n"); |
| 1040 | } |
| 1041 | |
| 1042 | void SkOpPtT::dumpAll() const { |
| 1043 | contour()->indentDump(); |
| 1044 | const SkOpPtT* next = this; |
| 1045 | int limit = debugLoopLimit(true); |
| 1046 | int loop = 0; |
| 1047 | do { |
| 1048 | SkDebugf("%.*s", contour()->debugIndent(), " "); |
| 1049 | SkDebugf("seg=%d span=%d ptT=%d", |
| 1050 | next->segment()->debugID(), next->span()->debugID(), next->debugID()); |
| 1051 | next->dumpBase(); |
| 1052 | SkDebugf("\n"); |
| 1053 | if (limit && ++loop >= limit) { |
| 1054 | SkDebugf("*** abort loop ***\n"); |
| 1055 | break; |
| 1056 | } |
| 1057 | } while ((next = next->fNext) && next != this); |
| 1058 | contour()->outdentDump(); |
| 1059 | } |
| 1060 | |
| 1061 | void SkOpPtT::dumpBase() const { |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1062 | SkDebugf(" t=%1.9g pt=(%1.9g,%1.9g)%s%s%s", this->fT, this->fPt.fX, this->fPt.fY, |
| 1063 | this->fCoincident ? " coin" : "", |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1064 | this->fDuplicatePt ? " dup" : "", this->fDeleted ? " deleted" : ""); |
| 1065 | } |
| 1066 | |
| 1067 | const SkOpAngle* SkOpSpanBase::debugAngle(int id) const { |
| 1068 | return this->segment()->debugAngle(id); |
| 1069 | } |
| 1070 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1071 | const SkOpCoincidence* SkOpSpanBase::debugCoincidence() const { |
| 1072 | return this->segment()->debugCoincidence(); |
| 1073 | } |
| 1074 | |
caryclark | 30b9fdd | 2016-08-31 14:36:29 -0700 | [diff] [blame] | 1075 | SkOpContour* SkOpSpanBase::debugContour(int id) const { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1076 | return this->segment()->debugContour(id); |
| 1077 | } |
| 1078 | |
| 1079 | const SkOpPtT* SkOpSpanBase::debugPtT(int id) const { |
| 1080 | return this->segment()->debugPtT(id); |
| 1081 | } |
| 1082 | |
| 1083 | const SkOpSegment* SkOpSpanBase::debugSegment(int id) const { |
| 1084 | return this->segment()->debugSegment(id); |
| 1085 | } |
| 1086 | |
| 1087 | const SkOpSpanBase* SkOpSpanBase::debugSpan(int id) const { |
| 1088 | return this->segment()->debugSpan(id); |
| 1089 | } |
| 1090 | |
| 1091 | void SkOpSpanBase::dump() const { |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1092 | this->dumpHead(); |
| 1093 | this->fPtT.dump(); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1094 | } |
| 1095 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1096 | void SkOpSpanBase::dumpHead() const { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1097 | SkDebugf("%.*s", contour()->debugIndent(), " "); |
| 1098 | SkDebugf("seg=%d span=%d", this->segment()->debugID(), this->debugID()); |
| 1099 | this->dumpBase(); |
| 1100 | SkDebugf("\n"); |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1101 | } |
| 1102 | |
| 1103 | void SkOpSpanBase::dumpAll() const { |
| 1104 | this->dumpHead(); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1105 | this->fPtT.dumpAll(); |
| 1106 | } |
| 1107 | |
| 1108 | void SkOpSpanBase::dumpBase() const { |
| 1109 | if (this->fAligned) { |
| 1110 | SkDebugf(" aligned"); |
| 1111 | } |
| 1112 | if (this->fChased) { |
| 1113 | SkDebugf(" chased"); |
| 1114 | } |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1115 | #ifdef SK_DEBUG |
caryclark | 30b9fdd | 2016-08-31 14:36:29 -0700 | [diff] [blame] | 1116 | if (this->fDebugDeleted) { |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1117 | SkDebugf(" deleted"); |
| 1118 | } |
| 1119 | #endif |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1120 | if (!this->final()) { |
| 1121 | this->upCast()->dumpSpan(); |
| 1122 | } |
| 1123 | const SkOpSpanBase* coin = this->coinEnd(); |
| 1124 | if (this != coin) { |
| 1125 | SkDebugf(" coinEnd seg/span=%d/%d", coin->segment()->debugID(), coin->debugID()); |
| 1126 | } else if (this->final() || !this->upCast()->isCoincident()) { |
| 1127 | const SkOpPtT* oPt = this->ptT()->next(); |
| 1128 | SkDebugf(" seg/span=%d/%d", oPt->segment()->debugID(), oPt->span()->debugID()); |
| 1129 | } |
caryclark | 08bc848 | 2015-04-24 09:08:57 -0700 | [diff] [blame] | 1130 | SkDebugf(" adds=%d", fSpanAdds); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1131 | } |
| 1132 | |
| 1133 | void SkOpSpanBase::dumpCoin() const { |
| 1134 | const SkOpSpan* span = this->upCastable(); |
| 1135 | if (!span) { |
| 1136 | return; |
| 1137 | } |
| 1138 | if (!span->isCoincident()) { |
| 1139 | return; |
| 1140 | } |
| 1141 | span->dumpCoin(); |
| 1142 | } |
| 1143 | |
| 1144 | void SkOpSpan::dumpCoin() const { |
| 1145 | const SkOpSpan* coincident = fCoincident; |
| 1146 | bool ok = debugCoinLoopCheck(); |
| 1147 | this->dump(); |
| 1148 | int loop = 0; |
| 1149 | do { |
| 1150 | coincident->dump(); |
| 1151 | if (!ok && ++loop > 10) { |
| 1152 | SkDebugf("*** abort loop ***\n"); |
| 1153 | break; |
| 1154 | } |
| 1155 | } while ((coincident = coincident->fCoincident) != this); |
| 1156 | } |
| 1157 | |
| 1158 | bool SkOpSpan::dumpSpan() const { |
| 1159 | SkOpSpan* coin = fCoincident; |
| 1160 | if (this != coin) { |
| 1161 | SkDebugf(" coinStart seg/span=%d/%d", coin->segment()->debugID(), coin->debugID()); |
| 1162 | } |
| 1163 | SkDebugf(" windVal=%d", this->windValue()); |
| 1164 | SkDebugf(" windSum="); |
| 1165 | SkPathOpsDebug::WindingPrintf(this->windSum()); |
| 1166 | if (this->oppValue() != 0 || this->oppSum() != SK_MinS32) { |
| 1167 | SkDebugf(" oppVal=%d", this->oppValue()); |
| 1168 | SkDebugf(" oppSum="); |
| 1169 | SkPathOpsDebug::WindingPrintf(this->oppSum()); |
| 1170 | } |
| 1171 | if (this->done()) { |
| 1172 | SkDebugf(" done"); |
| 1173 | } |
| 1174 | return this != coin; |
| 1175 | } |
| 1176 | |
| 1177 | const SkOpAngle* SkOpSegment::debugAngle(int id) const { |
| 1178 | return this->contour()->debugAngle(id); |
| 1179 | } |
| 1180 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1181 | |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1182 | const SkOpCoincidence* SkOpSegment::debugCoincidence() const { |
| 1183 | return this->contour()->debugCoincidence(); |
| 1184 | } |
| 1185 | |
caryclark | 30b9fdd | 2016-08-31 14:36:29 -0700 | [diff] [blame] | 1186 | SkOpContour* SkOpSegment::debugContour(int id) const { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1187 | return this->contour()->debugContour(id); |
| 1188 | } |
| 1189 | |
| 1190 | const SkOpPtT* SkOpSegment::debugPtT(int id) const { |
| 1191 | return this->contour()->debugPtT(id); |
| 1192 | } |
| 1193 | |
| 1194 | const SkOpSegment* SkOpSegment::debugSegment(int id) const { |
| 1195 | return this->contour()->debugSegment(id); |
| 1196 | } |
| 1197 | |
| 1198 | const SkOpSpanBase* SkOpSegment::debugSpan(int id) const { |
| 1199 | return this->contour()->debugSpan(id); |
| 1200 | } |
| 1201 | |
| 1202 | void SkOpSegment::dump() const { |
| 1203 | SkDebugf("%.*s", contour()->debugIndent(), " "); |
| 1204 | this->dumpPts(); |
| 1205 | const SkOpSpanBase* span = &fHead; |
| 1206 | contour()->indentDump(); |
| 1207 | do { |
| 1208 | SkDebugf("%.*s span=%d ", contour()->debugIndent(), " ", span->debugID()); |
| 1209 | span->ptT()->dumpBase(); |
| 1210 | span->dumpBase(); |
| 1211 | SkDebugf("\n"); |
| 1212 | } while (!span->final() && (span = span->upCast()->next())); |
| 1213 | contour()->outdentDump(); |
| 1214 | } |
| 1215 | |
| 1216 | void SkOpSegment::dumpAll() const { |
| 1217 | SkDebugf("%.*s", contour()->debugIndent(), " "); |
| 1218 | this->dumpPts(); |
| 1219 | const SkOpSpanBase* span = &fHead; |
| 1220 | contour()->indentDump(); |
| 1221 | do { |
| 1222 | span->dumpAll(); |
| 1223 | } while (!span->final() && (span = span->upCast()->next())); |
| 1224 | contour()->outdentDump(); |
| 1225 | } |
| 1226 | |
| 1227 | void SkOpSegment::dumpAngles() const { |
| 1228 | SkDebugf("seg=%d\n", debugID()); |
| 1229 | const SkOpSpanBase* span = &fHead; |
| 1230 | do { |
| 1231 | const SkOpAngle* fAngle = span->fromAngle(); |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 1232 | const SkOpAngle* tAngle = span->final() ? nullptr : span->upCast()->toAngle(); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1233 | if (fAngle) { |
| 1234 | SkDebugf(" span=%d from=%d ", span->debugID(), fAngle->debugID()); |
| 1235 | fAngle->dumpTo(this, tAngle); |
| 1236 | } |
| 1237 | if (tAngle) { |
| 1238 | SkDebugf(" span=%d to=%d ", span->debugID(), tAngle->debugID()); |
| 1239 | tAngle->dumpTo(this, fAngle); |
| 1240 | } |
| 1241 | } while (!span->final() && (span = span->upCast()->next())); |
| 1242 | } |
| 1243 | |
| 1244 | void SkOpSegment::dumpCoin() const { |
| 1245 | const SkOpSpan* span = &fHead; |
| 1246 | do { |
| 1247 | span->dumpCoin(); |
| 1248 | } while ((span = span->next()->upCastable())); |
| 1249 | } |
| 1250 | |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 1251 | void SkOpSegment::dumpPtsInner(const char* prefix) const { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1252 | int last = SkPathOpsVerbToPoints(fVerb); |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 1253 | SkDebugf("%s=%d {{", prefix, this->debugID()); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1254 | if (fVerb == SkPath::kConic_Verb) { |
| 1255 | SkDebugf("{"); |
| 1256 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1257 | int index = 0; |
| 1258 | do { |
| 1259 | SkDPoint::Dump(fPts[index]); |
| 1260 | SkDebugf(", "); |
| 1261 | } while (++index < last); |
| 1262 | SkDPoint::Dump(fPts[index]); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1263 | SkDebugf("}}"); |
| 1264 | if (fVerb == SkPath::kConic_Verb) { |
| 1265 | SkDebugf(", %1.9gf}", fWeight); |
| 1266 | } |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1267 | } |
| 1268 | |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 1269 | void SkOpSegment::dumpPts(const char* prefix) const { |
| 1270 | dumpPtsInner(prefix); |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1271 | SkDebugf("\n"); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1272 | } |
| 1273 | |
| 1274 | void SkCoincidentSpans::dump() const { |
| 1275 | SkDebugf("- seg=%d span=%d ptT=%d ", fCoinPtTStart->segment()->debugID(), |
| 1276 | fCoinPtTStart->span()->debugID(), fCoinPtTStart->debugID()); |
| 1277 | fCoinPtTStart->dumpBase(); |
| 1278 | SkDebugf(" span=%d ptT=%d ", fCoinPtTEnd->span()->debugID(), fCoinPtTEnd->debugID()); |
| 1279 | fCoinPtTEnd->dumpBase(); |
| 1280 | if (fCoinPtTStart->segment()->operand()) { |
| 1281 | SkDebugf(" operand"); |
| 1282 | } |
| 1283 | if (fCoinPtTStart->segment()->isXor()) { |
| 1284 | SkDebugf(" xor"); |
| 1285 | } |
| 1286 | SkDebugf("\n"); |
| 1287 | SkDebugf("+ seg=%d span=%d ptT=%d ", fOppPtTStart->segment()->debugID(), |
| 1288 | fOppPtTStart->span()->debugID(), fOppPtTStart->debugID()); |
| 1289 | fOppPtTStart->dumpBase(); |
| 1290 | SkDebugf(" span=%d ptT=%d ", fOppPtTEnd->span()->debugID(), fOppPtTEnd->debugID()); |
| 1291 | fOppPtTEnd->dumpBase(); |
| 1292 | if (fOppPtTStart->segment()->operand()) { |
| 1293 | SkDebugf(" operand"); |
| 1294 | } |
| 1295 | if (fOppPtTStart->segment()->isXor()) { |
| 1296 | SkDebugf(" xor"); |
| 1297 | } |
| 1298 | SkDebugf("\n"); |
| 1299 | } |
| 1300 | |
| 1301 | void SkOpCoincidence::dump() const { |
| 1302 | SkCoincidentSpans* span = fHead; |
| 1303 | while (span) { |
| 1304 | span->dump(); |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1305 | span = span->next(); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1306 | } |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 1307 | if (!fTop || fHead == fTop) { |
caryclark | 27c8eb8 | 2015-07-06 11:38:33 -0700 | [diff] [blame] | 1308 | return; |
| 1309 | } |
| 1310 | SkDebugf("top:\n"); |
| 1311 | span = fTop; |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1312 | int count = 0; |
caryclark | 27c8eb8 | 2015-07-06 11:38:33 -0700 | [diff] [blame] | 1313 | while (span) { |
| 1314 | span->dump(); |
caryclark | 55888e4 | 2016-07-18 10:01:36 -0700 | [diff] [blame] | 1315 | span = span->next(); |
| 1316 | SkCoincidentSpans* check = fTop; |
| 1317 | ++count; |
| 1318 | for (int index = 0; index < count; ++index) { |
| 1319 | if (span == check) { |
| 1320 | SkDebugf("(loops to #%d)\n", index); |
| 1321 | return; |
| 1322 | } |
| 1323 | check = check->next(); |
| 1324 | } |
caryclark | 27c8eb8 | 2015-07-06 11:38:33 -0700 | [diff] [blame] | 1325 | } |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1326 | } |
| 1327 | |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1328 | void SkOpContour::dump() const { |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1329 | SkDebugf("contour=%d count=%d op=%d xor=%d\n", this->debugID(), fCount, fOperand, fXor); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1330 | if (!fCount) { |
| 1331 | return; |
| 1332 | } |
| 1333 | const SkOpSegment* segment = &fHead; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1334 | SkDEBUGCODE(fDebugIndent = 0); |
| 1335 | this->indentDump(); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1336 | do { |
| 1337 | segment->dump(); |
| 1338 | } while ((segment = segment->next())); |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1339 | this->outdentDump(); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1340 | } |
| 1341 | |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1342 | void SkOpContour::dumpAll() const { |
caryclark | 1049f12 | 2015-04-20 08:31:59 -0700 | [diff] [blame] | 1343 | SkDebugf("contour=%d count=%d op=%d xor=%d\n", this->debugID(), fCount, fOperand, fXor); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1344 | if (!fCount) { |
| 1345 | return; |
| 1346 | } |
| 1347 | const SkOpSegment* segment = &fHead; |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1348 | SkDEBUGCODE(fDebugIndent = 0); |
| 1349 | this->indentDump(); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1350 | do { |
| 1351 | segment->dumpAll(); |
| 1352 | } while ((segment = segment->next())); |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1353 | this->outdentDump(); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1354 | } |
| 1355 | |
| 1356 | |
| 1357 | void SkOpContour::dumpAngles() const { |
| 1358 | SkDebugf("contour=%d\n", this->debugID()); |
| 1359 | const SkOpSegment* segment = &fHead; |
| 1360 | do { |
| 1361 | SkDebugf(" seg=%d ", segment->debugID()); |
| 1362 | segment->dumpAngles(); |
| 1363 | } while ((segment = segment->next())); |
| 1364 | } |
| 1365 | |
| 1366 | void SkOpContour::dumpPt(int index) const { |
| 1367 | const SkOpSegment* segment = &fHead; |
| 1368 | do { |
| 1369 | if (segment->debugID() == index) { |
| 1370 | segment->dumpPts(); |
| 1371 | } |
| 1372 | } while ((segment = segment->next())); |
| 1373 | } |
| 1374 | |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 1375 | void SkOpContour::dumpPts(const char* prefix) const { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1376 | SkDebugf("contour=%d\n", this->debugID()); |
| 1377 | const SkOpSegment* segment = &fHead; |
| 1378 | do { |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 1379 | SkDebugf(" %s=%d ", prefix, segment->debugID()); |
| 1380 | segment->dumpPts(prefix); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1381 | } while ((segment = segment->next())); |
| 1382 | } |
| 1383 | |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 1384 | void SkOpContour::dumpPtsX(const char* prefix) const { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1385 | if (!this->fCount) { |
| 1386 | SkDebugf("<empty>\n"); |
| 1387 | return; |
| 1388 | } |
| 1389 | const SkOpSegment* segment = &fHead; |
| 1390 | do { |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 1391 | segment->dumpPts(prefix); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1392 | } while ((segment = segment->next())); |
| 1393 | } |
| 1394 | |
| 1395 | void SkOpContour::dumpSegment(int index) const { |
| 1396 | debugSegment(index)->dump(); |
| 1397 | } |
| 1398 | |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 1399 | void SkOpContour::dumpSegments(const char* prefix, SkPathOp op) const { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1400 | bool firstOp = false; |
| 1401 | const SkOpContour* c = this; |
| 1402 | do { |
Ben Wagner | 3f98552 | 2017-10-09 10:47:47 -0400 | [diff] [blame] | 1403 | if (!firstOp && c->operand()) { |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1404 | #if DEBUG_ACTIVE_OP |
| 1405 | SkDebugf("op %s\n", SkPathOpsDebug::kPathOpStr[op]); |
| 1406 | #endif |
| 1407 | firstOp = true; |
| 1408 | } |
caryclark | 26ad22a | 2015-10-16 09:03:38 -0700 | [diff] [blame] | 1409 | c->dumpPtsX(prefix); |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1410 | } while ((c = c->next())); |
| 1411 | } |
| 1412 | |
| 1413 | void SkOpContour::dumpSpan(int index) const { |
| 1414 | debugSpan(index)->dump(); |
| 1415 | } |
| 1416 | |
| 1417 | void SkOpContour::dumpSpans() const { |
| 1418 | SkDebugf("contour=%d\n", this->debugID()); |
| 1419 | const SkOpSegment* segment = &fHead; |
| 1420 | do { |
| 1421 | SkDebugf(" seg=%d ", segment->debugID()); |
| 1422 | segment->dump(); |
| 1423 | } while ((segment = segment->next())); |
| 1424 | } |
| 1425 | |
caryclark | 03b03ca | 2015-04-23 09:13:37 -0700 | [diff] [blame] | 1426 | void SkOpCurve::dump() const { |
| 1427 | int count = SkPathOpsVerbToPoints(SkDEBUGRELEASE(fVerb, SkPath::kCubic_Verb)); |
| 1428 | SkDebugf("{{"); |
| 1429 | int index; |
| 1430 | for (index = 0; index <= count - 1; ++index) { |
| 1431 | SkDebugf("{%1.9gf,%1.9gf}, ", fPts[index].fX, fPts[index].fY); |
| 1432 | } |
| 1433 | SkDebugf("{%1.9gf,%1.9gf}}}\n", fPts[index].fX, fPts[index].fY); |
| 1434 | } |
| 1435 | |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1436 | #ifdef SK_DEBUG |
| 1437 | const SkOpAngle* SkOpGlobalState::debugAngle(int id) const { |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1438 | const SkOpContour* contour = fContourHead; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1439 | do { |
| 1440 | const SkOpSegment* segment = contour->first(); |
| 1441 | while (segment) { |
| 1442 | const SkOpSpan* span = segment->head(); |
| 1443 | do { |
| 1444 | SkOpAngle* angle = span->fromAngle(); |
| 1445 | if (angle && angle->debugID() == id) { |
| 1446 | return angle; |
| 1447 | } |
| 1448 | angle = span->toAngle(); |
| 1449 | if (angle && angle->debugID() == id) { |
| 1450 | return angle; |
| 1451 | } |
| 1452 | } while ((span = span->next()->upCastable())); |
| 1453 | const SkOpSpanBase* tail = segment->tail(); |
| 1454 | SkOpAngle* angle = tail->fromAngle(); |
| 1455 | if (angle && angle->debugID() == id) { |
| 1456 | return angle; |
| 1457 | } |
| 1458 | segment = segment->next(); |
| 1459 | } |
| 1460 | } while ((contour = contour->next())); |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 1461 | return nullptr; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1462 | } |
| 1463 | |
caryclark | 30b9fdd | 2016-08-31 14:36:29 -0700 | [diff] [blame] | 1464 | SkOpContour* SkOpGlobalState::debugContour(int id) const { |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1465 | SkOpContour* contour = fContourHead; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1466 | do { |
| 1467 | if (contour->debugID() == id) { |
| 1468 | return contour; |
| 1469 | } |
| 1470 | } while ((contour = contour->next())); |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 1471 | return nullptr; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1472 | } |
| 1473 | |
| 1474 | const SkOpPtT* SkOpGlobalState::debugPtT(int id) const { |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1475 | const SkOpContour* contour = fContourHead; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1476 | do { |
| 1477 | const SkOpSegment* segment = contour->first(); |
| 1478 | while (segment) { |
| 1479 | const SkOpSpan* span = segment->head(); |
| 1480 | do { |
| 1481 | const SkOpPtT* ptT = span->ptT(); |
| 1482 | if (ptT->debugMatchID(id)) { |
| 1483 | return ptT; |
| 1484 | } |
| 1485 | } while ((span = span->next()->upCastable())); |
| 1486 | const SkOpSpanBase* tail = segment->tail(); |
| 1487 | const SkOpPtT* ptT = tail->ptT(); |
| 1488 | if (ptT->debugMatchID(id)) { |
| 1489 | return ptT; |
| 1490 | } |
| 1491 | segment = segment->next(); |
| 1492 | } |
| 1493 | } while ((contour = contour->next())); |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 1494 | return nullptr; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1495 | } |
| 1496 | |
| 1497 | const SkOpSegment* SkOpGlobalState::debugSegment(int id) const { |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1498 | const SkOpContour* contour = fContourHead; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1499 | do { |
| 1500 | const SkOpSegment* segment = contour->first(); |
| 1501 | while (segment) { |
| 1502 | if (segment->debugID() == id) { |
| 1503 | return segment; |
| 1504 | } |
| 1505 | segment = segment->next(); |
| 1506 | } |
| 1507 | } while ((contour = contour->next())); |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 1508 | return nullptr; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1509 | } |
| 1510 | |
| 1511 | const SkOpSpanBase* SkOpGlobalState::debugSpan(int id) const { |
caryclark | 624637c | 2015-05-11 07:21:27 -0700 | [diff] [blame] | 1512 | const SkOpContour* contour = fContourHead; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1513 | do { |
| 1514 | const SkOpSegment* segment = contour->first(); |
| 1515 | while (segment) { |
| 1516 | const SkOpSpan* span = segment->head(); |
| 1517 | do { |
| 1518 | if (span->debugID() == id) { |
| 1519 | return span; |
| 1520 | } |
| 1521 | } while ((span = span->next()->upCastable())); |
| 1522 | const SkOpSpanBase* tail = segment->tail(); |
| 1523 | if (tail->debugID() == id) { |
| 1524 | return tail; |
| 1525 | } |
| 1526 | segment = segment->next(); |
| 1527 | } |
| 1528 | } while ((contour = contour->next())); |
halcanary | 96fcdcc | 2015-08-27 07:41:13 -0700 | [diff] [blame] | 1529 | return nullptr; |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1530 | } |
| 1531 | #endif |
| 1532 | |
caryclark | 5435929 | 2015-03-26 07:52:43 -0700 | [diff] [blame] | 1533 | #if DEBUG_T_SECT_DUMP > 1 |
| 1534 | int gDumpTSectNum; |
| 1535 | #endif |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1536 | |
| 1537 | // global path dumps for msvs Visual Studio 17 to use from Immediate Window |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1538 | namespace SkOpDebug { |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1539 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1540 | void Dump(const SkOpContour& contour) { |
| 1541 | contour.dump(); |
| 1542 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1543 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1544 | void DumpAll(const SkOpContour& contour) { |
| 1545 | contour.dumpAll(); |
| 1546 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1547 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1548 | void DumpAngles(const SkOpContour& contour) { |
| 1549 | contour.dumpAngles(); |
| 1550 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1551 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1552 | void DumpContours(const SkOpContour& contour) { |
| 1553 | contour.dumpContours(); |
| 1554 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1555 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1556 | void DumpContoursAll(const SkOpContour& contour) { |
| 1557 | contour.dumpContoursAll(); |
| 1558 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1559 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1560 | void DumpContoursAngles(const SkOpContour& contour) { |
| 1561 | contour.dumpContoursAngles(); |
| 1562 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1563 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1564 | void DumpContoursPts(const SkOpContour& contour) { |
| 1565 | contour.dumpContoursPts(); |
| 1566 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1567 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1568 | void DumpContoursPt(const SkOpContour& contour, int segmentID) { |
| 1569 | contour.dumpContoursPt(segmentID); |
| 1570 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1571 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1572 | void DumpContoursSegment(const SkOpContour& contour, int segmentID) { |
| 1573 | contour.dumpContoursSegment(segmentID); |
| 1574 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1575 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1576 | void DumpContoursSpan(const SkOpContour& contour, int segmentID) { |
| 1577 | contour.dumpContoursSpan(segmentID); |
| 1578 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1579 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1580 | void DumpContoursSpans(const SkOpContour& contour) { |
| 1581 | contour.dumpContoursSpans(); |
| 1582 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1583 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1584 | void DumpPt(const SkOpContour& contour, int pt) { |
| 1585 | contour.dumpPt(pt); |
| 1586 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1587 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1588 | void DumpPts(const SkOpContour& contour, const char* prefix) { |
| 1589 | contour.dumpPts(prefix); |
| 1590 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1591 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1592 | void DumpSegment(const SkOpContour& contour, int seg) { |
| 1593 | contour.dumpSegment(seg); |
| 1594 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1595 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1596 | void DumpSegments(const SkOpContour& contour, const char* prefix, SkPathOp op) { |
| 1597 | contour.dumpSegments(prefix, op); |
| 1598 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1599 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1600 | void DumpSpan(const SkOpContour& contour, int span) { |
| 1601 | contour.dumpSpan(span); |
| 1602 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1603 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1604 | void DumpSpans(const SkOpContour& contour ) { |
| 1605 | contour.dumpSpans(); |
| 1606 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1607 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1608 | void Dump(const SkOpSegment& segment) { |
| 1609 | segment.dump(); |
| 1610 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1611 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1612 | void DumpAll(const SkOpSegment& segment) { |
| 1613 | segment.dumpAll(); |
| 1614 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1615 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1616 | void DumpAngles(const SkOpSegment& segment) { |
| 1617 | segment.dumpAngles(); |
| 1618 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1619 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1620 | void DumpCoin(const SkOpSegment& segment) { |
| 1621 | segment.dumpCoin(); |
| 1622 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1623 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1624 | void DumpPts(const SkOpSegment& segment, const char* prefix) { |
| 1625 | segment.dumpPts(prefix); |
| 1626 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1627 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1628 | void Dump(const SkOpPtT& ptT) { |
| 1629 | ptT.dump(); |
| 1630 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1631 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1632 | void DumpAll(const SkOpPtT& ptT) { |
| 1633 | ptT.dumpAll(); |
| 1634 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1635 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1636 | void Dump(const SkOpSpanBase& spanBase) { |
| 1637 | spanBase.dump(); |
| 1638 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1639 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1640 | void DumpCoin(const SkOpSpanBase& spanBase) { |
| 1641 | spanBase.dumpCoin(); |
| 1642 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1643 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1644 | void DumpAll(const SkOpSpanBase& spanBase) { |
| 1645 | spanBase.dumpAll(); |
| 1646 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1647 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1648 | void DumpCoin(const SkOpSpan& span) { |
| 1649 | span.dumpCoin(); |
| 1650 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1651 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1652 | bool DumpSpan(const SkOpSpan& span) { |
| 1653 | return span.dumpSpan(); |
| 1654 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1655 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1656 | void Dump(const SkDConic& conic) { |
| 1657 | conic.dump(); |
| 1658 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1659 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1660 | void DumpID(const SkDConic& conic, int id) { |
| 1661 | conic.dumpID(id); |
| 1662 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1663 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1664 | void Dump(const SkDCubic& cubic) { |
| 1665 | cubic.dump(); |
| 1666 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1667 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1668 | void DumpID(const SkDCubic& cubic, int id) { |
| 1669 | cubic.dumpID(id); |
| 1670 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1671 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1672 | void Dump(const SkDLine& line) { |
| 1673 | line.dump(); |
| 1674 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1675 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1676 | void DumpID(const SkDLine& line, int id) { |
| 1677 | line.dumpID(id); |
| 1678 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1679 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1680 | void Dump(const SkDQuad& quad) { |
| 1681 | quad.dump(); |
| 1682 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1683 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1684 | void DumpID(const SkDQuad& quad, int id) { |
| 1685 | quad.dumpID(id); |
| 1686 | } |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1687 | |
Cary Clark | b2c7d84 | 2018-10-16 18:16:59 +0000 | [diff] [blame^] | 1688 | void Dump(const SkDPoint& point) { |
| 1689 | point.dump(); |
| 1690 | } |
| 1691 | |
| 1692 | void Dump(const SkOpAngle& angle) { |
| 1693 | angle.dump(); |
| 1694 | } |
| 1695 | |
| 1696 | // dummy definitions to fool msvs Visual Studio 2018 Immediate Window |
| 1697 | #define DummyDefinitions(a, b) \ |
| 1698 | \ |
| 1699 | void Dump(const SkDebugTCoincident##a##b& curve) { \ |
| 1700 | ((const SkTCoincident<SkD##a, SkD##b>& ) curve).dump(); \ |
| 1701 | } \ |
| 1702 | \ |
| 1703 | void Dump(const SkDebugTSect##a##b& curve) { \ |
| 1704 | ((const SkTSect<SkD##a, SkD##b>& ) curve).dump(); \ |
| 1705 | } \ |
| 1706 | \ |
| 1707 | void DumpBoth(const SkDebugTSect##a##b& curve, SkDebugTSect##a##b* opp) { \ |
| 1708 | ((const SkTSect<SkD##a, SkD##b>& ) curve).dumpBoth((SkTSect<SkD##b, SkD##a>* ) opp); \ |
| 1709 | } \ |
| 1710 | \ |
| 1711 | void DumpBounded(const SkDebugTSect##a##b& curve, int id) { \ |
| 1712 | ((const SkTSect<SkD##a, SkD##b>& ) curve).dumpBounded(id); \ |
| 1713 | } \ |
| 1714 | \ |
| 1715 | void DumpBounds(const SkDebugTSect##a##b& curve) { \ |
| 1716 | ((const SkTSect<SkD##a, SkD##b>& ) curve).dumpBounds(); \ |
| 1717 | } \ |
| 1718 | \ |
| 1719 | void DumpCoin(const SkDebugTSect##a##b& curve) { \ |
| 1720 | ((const SkTSect<SkD##a, SkD##b>& ) curve).dumpCoin(); \ |
| 1721 | } \ |
| 1722 | \ |
| 1723 | void DumpCoinCurves(const SkDebugTSect##a##b& curve) { \ |
| 1724 | ((const SkTSect<SkD##a, SkD##b>& ) curve).dumpCoinCurves(); \ |
| 1725 | } \ |
| 1726 | \ |
| 1727 | void DumpCurves(const SkDebugTSect##a##b& curve) { \ |
| 1728 | ((const SkTSect<SkD##a, SkD##b>& ) curve).dumpCurves(); \ |
| 1729 | } \ |
| 1730 | \ |
| 1731 | void Dump(const SkDebugTSpan##a##b& curve) { \ |
| 1732 | ((const SkTSpan<SkD##a, SkD##b>& ) curve).dump(); \ |
| 1733 | } \ |
| 1734 | \ |
| 1735 | void DumpAll(const SkDebugTSpan##a##b& curve) { \ |
| 1736 | ((const SkTSpan<SkD##a, SkD##b>& ) curve).dumpAll(); \ |
| 1737 | } \ |
| 1738 | \ |
| 1739 | void DumpBounded(const SkDebugTSpan##a##b& curve, int id) { \ |
| 1740 | ((const SkTSpan<SkD##a, SkD##b>& ) curve).dumpBounded(id); \ |
| 1741 | } \ |
| 1742 | \ |
| 1743 | void DumpBounds(const SkDebugTSpan##a##b& curve) { \ |
| 1744 | ((const SkTSpan<SkD##a, SkD##b>& ) curve).dumpBounds(); \ |
| 1745 | } \ |
| 1746 | \ |
| 1747 | void DumpCoin(const SkDebugTSpan##a##b& curve) { \ |
| 1748 | ((const SkTSpan<SkD##a, SkD##b>& ) curve).dumpCoin(); \ |
| 1749 | } |
| 1750 | |
| 1751 | #if !PATH_OP_COMPILE_FOR_SIZE |
| 1752 | DummyDefinitions(Quad, Quad); |
| 1753 | DummyDefinitions(Conic, Quad); |
| 1754 | DummyDefinitions(Conic, Conic); |
| 1755 | DummyDefinitions(Cubic, Quad); |
| 1756 | DummyDefinitions(Cubic, Conic); |
| 1757 | DummyDefinitions(Cubic, Cubic); |
| 1758 | #endif |
| 1759 | |
| 1760 | #undef DummyDefinitions |
Cary Clark | b8421ed | 2018-03-14 15:55:02 -0400 | [diff] [blame] | 1761 | } |