Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Macros | Functions | Variables
SkPathOpsDebug.cpp File Reference
#include "src/pathops/SkPathOpsDebug.h"
#include "include/core/SkPath.h"
#include "include/core/SkPathTypes.h"
#include "include/core/SkPoint.h"
#include "include/core/SkScalar.h"
#include "include/core/SkString.h"
#include "include/private/base/SkDebug.h"
#include "include/private/base/SkMath.h"
#include "include/private/base/SkMutex.h"
#include "src/core/SkPathPriv.h"
#include "src/pathops/SkIntersections.h"
#include "src/pathops/SkOpAngle.h"
#include "src/pathops/SkOpCoincidence.h"
#include "src/pathops/SkOpSegment.h"
#include "src/pathops/SkOpSpan.h"
#include "src/pathops/SkPathOpsConic.h"
#include "src/pathops/SkPathOpsCubic.h"
#include "src/pathops/SkPathOpsPoint.h"
#include "src/pathops/SkPathOpsQuad.h"
#include "src/pathops/SkPathOpsRect.h"
#include "src/pathops/SkPathOpsTypes.h"
#include <cstdint>
#include <cstring>

Go to the source code of this file.

Macros

#define FAIL_IF_COIN(cond, coin)    do { if (cond) log->record(SkPathOpsDebug::kFail_Glitch, coin); } while (false)
 
#define FAIL_WITH_NULL_IF(cond, span)    do { if (cond) log->record(SkPathOpsDebug::kFail_Glitch, span); } while (false)
 
#define RETURN_FALSE_IF(cond, span)
 
#define SUPPORT_RECT_CONTOUR_DETECTION   0
 

Functions

static void show_function_header (const char *functionName)
 
static void show_op (SkPathOp op, const char *pathOne, const char *pathTwo)
 
static void output_scalar (SkScalar num)
 
static void output_points (const SkPoint *pts, int count)
 
static void showPathContours (const SkPath &path, const char *pathName)
 
void Dump (const SkPath &path)
 
void DumpHex (const SkPath &path)
 

Variables

static const char * gOpStrs []
 
static const char * gFillTypeStr []
 

Macro Definition Documentation

◆ FAIL_IF_COIN

#define FAIL_IF_COIN (   cond,
  coin 
)     do { if (cond) log->record(SkPathOpsDebug::kFail_Glitch, coin); } while (false)

Definition at line 42 of file SkPathOpsDebug.cpp.

43 { if (cond) log->record(SkPathOpsDebug::kFail_Glitch, coin); } while (false)

◆ FAIL_WITH_NULL_IF

#define FAIL_WITH_NULL_IF (   cond,
  span 
)     do { if (cond) log->record(SkPathOpsDebug::kFail_Glitch, span); } while (false)

Definition at line 46 of file SkPathOpsDebug.cpp.

47 { if (cond) log->record(SkPathOpsDebug::kFail_Glitch, span); } while (false)

◆ RETURN_FALSE_IF

#define RETURN_FALSE_IF (   cond,
  span 
)
Value:
do { if (cond) log->record(SkPathOpsDebug::kReturnFalse_Glitch, span); \
} while (false)

Definition at line 49 of file SkPathOpsDebug.cpp.

50 { if (cond) log->record(SkPathOpsDebug::kReturnFalse_Glitch, span); \
51 } while (false)

◆ SUPPORT_RECT_CONTOUR_DETECTION

#define SUPPORT_RECT_CONTOUR_DETECTION   0

Function Documentation

◆ Dump()

void Dump ( const SkPath path)

Definition at line 3093 of file SkPathOpsDebug.cpp.

3093 {
3094 path.dump();
3095}
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot The VM snapshot data that will be memory mapped as read only SnapshotAssetPath must be present isolate snapshot The isolate snapshot data that will be memory mapped as read only SnapshotAssetPath must be present cache dir path
Definition switches.h:57

◆ DumpHex()

void DumpHex ( const SkPath path)

Definition at line 3097 of file SkPathOpsDebug.cpp.

3097 {
3098 path.dumpHex();
3099}

◆ output_points()

static void output_points ( const SkPoint pts,
int  count 
)
static

Definition at line 2808 of file SkPathOpsDebug.cpp.

2808 {
2809 for (int index = 0; index < count; ++index) {
2810 output_scalar(pts[index].fX);
2811 SkDebugf(", ");
2812 output_scalar(pts[index].fY);
2813 if (index + 1 < count) {
2814 SkDebugf(", ");
2815 }
2816 }
2817}
int count
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
static void output_scalar(SkScalar num)

◆ output_scalar()

static void output_scalar ( SkScalar  num)
static

Definition at line 2792 of file SkPathOpsDebug.cpp.

