/* * Copyright 2013 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file.
*/ #ifndef SkPathOpsDebug_DEFINED #define SkPathOpsDebug_DEFINED
class SkOpAngle; class SkOpCoincidence; class SkOpContour; class SkOpContourHead; class SkOpPtT; class SkOpSegment; class SkOpSpan; class SkOpSpanBase; class SkPath; struct SkDConic; struct SkDCubic; struct SkDLine; struct SkDPoint; struct SkDQuad;
// define this when running fuzz // #define SK_BUILD_FOR_FUZZER
#ifdef SK_RELEASE #define FORCE_RELEASE 1 #else #define FORCE_RELEASE 1 // set force release to 1 for multiple thread -- no debugging #endif
#define DEBUG_ACTIVE_OP 0 #define DEBUG_ACTIVE_SPANS 0 #define DEBUG_ADD_INTERSECTING_TS 0 #define DEBUG_ADD_T 0 #define DEBUG_ALIGNMENT 0 #define DEBUG_ANGLE 0 #define DEBUG_ASSEMBLE 0 #define DEBUG_COINCIDENCE 0 #define DEBUG_COINCIDENCE_DUMP 0 // accumulate and dump which algorithms fired #define DEBUG_COINCIDENCE_ORDER 0 // for well behaved curves, check if pairs match up in t-order #define DEBUG_COINCIDENCE_VERBOSE 0 // usually whether the next function generates coincidence #define DEBUG_CUBIC_BINARY_SEARCH 0 #define DEBUG_CUBIC_SPLIT 0 #define DEBUG_DUMP_SEGMENTS 0 #define DEBUG_DUMP_VERIFY 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_SORT 0 #define DEBUG_T_SECT 0 #define DEBUG_T_SECT_DUMP 0 #define DEBUG_T_SECT_LOOP_COUNT 0 #define DEBUG_VALIDATE 0 #define DEBUG_WINDING 0 #define DEBUG_WINDING_AT_T 0
#else
#define DEBUG_ACTIVE_OP 1 #define DEBUG_ACTIVE_SPANS 1 #define DEBUG_ADD_INTERSECTING_TS 1 #define DEBUG_ADD_T 1 #define DEBUG_ALIGNMENT 0 #define DEBUG_ANGLE 1 #define DEBUG_ASSEMBLE 1 #define DEBUG_COINCIDENCE 1 #define DEBUG_COINCIDENCE_DUMP 1 #define DEBUG_COINCIDENCE_ORDER 1 // tight arc quads may generate out-of-order coincidence spans #define DEBUG_COINCIDENCE_VERBOSE 1 #define DEBUG_CUBIC_BINARY_SEARCH 0 #define DEBUG_CUBIC_SPLIT 1 #define DEBUG_DUMP_VERIFY 1 #define DEBUG_DUMP_SEGMENTS 1 #define DEBUG_FLOW 1 #define DEBUG_LIMIT_WIND_SUM 15 #define DEBUG_MARK_DONE 1 #define DEBUG_PATH_CONSTRUCTION 1 #define DEBUG_PERP 1 #define DEBUG_SORT 1 #define DEBUG_T_SECT 0 // enabling may trigger validate asserts even though op does not fail #define DEBUG_T_SECT_DUMP 0 // Use 1 normally. Use 2 to number segments, 3 for script output #define DEBUG_T_SECT_LOOP_COUNT 0 #define DEBUG_VALIDATE 1 #define DEBUG_WINDING 1 #define DEBUG_WINDING_AT_T 1
#endif
#ifdef SK_RELEASE #define SkDEBUGRELEASE(a, b) b #define SkDEBUGPARAMS(...) #else #define SkDEBUGRELEASE(a, b) a #define SkDEBUGPARAMS(...) , __VA_ARGS__ #endif
// Tests with extreme numbers may fail, but all other tests should never fail. #define FAIL_IF(cond) \ do { bool fail = (cond); SkOPASSERT(!fail); if (fail) returnfalse; } while (false)
#define FAIL_WITH_NULL_IF(cond) \ do { bool fail = (cond); SkOPASSERT(!fail); if (fail) return nullptr; } while (false)
class SkPathOpsDebug { public: #if DEBUG_COIN struct GlitchLog;
// Visual Studio 2017 does not permit calling member functions from the Immediate Window. // Global functions work fine, however. Use globals rather than static members inside a class. const SkOpAngle* AngleAngle(const SkOpAngle*, int id);
SkOpContour* AngleContour(SkOpAngle*, int id); const SkOpPtT* AnglePtT(const SkOpAngle*, int id); const SkOpSegment* AngleSegment(const SkOpAngle*, int id); const SkOpSpanBase* AngleSpan(const SkOpAngle*, int id);
const SkOpAngle* ContourAngle(SkOpContour*, int id);
SkOpContour* ContourContour(SkOpContour*, int id); const SkOpPtT* ContourPtT(SkOpContour*, int id); const SkOpSegment* ContourSegment(SkOpContour*, int id); const SkOpSpanBase* ContourSpan(SkOpContour*, int id);
const SkOpAngle* CoincidenceAngle(SkOpCoincidence*, int id);
SkOpContour* CoincidenceContour(SkOpCoincidence*, int id); const SkOpPtT* CoincidencePtT(SkOpCoincidence*, int id); const SkOpSegment* CoincidenceSegment(SkOpCoincidence*, int id); const SkOpSpanBase* CoincidenceSpan(SkOpCoincidence*, int id);
const SkOpAngle* PtTAngle(const SkOpPtT*, int id);
SkOpContour* PtTContour(SkOpPtT*, int id); const SkOpPtT* PtTPtT(const SkOpPtT*, int id); const SkOpSegment* PtTSegment(const SkOpPtT*, int id); const SkOpSpanBase* PtTSpan(const SkOpPtT*, int id);
const SkOpAngle* SegmentAngle(const SkOpSegment*, int id);
SkOpContour* SegmentContour(SkOpSegment*, int id); const SkOpPtT* SegmentPtT(const SkOpSegment*, int id); const SkOpSegment* SegmentSegment(const SkOpSegment*, int id); const SkOpSpanBase* SegmentSpan(const SkOpSegment*, int id);
const SkOpAngle* SpanAngle(const SkOpSpanBase*, int id);
SkOpContour* SpanContour(SkOpSpanBase*, int id); const SkOpPtT* SpanPtT(const SkOpSpanBase*, int id); const SkOpSegment* SpanSegment(const SkOpSpanBase*, int id); const SkOpSpanBase* SpanSpan(const SkOpSpanBase*, int id);
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.