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

Unified Diff: src/pathops/SkPathOpsDebug.h

Issue 1029993002: Revert of pathops version two (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 5 years, 9 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 | « src/pathops/SkPathOpsCubicSect.h ('k') | src/pathops/SkPathOpsDebug.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/pathops/SkPathOpsDebug.h
diff --git a/src/pathops/SkPathOpsDebug.h b/src/pathops/SkPathOpsDebug.h
index 72a9ea528f65be7fec1ea1090035f4598957c7ed..5770aefec50c83dad3b0adc23dbb686d5b5c426d 100644
--- a/src/pathops/SkPathOpsDebug.h
+++ b/src/pathops/SkPathOpsDebug.h
@@ -39,22 +39,35 @@
#define DEBUG_ACTIVE_OP 0
#define DEBUG_ACTIVE_SPANS 0
+#define DEBUG_ACTIVE_SPANS_FIRST_ONLY 0
+#define DEBUG_ACTIVE_SPANS_SHORT_FORM 1
#define DEBUG_ADD_INTERSECTING_TS 0
-#define DEBUG_ADD_T 0
+#define DEBUG_ADD_T_PAIR 0
#define DEBUG_ANGLE 0
+#define DEBUG_AS_C_CODE 1
#define DEBUG_ASSEMBLE 0
+#define DEBUG_CHECK_ALIGN 0
+#define DEBUG_CHECK_TINY 0
+#define DEBUG_CONCIDENT 0
+#define DEBUG_CROSS 0
#define DEBUG_CUBIC_BINARY_SEARCH 0
+#define DEBUG_DUPLICATES 0
+#define DEBUG_FLAT_QUADS 0
#define DEBUG_FLOW 0
#define DEBUG_LIMIT_WIND_SUM 0
#define DEBUG_MARK_DONE 0
#define DEBUG_PATH_CONSTRUCTION 0
-#define DEBUG_PERP 0
#define DEBUG_SHOW_TEST_NAME 0
+#define DEBUG_SHOW_TEST_PROGRESS 0
+#define DEBUG_SHOW_WINDING 0
#define DEBUG_SORT 0
+#define DEBUG_SORT_COMPACT 0
+#define DEBUG_SORT_RAW 0
+#define DEBUG_SORT_SINGLE 0
#define DEBUG_SWAP_TOP 0
-#define DEBUG_T_SECT 0
-#define DEBUG_T_SECT_DUMP 0
+#define DEBUG_UNSORTABLE 0
#define DEBUG_VALIDATE 0
+#define DEBUG_WIND_BUMP 0
#define DEBUG_WINDING 0
#define DEBUG_WINDING_AT_T 0
@@ -62,56 +75,51 @@
#define DEBUG_ACTIVE_OP 1
#define DEBUG_ACTIVE_SPANS 1
+#define DEBUG_ACTIVE_SPANS_FIRST_ONLY 0
+#define DEBUG_ACTIVE_SPANS_SHORT_FORM 1
#define DEBUG_ADD_INTERSECTING_TS 1
-#define DEBUG_ADD_T 1
+#define DEBUG_ADD_T_PAIR 1
#define DEBUG_ANGLE 1
+#define DEBUG_AS_C_CODE 1
#define DEBUG_ASSEMBLE 1
+#define DEBUG_CHECK_ALIGN 1
+#define DEBUG_CHECK_TINY 1
+#define DEBUG_CONCIDENT 1
+#define DEBUG_CROSS 01
#define DEBUG_CUBIC_BINARY_SEARCH 0
+#define DEBUG_DUPLICATES 1
+#define DEBUG_FLAT_QUADS 0
#define DEBUG_FLOW 1
-#define DEBUG_LIMIT_WIND_SUM 5
+#define DEBUG_LIMIT_WIND_SUM 4
#define DEBUG_MARK_DONE 1
#define DEBUG_PATH_CONSTRUCTION 1
-#define DEBUG_PERP 0
#define DEBUG_SHOW_TEST_NAME 1
+#define DEBUG_SHOW_TEST_PROGRESS 1
+#define DEBUG_SHOW_WINDING 0
#define DEBUG_SORT 1
+#define DEBUG_SORT_COMPACT 0
+#define DEBUG_SORT_RAW 0
+#define DEBUG_SORT_SINGLE 0
#define DEBUG_SWAP_TOP 1
-#define DEBUG_T_SECT 1
-#define DEBUG_T_SECT_DUMP 02
-#define DEBUG_VALIDATE 1
+#define DEBUG_UNSORTABLE 1
+#define DEBUG_VALIDATE 0
+#define DEBUG_WIND_BUMP 0
#define DEBUG_WINDING 1
#define DEBUG_WINDING_AT_T 1
#endif
-#ifdef SK_RELEASE
- #define PATH_OPS_DEBUG_RELEASE(a, b) b
- #define PATH_OPS_DEBUG_CODE(...)
- #define PATH_OPS_DEBUG_PARAMS(...)
-#else
- #define PATH_OPS_DEBUG_RELEASE(a, b) a
- #define PATH_OPS_DEBUG_CODE(...) __VA_ARGS__
- #define PATH_OPS_DEBUG_PARAMS(...) , __VA_ARGS__
-#endif
-
-#if DEBUG_T_SECT == 0
- #define PATH_OPS_DEBUG_T_SECT_RELEASE(a, b) b
- #define PATH_OPS_DEBUG_T_SECT_PARAMS(...)
- #define PATH_OPS_DEBUG_T_SECT_CODE(...)
-#else
- #define PATH_OPS_DEBUG_T_SECT_RELEASE(a, b) a
- #define PATH_OPS_DEBUG_T_SECT_PARAMS(...) , __VA_ARGS__
- #define PATH_OPS_DEBUG_T_SECT_CODE(...) __VA_ARGS__
-#endif
-
-#if DEBUG_T_SECT_DUMP > 1
- extern int gDumpTSectNum;
-#endif
-
-#define CUBIC_DEBUG_STR "{{{%1.9g,%1.9g}, {%1.9g,%1.9g}, {%1.9g,%1.9g}, {%1.9g,%1.9g}}}"
-#define QUAD_DEBUG_STR "{{{%1.9g,%1.9g}, {%1.9g,%1.9g}, {%1.9g,%1.9g}}}"
-#define LINE_DEBUG_STR "{{{%1.9g,%1.9g}, {%1.9g,%1.9g}}}"
+#if DEBUG_AS_C_CODE
+#define CUBIC_DEBUG_STR "{{%1.9g,%1.9g}, {%1.9g,%1.9g}, {%1.9g,%1.9g}, {%1.9g,%1.9g}}"
+#define QUAD_DEBUG_STR "{{%1.9g,%1.9g}, {%1.9g,%1.9g}, {%1.9g,%1.9g}}"
+#define LINE_DEBUG_STR "{{%1.9g,%1.9g}, {%1.9g,%1.9g}}"
#define PT_DEBUG_STR "{{%1.9g,%1.9g}}"
-
+#else
+#define CUBIC_DEBUG_STR "(%1.9g,%1.9g %1.9g,%1.9g %1.9g,%1.9g %1.9g,%1.9g)"
+#define QUAD_DEBUG_STR "(%1.9g,%1.9g %1.9g,%1.9g %1.9g,%1.9g)"
+#define LINE_DEBUG_STR "(%1.9g,%1.9g %1.9g,%1.9g)"
+#define PT_DEBUG_STR "(%1.9g,%1.9g)"
+#endif
#define T_DEBUG_STR(t, n) #t "[" #n "]=%1.9g"
#define TX_DEBUG_STR(t) #t "[%d]=%1.9g"
#define CUBIC_DEBUG_DATA(c) c[0].fX, c[0].fY, c[1].fX, c[1].fY, c[2].fX, c[2].fY, c[3].fX, c[3].fY
@@ -127,6 +135,7 @@
#include "SkTLS.h"
#endif
+#include "SkTArray.h"
#include "SkTDArray.h"
class SkPathOpsDebug {
@@ -147,6 +156,7 @@
static const char* kPathOpStr[];
#endif
+ static bool ChaseContains(const SkTDArray<struct SkOpSpan *>& , const struct SkOpSpan * );
static void MathematicaIze(char* str, size_t bufferSize);
static bool ValidWind(int winding);
static void WindingPrintf(int winding);
@@ -161,96 +171,66 @@
#endif
static void ShowOnePath(const SkPath& path, const char* name, bool includeDeclaration);
static void ShowPath(const SkPath& one, const SkPath& two, SkPathOp op, const char* name);
-
- static bool ChaseContains(const SkTDArray<class SkOpSpanBase*>& , const class SkOpSpanBase* );
-
- static const struct SkOpAngle* DebugAngleAngle(const struct SkOpAngle*, int id);
- static class SkOpContour* DebugAngleContour(struct SkOpAngle*, int id);
- static const class SkOpPtT* DebugAnglePtT(const struct SkOpAngle*, int id);
- static const class SkOpSegment* DebugAngleSegment(const struct SkOpAngle*, int id);
- static const class SkOpSpanBase* DebugAngleSpan(const struct SkOpAngle*, int id);
-
- static const struct SkOpAngle* DebugContourAngle(class SkOpContour*, int id);
- static class SkOpContour* DebugContourContour(class SkOpContour*, int id);
- static const class SkOpPtT* DebugContourPtT(class SkOpContour*, int id);
- static const class SkOpSegment* DebugContourSegment(class SkOpContour*, int id);
- static const class SkOpSpanBase* DebugContourSpan(class SkOpContour*, int id);
-
- static const struct SkOpAngle* DebugPtTAngle(const class SkOpPtT*, int id);
- static class SkOpContour* DebugPtTContour(class SkOpPtT*, int id);
- static const class SkOpPtT* DebugPtTPtT(const class SkOpPtT*, int id);
- static const class SkOpSegment* DebugPtTSegment(const class SkOpPtT*, int id);
- static const class SkOpSpanBase* DebugPtTSpan(const class SkOpPtT*, int id);
-
- static const struct SkOpAngle* DebugSegmentAngle(const class SkOpSegment*, int id);
- static class SkOpContour* DebugSegmentContour(class SkOpSegment*, int id);
- static const class SkOpPtT* DebugSegmentPtT(const class SkOpSegment*, int id);
- static const class SkOpSegment* DebugSegmentSegment(const class SkOpSegment*, int id);
- static const class SkOpSpanBase* DebugSegmentSpan(const class SkOpSegment*, int id);
-
- static const struct SkOpAngle* DebugSpanAngle(const class SkOpSpanBase*, int id);
- static class SkOpContour* DebugSpanContour(class SkOpSpanBase*, int id);
- static const class SkOpPtT* DebugSpanPtT(const class SkOpSpanBase*, int id);
- static const class SkOpSegment* DebugSpanSegment(const class SkOpSpanBase*, int id);
- static const class SkOpSpanBase* DebugSpanSpan(const class SkOpSpanBase*, int id);
-
- static void DumpContours(SkTDArray<class SkOpContour* >* contours);
- static void DumpContoursAll(SkTDArray<class SkOpContour* >* contours);
- static void DumpContoursAngles(const SkTDArray<class SkOpContour* >* contours);
- static void DumpContoursPt(const SkTDArray<class SkOpContour* >* contours, int id);
- static void DumpContoursPts(const SkTDArray<class SkOpContour* >* contours);
- static void DumpContoursSegment(const SkTDArray<class SkOpContour* >* contours, int id);
- static void DumpContoursSpan(const SkTDArray<class SkOpContour* >* contours, int id);
- static void DumpContoursSpans(const SkTDArray<class SkOpContour* >* contours);
+ static void DumpCoincidence(const SkTArray<class SkOpContour, true>& contours);
+ static void DumpCoincidence(const SkTArray<class SkOpContour* , true>& contours);
+ static void DumpContours(const SkTArray<class SkOpContour, true>& contours);
+ static void DumpContours(const SkTArray<class SkOpContour* , true>& contours);
+ static void DumpContourAngles(const SkTArray<class SkOpContour, true>& contours);
+ static void DumpContourAngles(const SkTArray<class SkOpContour* , true>& contours);
+ static void DumpContourPt(const SkTArray<class SkOpContour, true>& contours, int id);
+ static void DumpContourPt(const SkTArray<class SkOpContour* , true>& contours, int id);
+ static void DumpContourPts(const SkTArray<class SkOpContour, true>& contours);
+ static void DumpContourPts(const SkTArray<class SkOpContour* , true>& contours);
+ static void DumpContourSpan(const SkTArray<class SkOpContour, true>& contours, int id);
+ static void DumpContourSpan(const SkTArray<class SkOpContour* , true>& contours, int id);
+ static void DumpContourSpans(const SkTArray<class SkOpContour, true>& contours);
+ static void DumpContourSpans(const SkTArray<class SkOpContour* , true>& contours);
+ static void DumpSpans(const SkTDArray<struct SkOpSpan *>& );
+ static void DumpSpans(const SkTDArray<struct SkOpSpan *>* );
};
// shorthand for calling from debugger
-template<typename TCurve> class SkTSect;
-template<typename TCurve> class SkTSpan;
-
-struct SkDQuad;
-struct SkDCubic;
-
-const SkTSpan<SkDCubic>* DebugSpan(const SkTSect<SkDCubic>* , int id);
-const SkTSpan<SkDQuad>* DebugSpan(const SkTSect<SkDQuad>* , int id);
-const SkTSpan<SkDCubic>* DebugT(const SkTSect<SkDCubic>* , double t);
-const SkTSpan<SkDQuad>* DebugT(const SkTSect<SkDQuad>* , double t);
-
-const SkTSpan<SkDCubic>* DebugSpan(const SkTSpan<SkDCubic>* , int id);
-const SkTSpan<SkDQuad>* DebugSpan(const SkTSpan<SkDQuad>* , int id);
-const SkTSpan<SkDCubic>* DebugT(const SkTSpan<SkDCubic>* , double t);
-const SkTSpan<SkDQuad>* DebugT(const SkTSpan<SkDQuad>* , double t);
-
-void Dump(const SkTSect<SkDCubic>* );
-void Dump(const SkTSect<SkDQuad>* );
-void Dump(const SkTSpan<SkDCubic>* , const SkTSect<SkDCubic>* = NULL);
-void Dump(const SkTSpan<SkDQuad>* , const SkTSect<SkDQuad>* = NULL);
-void DumpBoth(SkTSect<SkDCubic>* sect1, SkTSect<SkDCubic>* sect2);
-void DumpBoth(SkTSect<SkDQuad>* sect1, SkTSect<SkDQuad>* sect2);
-void DumpCoin(SkTSect<SkDCubic>* sect1);
-void DumpCoin(SkTSect<SkDQuad>* sect1);
-void DumpCoinCurves(SkTSect<SkDCubic>* sect1);
-void DumpCoinCurves(SkTSect<SkDQuad>* sect1);
-void DumpCurves(const SkTSpan<SkDCubic>* );
-void DumpCurves(const SkTSpan<SkDQuad>* );
+void Dump(const SkTArray<class SkOpContour, true>& contours);
+void Dump(const SkTArray<class SkOpContour* , true>& contours);
+void Dump(const SkTArray<class SkOpContour, true>* contours);
+void Dump(const SkTArray<class SkOpContour* , true>* contours);
+
+void Dump(const SkTDArray<SkOpSpan* >& chase);
+void Dump(const SkTDArray<SkOpSpan* >* chase);
+
+void DumpAngles(const SkTArray<class SkOpContour, true>& contours);
+void DumpAngles(const SkTArray<class SkOpContour* , true>& contours);
+void DumpAngles(const SkTArray<class SkOpContour, true>* contours);
+void DumpAngles(const SkTArray<class SkOpContour* , true>* contours);
+
+void DumpCoin(const SkTArray<class SkOpContour, true>& contours);
+void DumpCoin(const SkTArray<class SkOpContour* , true>& contours);
+void DumpCoin(const SkTArray<class SkOpContour, true>* contours);
+void DumpCoin(const SkTArray<class SkOpContour* , true>* contours);
+
+void DumpPts(const SkTArray<class SkOpContour, true>& contours);
+void DumpPts(const SkTArray<class SkOpContour* , true>& contours);
+void DumpPts(const SkTArray<class SkOpContour, true>* contours);
+void DumpPts(const SkTArray<class SkOpContour* , true>* contours);
+
+void DumpPt(const SkTArray<class SkOpContour, true>& contours, int segmentID);
+void DumpPt(const SkTArray<class SkOpContour* , true>& contours, int segmentID);
+void DumpPt(const SkTArray<class SkOpContour, true>* contours, int segmentID);
+void DumpPt(const SkTArray<class SkOpContour* , true>* contours, int segmentID);
+
+void DumpSpans(const SkTArray<class SkOpContour, true>& contours);
+void DumpSpans(const SkTArray<class SkOpContour* , true>& contours);
+void DumpSpans(const SkTArray<class SkOpContour, true>* contours);
+void DumpSpans(const SkTArray<class SkOpContour* , true>* contours);
+
+void DumpSpan(const SkTArray<class SkOpContour, true>& contours, int segmentID);
+void DumpSpan(const SkTArray<class SkOpContour* , true>& contours, int segmentID);
+void DumpSpan(const SkTArray<class SkOpContour, true>* contours, int segmentID);
+void DumpSpan(const SkTArray<class SkOpContour* , true>* contours, int segmentID);
// generates tools/path_sorter.htm and path_visualizer.htm compatible data
-void DumpQ(const SkDQuad& quad1, const SkDQuad& quad2, int testNo);
-void DumpT(const SkDQuad& quad, double t);
-
-const struct SkOpAngle* DebugAngle(const SkTDArray<class SkOpContour* >* contours, int id);
-class SkOpContour* DebugContour(const SkTDArray<class SkOpContour* >* contours, int id);
-const class SkOpPtT* DebugPtT(const SkTDArray<class SkOpContour* >* contours, int id);
-const class SkOpSegment* DebugSegment(const SkTDArray<class SkOpContour* >* contours, int id);
-const class SkOpSpanBase* DebugSpan(const SkTDArray<class SkOpContour* >* contours, int id);
-
-void Dump(const SkTDArray<class SkOpContour* >* contours);
-void DumpAll(SkTDArray<class SkOpContour* >* contours);
-void DumpAngles(const SkTDArray<class SkOpContour* >* contours);
-void DumpCoin(const SkTDArray<class SkOpContour* >* contours);
-void DumpPt(const SkTDArray<class SkOpContour* >* contours, int segmentID);
-void DumpPts(const SkTDArray<class SkOpContour* >* contours);
-void DumpSegment(const SkTDArray<class SkOpContour* >* contours, int segmentID);
-void DumpSpan(const SkTDArray<class SkOpContour* >* contours, int spanID);
-void DumpSpans(const SkTDArray<class SkOpContour* >* contours);
-#endif
+void DumpQ(const struct SkDQuad& quad1, const struct SkDQuad& quad2, int testNo);
+
+void DumpT(const struct SkDQuad& quad, double t);
+
+#endif
« no previous file with comments | « src/pathops/SkPathOpsCubicSect.h ('k') | src/pathops/SkPathOpsDebug.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698