skia2/tests/PathOpsTSectDebug.h
reed 0dc4dd6dda Revert of pathops version two (patchset #16 id:150001 of https://codereview.chromium.org/1002693002/)
Reason for revert:
ASAN investigation

Original issue's description:
> pathops version two
>
> R=reed@google.com
>
> marked 'no commit' to attempt to get trybots to run
>
> TBR=reed@google.com
>
> Committed: https://skia.googlesource.com/skia/+/ccec0f958ffc71a9986d236bc2eb335cb2111119

TBR=caryclark@google.com
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true

Review URL: https://codereview.chromium.org/1029993002
2015-03-24 13:55:33 -07:00

85 lines
1.9 KiB
C++

/*
* Copyright 2014 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "SkPathOpsTSect.h"
template<typename TCurve>
void SkTSect<TCurve>::dump() const {
SkDebugf("id=%d", debugID());
const SkTSpan<TCurve>* test = fHead;
if (!test) {
SkDebugf(" (empty)");
return;
}
do {
SkDebugf(" ");
test->dump(this);
} while ((test = test->next()));
}
template<typename TCurve>
void SkTSect<TCurve>::dumpBoth(const SkTSect& opp) const {
dump();
SkDebugf(" ");
opp.dump();
SkDebugf("\n");
}
template<typename TCurve>
void SkTSect<TCurve>::dumpBoth(const SkTSect* opp) const {
dumpBoth(*opp);
}
template<typename TCurve>
void SkTSect<TCurve>::dumpCurves() const {
const SkTSpan<TCurve>* test = fHead;
do {
test->fPart.dump();
} while ((test = test->next()));
}
#if !DEBUG_T_SECT
template<typename TCurve>
int SkTSpan<TCurve>::debugID(const SkTSect<TCurve>* sect) const {
if (!sect) {
return -1;
}
int id = 1;
const SkTSpan* test = sect->fHead;
while (test && test != this) {
++id;
test = test->fNext;
}
return id;
}
#endif
template<typename TCurve>
void SkTSpan<TCurve>::dumpID(const SkTSect<TCurve>* sect) const {
if (fCoinStart.isCoincident()) {
SkDebugf("%c", '*');
}
SkDebugf("%d", debugID(sect));
if (fCoinEnd.isCoincident()) {
SkDebugf("%c", '*');
}
}
template<typename TCurve>
void SkTSpan<TCurve>::dump(const SkTSect<TCurve>* sect) const {
dumpID(sect);
SkDebugf("=(%g,%g) [", fStartT, fEndT);
for (int index = 0; index < fBounded.count(); ++index) {
SkTSpan* span = fBounded[index];
span->dumpID(sect);
if (index < fBounded.count() - 1) {
SkDebugf(",");
}
}
SkDebugf("]");
}