2792 {
2793 if (num == (int) num) {
2794 SkDebugf("%d", (int) num);
2795 } else {
2796 SkString str;
2797 str.printf("%1.9g", num);
2798 int width = (int) str.size();
2799 const char* cStr = str.c_str();
2800 while (cStr[width - 1] == '0') {
2801 --width;
2802 }
2803 str.resize(width);
2804 SkDebugf("%sf", str.c_str());
2805 }
2806}
Type::kYUV Type::kRGBA() int(0.7 *637)
void printf(const char format[],...) SK_PRINTF_LIKE(2
Definition SkString.cpp:534
size_t size() const
Definition SkString.h:131
void resize(size_t len)
Definition SkString.cpp:374
const char * c_str() const
Definition SkString.h:133
int32_t width

◆ show_function_header()

static void show_function_header ( const char *  functionName)
static

Definition at line 528 of file SkPathOpsDebug.cpp.

528 {
529 SkDebugf("\nstatic void %s(skiatest::Reporter* reporter, const char* filename) {\n", functionName);
530 if (strcmp("skphealth_com76", functionName) == 0) {
531 SkDebugf("found it\n");
532 }
533}

◆ show_op()

static void show_op ( SkPathOp  op,
const char *  pathOne,
const char *  pathTwo 
)
static

Definition at line 547 of file SkPathOpsDebug.cpp.

547 {
548 SkDebugf(" testPathOp(reporter, %s, %s, %s, filename);\n", pathOne, pathTwo, gOpStrs[op]);
549 SkDebugf("}\n");
550}
static const char * gOpStrs[]

◆ showPathContours()

static void showPathContours ( const SkPath path,
const char *  pathName 
)
static

Definition at line 2819 of file SkPathOpsDebug.cpp.

2819 {
2820 for (auto [verb, pts, w] : SkPathPriv::Iterate(path)) {
2821 switch (verb) {
2822 case SkPathVerb::kMove:
2823 SkDebugf(" %s.moveTo(", pathName);
2824 output_points(&pts[0], 1);
2825 SkDebugf(");\n");
2826 continue;
2827 case SkPathVerb::kLine:
2828 SkDebugf(" %s.lineTo(", pathName);
2829 output_points(&pts[1], 1);
2830 SkDebugf(");\n");
2831 break;
2832 case SkPathVerb::kQuad:
2833 SkDebugf(" %s.quadTo(", pathName);
2834 output_points(&pts[1], 2);
2835 SkDebugf(");\n");
2836 break;
2837 case SkPathVerb::kConic:
2838 SkDebugf(" %s.conicTo(", pathName);
2839 output_points(&pts[1], 2);
2840 SkDebugf(", %1.9gf);\n", *w);
2841 break;
2842 case SkPathVerb::kCubic:
2843 SkDebugf(" %s.cubicTo(", pathName);
2844 output_points(&pts[1], 3);
2845 SkDebugf(");\n");
2846 break;
2847 case SkPathVerb::kClose:
2848 SkDebugf(" %s.close();\n", pathName);
2849 break;
2850 default:
2851 SkDEBUGFAIL("bad verb");
2852 return;
2853 }
2854 }
2855}
#define SkDEBUGFAIL(message)
Definition SkAssert.h:118
static void output_points(const SkPoint *pts, int count)
@ kClose
SkPath::RawIter returns 0 points.
@ kCubic
SkPath::RawIter returns 4 points.
@ kConic
SkPath::RawIter returns 3 points + 1 weight.
@ kQuad
SkPath::RawIter returns 3 points.
@ kMove
SkPath::RawIter returns 1 point.
@ kLine
SkPath::RawIter returns 2 points.
SkScalar w

Variable Documentation

◆ gFillTypeStr

const char* gFillTypeStr[]
static
Initial value:
= {
"kWinding",
"kEvenOdd",
"kInverseWinding",
"kInverseEvenOdd"
}

Definition at line 2857 of file SkPathOpsDebug.cpp.

2857 {
2858 "kWinding",
2859 "kEvenOdd",
2860 "kInverseWinding",
2861 "kInverseEvenOdd"
2862};

◆ gOpStrs

const char* gOpStrs[]
static
Initial value:
= {
"kDifference_SkPathOp",
"kIntersect_SkPathOp",
"kUnion_SkPathOp",
"kXOR_PathOp",
"kReverseDifference_SkPathOp",
}

Definition at line 535 of file SkPathOpsDebug.cpp.

535 {
536 "kDifference_SkPathOp",
537 "kIntersect_SkPathOp",
538 "kUnion_SkPathOp",
539 "kXOR_PathOp",
540 "kReverseDifference_SkPathOp",
541};