OLD | NEW |
1 /* | 1 /* |
2 * Copyright 2013 Google Inc. | 2 * Copyright 2013 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 #include "SkPathOpsDebug.h" | 8 #include "SkPathOpsDebug.h" |
9 #include "SkPath.h" | 9 #include "SkPath.h" |
10 #if DEBUG_ANGLE | 10 #if DEBUG_ANGLE |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
127 if (span->toAngle()) { | 127 if (span->toAngle()) { |
128 SkASSERT(!result); | 128 SkASSERT(!result); |
129 result = span->toAngle(); | 129 result = span->toAngle(); |
130 } | 130 } |
131 } while ((span = span->next()->upCastable())); | 131 } while ((span = span->next()->upCastable())); |
132 SkASSERT(result); | 132 SkASSERT(result); |
133 return result; | 133 return result; |
134 } | 134 } |
135 | 135 |
136 void SkOpSegment::debugReset() { | 136 void SkOpSegment::debugReset() { |
137 this->init(this->fPts, this->contour(), this->verb()); | 137 this->init(this->fPts, this->fWeight, this->contour(), this->verb()); |
138 } | 138 } |
139 | 139 |
140 #if DEBUG_ACTIVE_SPANS | 140 #if DEBUG_ACTIVE_SPANS |
141 void SkOpSegment::debugShowActiveSpans() const { | 141 void SkOpSegment::debugShowActiveSpans() const { |
142 debugValidate(); | 142 debugValidate(); |
143 if (done()) { | 143 if (done()) { |
144 return; | 144 return; |
145 } | 145 } |
146 int lastId = -1; | 146 int lastId = -1; |
147 double lastT = -1; | 147 double lastT = -1; |
148 const SkOpSpan* span = &fHead; | 148 const SkOpSpan* span = &fHead; |
149 do { | 149 do { |
150 if (span->done()) { | 150 if (span->done()) { |
151 continue; | 151 continue; |
152 } | 152 } |
153 if (lastId == fID && lastT == span->t()) { | 153 if (lastId == fID && lastT == span->t()) { |
154 continue; | 154 continue; |
155 } | 155 } |
156 lastId = fID; | 156 lastId = fID; |
157 lastT = span->t(); | 157 lastT = span->t(); |
158 SkDebugf("%s id=%d", __FUNCTION__, fID); | 158 SkDebugf("%s id=%d", __FUNCTION__, fID); |
159 SkDebugf(" (%1.9g,%1.9g", fPts[0].fX, fPts[0].fY); | 159 SkDebugf(" (%1.9g,%1.9g", fPts[0].fX, fPts[0].fY); |
160 for (int vIndex = 1; vIndex <= SkPathOpsVerbToPoints(fVerb); ++vIndex) { | 160 for (int vIndex = 1; vIndex <= SkPathOpsVerbToPoints(fVerb); ++vIndex) { |
161 SkDebugf(" %1.9g,%1.9g", fPts[vIndex].fX, fPts[vIndex].fY); | 161 SkDebugf(" %1.9g,%1.9g", fPts[vIndex].fX, fPts[vIndex].fY); |
162 } | 162 } |
| 163 if (SkPath::kConic_Verb == fVerb) { |
| 164 SkDebugf(" %1.9gf", fWeight); |
| 165 } |
163 const SkOpPtT* ptT = span->ptT(); | 166 const SkOpPtT* ptT = span->ptT(); |
164 SkDebugf(") t=%1.9g (%1.9g,%1.9g)", ptT->fT, ptT->fPt.fX, ptT->fPt.fY); | 167 SkDebugf(") t=%1.9g (%1.9g,%1.9g)", ptT->fT, ptT->fPt.fX, ptT->fPt.fY); |
165 SkDebugf(" tEnd=%1.9g", span->next()->t()); | 168 SkDebugf(" tEnd=%1.9g", span->next()->t()); |
166 SkDebugf(" windSum="); | 169 SkDebugf(" windSum="); |
167 if (span->windSum() == SK_MinS32) { | 170 if (span->windSum() == SK_MinS32) { |
168 SkDebugf("?"); | 171 SkDebugf("?"); |
169 } else { | 172 } else { |
170 SkDebugf("%d", span->windSum()); | 173 SkDebugf("%d", span->windSum()); |
171 } | 174 } |
172 SkDebugf(" windValue=%d oppValue=%d", span->windValue(), span->oppValue(
)); | 175 SkDebugf(" windValue=%d oppValue=%d", span->windValue(), span->oppValue(
)); |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 SkString result; | 245 SkString result; |
243 switch (this->segment()->verb()) { | 246 switch (this->segment()->verb()) { |
244 case SkPath::kLine_Verb: | 247 case SkPath::kLine_Verb: |
245 result.printf(LINE_DEBUG_STR " id=%d", LINE_DEBUG_DATA(fCurvePart), | 248 result.printf(LINE_DEBUG_STR " id=%d", LINE_DEBUG_DATA(fCurvePart), |
246 this->segment()->debugID()); | 249 this->segment()->debugID()); |
247 break; | 250 break; |
248 case SkPath::kQuad_Verb: | 251 case SkPath::kQuad_Verb: |
249 result.printf(QUAD_DEBUG_STR " id=%d", QUAD_DEBUG_DATA(fCurvePart), | 252 result.printf(QUAD_DEBUG_STR " id=%d", QUAD_DEBUG_DATA(fCurvePart), |
250 this->segment()->debugID()); | 253 this->segment()->debugID()); |
251 break; | 254 break; |
| 255 case SkPath::kConic_Verb: |
| 256 result.printf(CONIC_DEBUG_STR " id=%d", |
| 257 CONIC_DEBUG_DATA(fCurvePart, fCurvePart.fConic.fWeight), |
| 258 this->segment()->debugID()); |
| 259 break; |
252 case SkPath::kCubic_Verb: | 260 case SkPath::kCubic_Verb: |
253 result.printf(CUBIC_DEBUG_STR " id=%d", CUBIC_DEBUG_DATA(fCurvePart)
, | 261 result.printf(CUBIC_DEBUG_STR " id=%d", CUBIC_DEBUG_DATA(fCurvePart)
, |
254 this->segment()->debugID()); | 262 this->segment()->debugID()); |
255 break; | 263 break; |
256 default: | 264 default: |
257 SkASSERT(0); | 265 SkASSERT(0); |
258 } | 266 } |
259 return result; | 267 return result; |
260 } | 268 } |
261 #endif | 269 #endif |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 #if DEBUG_VALIDATE | 472 #if DEBUG_VALIDATE |
465 if (contour()->globalState()->phase() == SkOpGlobalState::kIntersecting) { | 473 if (contour()->globalState()->phase() == SkOpGlobalState::kIntersecting) { |
466 return; | 474 return; |
467 } | 475 } |
468 SkASSERT(fNext); | 476 SkASSERT(fNext); |
469 SkASSERT(fNext != this); | 477 SkASSERT(fNext != this); |
470 SkASSERT(fNext->fNext); | 478 SkASSERT(fNext->fNext); |
471 SkASSERT(debugLoopLimit(false) == 0); | 479 SkASSERT(debugLoopLimit(false) == 0); |
472 #endif | 480 #endif |
473 } | 481 } |
OLD | NEW |