66#if !defined SK_DEBUG && FORCE_RELEASE
128 }
while (++index < 3);
222 }
while (++index < 2);
227 SkDebugf(
"used=%d of %d", fUsed, fMax);
228 for (
int index = 0; index < fUsed; ++index) {
229 SkDebugf(
" t=(%s%1.9g,%s%1.9g) pt=(%1.9g,%1.9g)",
230 fIsCoincident[0] & (1 << index) ?
"*" :
"", fT[0][index],
231 fIsCoincident[1] & (1 << index) ?
"*" :
"", fT[1][index],
232 fPt[index].fX, fPt[index].fY);
233 if (index < 2 && fNearlySame[index]) {
234 SkDebugf(
" pt2=(%1.9g,%1.9g)",fPt2[index].fX, fPt2[index].fY);
261 return contour->debugAngle(
id);
265 return contour->debugContour(
id);
273 return contour->debugSegment(
id);
361void SkPathOpsDebug::DumpCoinDict() {
362 SkPathOpsDebug::gCoinSumChangedDict.
dump(
"unused coin algorithm",
false);
363 SkPathOpsDebug::gCoinSumVisitedDict.dump(
"visited coin function",
true);
367 int count = fDict.size();
368 for (
int index = 0; index <
count; ++index) {
369 const auto& entry = fDict[index];
370 if (visitCheck || entry.fGlitchType == kUninitialized_Glitch) {
371 SkDebugf(
"%s %s : line %d iteration %d", str, entry.fFunctionName,
372 entry.fLineNumber, entry.fIteration);
373 DumpGlitchType(entry.fGlitchType);
411 contour->
dumpPt(segmentID);
438 return sect->debugSpan(
id);
442 return sect->debugT(t);
491 SkDebugf(
"\n<div id=\"quad%d\">\n", testNo);
499 SkDebugf(
"</div>\n\n<script type=\"text/javascript\">\n\n");
546 return fStart->
t() < fEnd->
t() ? -1 : 1;
562 if (functionHeader) {
574 SkDebugf(
" sect=%d/%d ", fSectorStart, fSectorEnd);
600 const char* indent =
"";
658 }
while ((!limit || ++loop <= limit) && (ptT = ptT->
next()) && ptT !=
this);
704 if (limit && ++loop >= limit) {
713 SkDebugf(
" t=%1.9g pt=(%1.9g,%1.9g)%s%s%s", this->
fT, this->
fPt.
fX, this->fPt.fY,
714 this->fCoincident ?
" coin" :
"",
715 this->fDuplicatePt ?
" dup" :
"", this->fDeleted ?
" deleted" :
"");
767 if (this->fDebugDeleted) {
771 if (!this->
final()) {
777 }
else if (this->
final() || !this->
upCast()->isCoincident()) {
802 if (!
ok && ++loop > 10) {
885 fAngle->dumpTo(
this, tAngle);
889 tAngle->
dumpTo(
this, fAngle);
911 }
while (++index < last);
957 if (!fTop || fHead == fTop) {
968 for (
int index = 0; index <
count; ++index) {
970 SkDebugf(
"(loops to #%d)\n", index);
988 }
while ((segment = segment->
next()));
1002 }
while ((segment = segment->
next()));
1013 }
while ((segment = segment->
next()));
1019 if (segment->
debugID() == index) {
1022 }
while ((segment = segment->
next()));
1031 }
while ((segment = segment->
next()));
1042 }
while ((segment = segment->
next()));
1050 bool firstOp =
false;
1053 if (!firstOp && c->
operand()) {
1055 SkDebugf(
"op %s\n", SkPathOpsDebug::kPathOpStr[op]);
1060 }
while ((c = c->
next()));
1073 }
while ((segment = segment->
next()));
1080 for (index = 0; index <=
count - 1; ++index) {
1087const SkOpAngle* SkOpGlobalState::debugAngle(
int id)
const {
1095 if (angle && angle->
debugID() ==
id) {
1099 if (angle && angle->
debugID() ==
id) {
1105 if (angle && angle->
debugID() ==
id) {
1108 segment = segment->
next();
1114SkOpContour* SkOpGlobalState::debugContour(
int id)
const {
1117 if (
contour->debugID() ==
id) {
1124const SkOpPtT* SkOpGlobalState::debugPtT(
int id)
const {
1141 segment = segment->
next();
1147const SkOpSegment* SkOpGlobalState::debugSegment(
int id)
const {
1152 if (segment->
debugID() ==
id) {
1155 segment = segment->
next();
1161const SkOpSpanBase* SkOpGlobalState::debugSpan(
int id)
const {
1173 if (
tail->debugID() ==
id) {
1176 segment = segment->
next();
1184 if (!!fMatch != fMatch) {
1187 return fMatch ?
'*' : 0;
1191 SkDebugf(
"t=%1.9g pt=(%1.9g,%1.9g)%s\n", fPerpT, fPerpPt.
fX, fPerpPt.
fY,
1192 fMatch ?
" match" :
"");
1197const SkTSpan* SkTSect::debugSpan(
int id)
const {
1200 if (
test->debugID() ==
id) {
1207const SkTSpan* SkTSect::debugT(
double t)
const {
1209 const SkTSpan* closest =
nullptr;
1210 double bestDist = DBL_MAX;
1215 double testDist =
std::min(fabs(
test->fStartT - t), fabs(
test->fEndT - t));
1216 if (bestDist > testDist) {
1217 bestDist = testDist;
1234#if DEBUG_T_SECT_DUMP <= 2
1235#if DEBUG_T_SECT_DUMP == 2
1242#elif DEBUG_T_SECT_DUMP == 3
1256 const SkTSpan* bounded = debugSpan(
id);
1258 SkDebugf(
"no span matches %d\n",
id);
1263 if (
test->findOppSpan(bounded)) {
1280 dumpCommon(fCoincident);
1284 dumpCommonCurves(fCoincident);
1287void SkTSect::dumpCommon(
const SkTSpan*
test)
const {
1299void SkTSect::dumpCommonCurves(
const SkTSpan*
test)
const {
1302 test->fPart->dumpID(
test->debugID());
1308 dumpCommonCurves(fHead);
1313const SkTSpan* SkTSpan::debugSpan(
int id)
const {
1314 return fDebugSect->debugSpan(
id);
1317const SkTSpan* SkTSpan::debugT(
double t)
const {
1318 return fDebugSect->debugT(t);
1325 SkDebugf(
"=(%g,%g) [", fStartT, fEndT);
1327 while (testBounded) {
1331 SkDebugf(
"=(%g,%g)", span->fStartT, span->fEndT);
1342 SkDebugf(
"=(%g,%g) [", fStartT, fEndT);
1344 while (testBounded) {
1362 SkDebugf(
" bounds=(%1.9g,%1.9g, %1.9g,%1.9g) boundsMax=%1.9g%s\n",
1364 fCollapsed ?
" collapsed" :
"");
1375void SkTSpan::dumpID()
const {
1387#if DEBUG_T_SECT_DUMP > 1
1421 contour.dumpContoursPt(segmentID);
1425 contour.dumpContoursSegment(segmentID);
1429 contour.dumpContoursSpan(segmentID);
1549 SkOpPtT* startPtT = startT == 0 ? fHead.
ptT() : startT == 1 ? fTail.
ptT()
1550 : this->
addT(startT);
1551 SkOpPtT* endPtT = endT == 0 ? fHead.
ptT() : endT == 1 ? fTail.
ptT()
1555 while (startSpan->ptT() != startPtT) {
1559 while (endSpan->
ptT() != endPtT) {
1562 angle->
set(startSpan, endSpan);
1563 if (startT < endT) {
1564 startSpan->upCast()->setToAngle(angle);
1568 startSpan->setFromAngle(angle);
static bool coincident(const SkPoint &a, const SkPoint &b)
SkOpContour * CoincidenceContour(SkOpCoincidence *coin, int id)
void DumpContoursAll(const SkOpContour &contour)
void DumpQ(const SkDQuad &quad1, const SkDQuad &quad2, int testNo)
void DumpContoursSpans(const SkOpContour &contour)
const SkOpSegment * ContourSegment(SkOpContour *contour, int id)
const SkOpSegment * SpanSegment(const SkOpSpanBase *span, int id)
void DumpPts(const SkOpContour &contour, const char *prefix)
void DumpSpans(const SkOpContour &contour)
void DumpT(const SkDQuad &quad, double t)
const SkOpSpanBase * AngleSpan(const SkOpAngle *angle, int id)
const SkOpPtT * SpanPtT(const SkOpSpanBase *span, int id)
void DumpContoursSegment(const SkOpContour &contour, int segmentID)
const SkOpSpanBase * SegmentSpan(const SkOpSegment *span, int id)
static void dumpTestTrailer()
void DumpContours(const SkOpContour &contour)
void Dump(const SkTSect *sect)
const SkOpSpanBase * PtTSpan(const SkOpPtT *ptT, int id)
const SkOpSpanBase * ContourSpan(SkOpContour *contour, int id)
const SkOpSegment * PtTSegment(const SkOpPtT *ptT, int id)
SkOpContour * SpanContour(SkOpSpanBase *span, int id)
const SkOpAngle * AngleAngle(const SkOpAngle *angle, int id)
const SkOpAngle * PtTAngle(const SkOpPtT *ptT, int id)
SkOpContour * ContourContour(SkOpContour *contour, int id)
static void DumpID(int id)
const SkOpSegment * AngleSegment(const SkOpAngle *angle, int id)
const SkOpPtT * CoincidencePtT(SkOpCoincidence *coin, int id)
void DumpCoin(SkTSect *sect1)
void DumpContoursAngles(const SkOpContour &contour)
void DumpAngles(const SkOpContour &contour)
void DumpSegment(const SkOpContour &contour, int seg)
void DumpCoinCurves(SkTSect *sect1)
const SkOpAngle * CoincidenceAngle(SkOpCoincidence *coin, int id)
void DebugDumpDouble(double x)
const SkOpPtT * AnglePtT(const SkOpAngle *angle, int id)
const SkOpSegment * CoincidenceSegment(SkOpCoincidence *coin, int id)
const SkOpAngle * ContourAngle(SkOpContour *contour, int id)
const SkOpPtT * PtTPtT(const SkOpPtT *ptT, int id)
void DumpBounds(SkTSect *sect1)
const SkOpPtT * ContourPtT(SkOpContour *contour, int id)
void DumpPt(const SkOpContour &contour, int pt)
static void dumpTestList(int testNo, double min)
void DumpSpan(const SkOpContour &contour, int span)
static void dumpTestCase(const SkDQuad &quad1, const SkDQuad &quad2, int testNo)
SkOpContour * PtTContour(SkOpPtT *ptT, int id)
const SkOpSpanBase * SpanSpan(const SkOpSpanBase *span, int id)
void DebugDumpFloat(float x)
void DumpSegments(const SkOpContour &contour, const char *prefix, SkPathOp op)
void DumpContoursPts(const SkOpContour &contour)
void DebugDumpHexFloat(float x)
SkOpContour * AngleContour(SkOpAngle *angle, int id)
SkOpContour * SegmentContour(SkOpSegment *span, int id)
void DumpContoursSpan(const SkOpContour &contour, int segmentID)
void DumpBounded(SkTSect *sect1, int id)
const SkOpAngle * SegmentAngle(const SkOpSegment *span, int id)
void DumpAll(const SkTSpan *span)
const SkOpPtT * SegmentPtT(const SkOpSegment *span, int id)
const SkOpSpanBase * CoincidenceSpan(SkOpCoincidence *coin, int id)
static bool double_is_NaN(double x)
const SkOpAngle * SpanAngle(const SkOpSpanBase *span, int id)
const SkOpSegment * SegmentSegment(const SkOpSegment *span, int id)
void DumpBoth(SkTSect *sect1, SkTSect *sect2)
void DumpCurves(const SkTSect *sect)
void DumpContoursPt(const SkOpContour &contour, int segmentID)
#define check(reporter, ref, unref, make, kill)
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static uint32_t SkFloat2Bits(float value)
static bool ok(int result)
static constexpr int32_t SK_MinS32
static constexpr int32_t SK_MaxS32
#define SkDEBUGRELEASE(a, b)
bool between(double a, double b, double c)
int SkPathOpsVerbToPoints(SkPath::Verb verb)
static void dump(const float m[20], SkYUVColorSpace cs, bool rgb2yuv)
static bool gCheckForDuplicateNames
static bool gMarkJsonFlaky
auto make(Ctor &&ctor) -> decltype(ctor(nullptr))
SkCoincidentSpans * next()
SkOpSegment * segment() const
SkOpSpanBase * end() const
const SkOpAngle * debugAngle(int id) const
void dumpOne(bool functionHeader) const
const SkOpSegment * debugSegment(int id) const
SkOpContour * debugContour(int id) const
const SkOpCoincidence * debugCoincidence() const
void dumpTo(const SkOpSegment *fromSeg, const SkOpAngle *) const
void set(SkOpSpanBase *start, SkOpSpanBase *end)
SkOpSpanBase * start() const
const SkOpSpanBase * debugSpan(int id) const
const SkOpPtT * debugPtT(int id) const
SkOpContour * debugContour(int id) const
const SkOpPtT * debugPtT(int id) const
const SkOpSpanBase * debugSpan(int id) const
const SkOpSegment * debugSegment(int id) const
const SkOpAngle * debugAngle(int id) const
SkOpGlobalState * globalState() const
const SkOpSegment * debugSegment(int id) const
SkDEBUGCODE(int fID;) SkDEBUGCODE(mutable int fDebugIndent
void dumpContoursAngles() const
const SkOpCoincidence * debugCoincidence() const
const SkOpSpanBase * debugSpan(int id) const
SkOpContour * debugContour(int id) const
void dumpContoursPts() const
void dumpContoursAll() const
void dumpContoursSpans() const
void dumpPts(const char *prefix="seg") const
void dumpSegments(const char *prefix="seg", SkPathOp op=(SkPathOp) -1) const
void dumpContours() const
void dumpSegment(int) const
void dumpContoursPt(int segmentID) const
const SkOpAngle * debugAngle(int id) const
void dumpPtsX(const char *prefix) const
void dumpContoursSpan(int segmentID) const
const SkOpPtT * debugPtT(int id) const
void dumpContoursSegment(int segmentID) const
SkArenaAlloc * allocator()
SkOpContourHead * contourHead()
const SkOpSpanBase * span() const
const SkOpPtT * next() const
int debugLoopLimit(bool report) const
const SkOpCoincidence * debugCoincidence() const
const SkOpSpanBase * debugSpan(int id) const
const SkOpSegment * segment() const
bool debugMatchID(int id) const
const SkOpPtT * debugPtT(int id) const
SkOpContour * contour() const
SkOpContour * debugContour(int id) const
const SkOpSegment * debugSegment(int id) const
const SkOpAngle * debugAngle(int id) const
SkOpContour * debugContour(int id) const
void dumpPtsInner(const char *prefix="seg") const
const SkOpPtT * debugPtT(int id) const
SkPath::Verb verb() const
const SkOpCoincidence * debugCoincidence() const
const SkOpSpanBase * tail() const
SkOpGlobalState * globalState() const
const SkOpSpan * head() const
void debugAddAngle(double startT, double endT)
const SkOpSpanBase * debugSpan(int id) const
const SkOpAngle * debugAngle(int id) const
void dumpPts(const char *prefix="seg") const
SkOpSegment * next() const
const SkOpSegment * debugSegment(int id) const
SkOpContour * contour() const
const SkOpAngle * debugAngle(int id) const
const SkOpSpanBase * coinEnd() const
const SkOpCoincidence * debugCoincidence() const
void setFromAngle(SkOpAngle *angle)
SkOpContour * contour() const
const SkOpSegment * debugSegment(int id) const
SkOpAngle * fromAngle() const
const SkOpSpanBase * debugSpan(int id) const
SkOpContour * debugContour(int id) const
const SkOpPtT * debugPtT(int id) const
const SkOpSpan * starter(const SkOpSpanBase *end) const
SkOpSegment * segment() const
const SkOpPtT * ptT() const
void setToAngle(SkOpAngle *angle)
SkOpSpanBase * next() const
bool isCoincident() const
SkOpAngle * toAngle() const
bool debugCoinLoopCheck() const
static bool ValidWind(int winding)
static void WindingPrintf(int winding)
char dumpIsCoincidentStr() const
void dumpCoinCurves() const
void dumpBoth(SkTSect *) const
void dumpBounded(int id) const
const SkTSect * debugOpp() const
void dumpBounded(int id) const
const SkTSpan * next() const
SkDEBUGCODE(SkOpGlobalState *globalState() const { return fDebugGlobalState;}) bool hasOppT(double t) const
static float min(float r, float g, float b)
SIN Vec< N, float > floor(const Vec< N, float > &x)
void dumpID(int id) const
void dumpID(int id) const
SkDPoint fPts[kPointCount]
static void Dump(const SkPoint &pt)
static void DumpHex(const SkPoint &pt)
void dumpID(int id) const
SkDPoint ptAtT(double t) const
SkDPoint fPts[kPointCount]