Flutter Engine
The Flutter Engine
Static Public Member Functions | Static Public Attributes | List of all members
SkPathOpsDebug Class Reference

#include <SkPathOpsDebug.h>

Static Public Member Functions

static const char * OpStr (SkPathOp)
 
static void MathematicaIze (char *str, size_t bufferSize)
 
static bool ValidWind (int winding)
 
static void WindingPrintf (int winding)
 
static void ShowActiveSpans (SkOpContourHead *contourList)
 
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< SkOpSpanBase * > &, const SkOpSpanBase *)
 
static void CheckHealth (class SkOpContourHead *contourList)
 

Static Public Attributes

static bool gRunFail
 
static bool gVeryVerbose
 

Detailed Description

Definition at line 233 of file SkPathOpsDebug.h.

Member Function Documentation

◆ ChaseContains()

bool SkPathOpsDebug::ChaseContains ( const SkTDArray< SkOpSpanBase * > &  chaseArray,
const SkOpSpanBase span 
)
static

Definition at line 67 of file SkPathOpsDebug.cpp.

68 {
69 for (int index = 0; index < chaseArray.size(); ++index) {
70 const SkOpSpanBase* entry = chaseArray[index];
71 if (entry == span) {
72 return true;
73 }
74 }
75 return false;
76}
int size() const
Definition: SkTDArray.h:138

◆ CheckHealth()

static void SkPathOpsDebug::CheckHealth ( class SkOpContourHead contourList)
static

◆ MathematicaIze()

void SkPathOpsDebug::MathematicaIze ( char *  str,
size_t  bufferSize 
)
static

Definition at line 497 of file SkPathOpsDebug.cpp.

497 {
498 size_t len = strlen(str);
499 bool num = false;
500 for (size_t idx = 0; idx < len; ++idx) {
501 if (num && str[idx] == 'e') {
502 if (len + 2 >= bufferLen) {
503 return;
504 }
505 memmove(&str[idx + 2], &str[idx + 1], len - idx);
506 str[idx] = '*';
507 str[idx + 1] = '^';
508 ++len;
509 }
510 num = str[idx] >= '0' && str[idx] <= '9';
511 }
512}

◆ OpStr()

const char * SkPathOpsDebug::OpStr ( SkPathOp  op)
static

Definition at line 543 of file SkPathOpsDebug.cpp.

543 {
544 return gOpStrs[op];
545}
static const char * gOpStrs[]

◆ ShowActiveSpans()

void SkPathOpsDebug::ShowActiveSpans ( SkOpContourHead contourList)
static

Definition at line 343 of file SkPathOpsDebug.cpp.

343 {
344#if DEBUG_ACTIVE_SPANS
345 SkString str;
346 SkOpContour* contour = contourList;
347 do {
348 contour->debugShowActiveSpans(&str);
349 } while ((contour = contour->next()));
350 if (!gActiveSpans.equals(str)) {
351 const char* s = str.c_str();
352 const char* end;
353 while ((end = strchr(s, '\n'))) {
354 SkDebugf("%.*s", (int) (end - s + 1), s);
355 s = end + 1;
356 }
357 gActiveSpans.set(str);
358 }
359#endif
360}
void SK_SPI SkDebugf(const char format[],...) SK_PRINTF_LIKE(1
const char * c_str() const
Definition: SkString.h:133
struct MyStruct s
glong glong end

◆ ShowOnePath()

void SkPathOpsDebug::ShowOnePath ( const SkPath path,
const char *  name,
bool  includeDeclaration 
)
static

Definition at line 2864 of file SkPathOpsDebug.cpp.

2864 {
2865#define SUPPORT_RECT_CONTOUR_DETECTION 0
2866#if SUPPORT_RECT_CONTOUR_DETECTION
2867 int rectCount = path.isRectContours() ? path.rectContours(nullptr, nullptr) : 0;
2868 if (rectCount > 0) {
2869 SkTDArray<SkRect> rects;
2870 SkTDArray<SkPathDirection> directions;
2871 rects.setCount(rectCount);
2872 directions.setCount(rectCount);
2873 path.rectContours(rects.begin(), directions.begin());
2874 for (int contour = 0; contour < rectCount; ++contour) {
2875 const SkRect& rect = rects[contour];
2876 SkDebugf("path.addRect(%1.9g, %1.9g, %1.9g, %1.9g, %s);\n", rect.fLeft, rect.fTop,
2877 rect.fRight, rect.fBottom, directions[contour] == SkPathDirection::kCCW
2878 ? "SkPathDirection::kCCW" : "SkPathDirection::kCW");
2879 }
2880 return;
2881 }
2882#endif
2883 SkPathFillType fillType = path.getFillType();
2885 if (includeDeclaration) {
2886 SkDebugf(" SkPath %s;\n", name);
2887 }
2888 SkDebugf(" %s.setFillType(SkPath::%s);\n", name, gFillTypeStr[(int)fillType]);
2890}
#define SkASSERT(cond)
Definition: SkAssert.h:116
static const char * gFillTypeStr[]
static void showPathContours(const SkPath &path, const char *pathName)
SkPathFillType
Definition: SkPathTypes.h:11
T * begin()
Definition: SkTDArray.h:150
sk_sp< SkBlender > blender SkRect rect
Definition: SkRecords.h:350
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
DEF_SWITCHES_START aot vmservice shared library name
Definition: switches.h:32

◆ ShowPath()

void SkPathOpsDebug::ShowPath ( const SkPath one,
const SkPath two,
SkPathOp  op,
const char *  name 
)
static

Definition at line 552 of file SkPathOpsDebug.cpp.

553 {
554 static SkMutex& mutex = *(new SkMutex);
555
556 SkAutoMutexExclusive ac(mutex);
558 ShowOnePath(a, "path", true);
559 ShowOnePath(b, "pathB", true);
560 show_op(shapeOp, "path", "pathB");
561}
static void show_op(SkPathOp op, const char *pathOne, const char *pathTwo)
static void show_function_header(const char *functionName)
static void ShowOnePath(const SkPath &path, const char *name, bool includeDeclaration)
static bool b
struct MyStruct a[10]

◆ ValidWind()

bool SkPathOpsDebug::ValidWind ( int  winding)
static

Definition at line 514 of file SkPathOpsDebug.cpp.

514 {
515 return wind > SK_MinS32 + 0xFFFF && wind < SK_MaxS32 - 0xFFFF;
516}
static constexpr int32_t SK_MinS32
Definition: SkMath.h:22
static constexpr int32_t SK_MaxS32
Definition: SkMath.h:21

◆ WindingPrintf()

void SkPathOpsDebug::WindingPrintf ( int  winding)
static

Definition at line 518 of file SkPathOpsDebug.cpp.

518 {
519 if (wind == SK_MinS32) {
520 SkDebugf("?");
521 } else {
522 SkDebugf("%d", wind);
523 }
524}

Member Data Documentation

◆ gRunFail

bool SkPathOpsDebug::gRunFail
static

Definition at line 311 of file SkPathOpsDebug.h.

◆ gVeryVerbose

bool SkPathOpsDebug::gVeryVerbose
static

Definition at line 312 of file SkPathOpsDebug.h.


The documentation for this class was generated from the following files: