Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(648)

Unified Diff: tests/PathOpsTSectDebug.h

Issue 853223002: new files for pathops geometric intersection (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove visualizer tool so cl contains only pure adds Created 5 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « tests/PathOpsBuilderTest.cpp ('k') | tests/PathOpsThreeWayTest.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tests/PathOpsTSectDebug.h
diff --git a/tests/PathOpsTSectDebug.h b/tests/PathOpsTSectDebug.h
new file mode 100644
index 0000000000000000000000000000000000000000..5f8915f68123778a857c7abea9e99286ab10f33d
--- /dev/null
+++ b/tests/PathOpsTSectDebug.h
@@ -0,0 +1,84 @@
+/*
+ * 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("]");
+}
« no previous file with comments | « tests/PathOpsBuilderTest.cpp ('k') | tests/PathOpsThreeWayTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698