Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions | Variables
PathOpsOpCircleThreadedTest.cpp File Reference
#include "include/core/SkPath.h"
#include "include/core/SkPathTypes.h"
#include "include/core/SkScalar.h"
#include "include/core/SkString.h"
#include "include/core/SkTypes.h"
#include "include/pathops/SkPathOps.h"
#include "include/private/base/SkTDArray.h"
#include "src/pathops/SkPathOpsDebug.h"
#include "tests/PathOpsDebug.h"
#include "tests/PathOpsExtendedTest.h"
#include "tests/PathOpsThreadedCommon.h"
#include "tests/Test.h"
#include <atomic>

Go to the source code of this file.

Functions

static void testOpCirclesMain (PathOpsThreadState *data)
 
 DEF_TEST (PathOpsOpCircleThreaded, reporter)
 

Variables

static int loopNo = 4
 
static std::atomic< intgCirclesTestNo {0}
 

Function Documentation

◆ DEF_TEST()

DEF_TEST ( PathOpsOpCircleThreaded  ,
reporter   
)

Definition at line 83 of file PathOpsOpCircleThreadedTest.cpp.

83 {
84 initializeTests(reporter, "circleOp");
86 for (int a = 0; a < 6; ++a) { // outermost
87 for (int b = a + 1; b < 7; ++b) {
88 for (int c = 0 ; c < 6; ++c) {
89 for (int d = 0; d < 2; ++d) {
90 *testRunner.fRunnables.append() = new PathOpsThreadedRunnable(
91 &testOpCirclesMain, a, b, c, d, &testRunner);
92 }
93 }
94 if (!reporter->allowExtendedTest()) goto finish;
95 }
96 }
97finish:
98 testRunner.render();
99}
reporter
void initializeTests(skiatest::Reporter *reporter, const char *test)
static void testOpCirclesMain(PathOpsThreadState *data)
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition main.cc:19
static bool b
struct MyStruct a[10]

◆ testOpCirclesMain()

static void testOpCirclesMain ( PathOpsThreadState data)
static

Definition at line 26 of file PathOpsOpCircleThreadedTest.cpp.

26 {
27 SkASSERT(data);
30 SkString pathStr;
31 for (int a = 0 ; a < 6; ++a) {
32 for (int b = a + 1 ; b < 7; ++b) {
33 for (int c = 0 ; c < 6; ++c) {
34 for (int d = c + 1 ; d < 7; ++d) {
35 for (auto e : fts) {
36 for (auto f : fts) {
37 SkPath pathA, pathB;
38 pathA.setFillType(e);
41 pathB.setFillType(f);
44 for (int op = 0 ; op <= kXOR_SkPathOp; ++op) {
45 if (state.fReporter->verbose()) {
46 pathStr.printf("static void circlesOp%d(skiatest::Reporter* reporter,"
47 " const char* filename) {\n", loopNo);
48 pathStr.appendf(" SkPath path, pathB;\n");
49 pathStr.appendf(" path.setFillType(SkPathFillType::k%s);\n",
51 ? "EvenOdd" : "?UNDEFINED");
52 pathStr.appendf(" path.addCircle(%d, %d, %d, %s);\n", state.fA, state.fB,
53 state.fC, state.fD ? "SkPathDirection::kCW" : "SkPathDirection::kCCW");
54 pathStr.appendf(" pathB.setFillType(SkPathFillType::k%s);\n",
56 ? "EvenOdd" : "?UNDEFINED");
57 pathStr.appendf(" pathB.addCircle(%d, %d, %d, %s);\n", a, b,
58 c, d ? "SkPathDirection::kCW" : "SkPathDirection::kCCW");
59 pathStr.appendf(" testPathOp(reporter, path, pathB, %s, filename);\n",
61 pathStr.appendf("}\n");
62 state.outputProgress(pathStr.c_str(), (SkPathOp) op);
63 }
65 testName.printf("thread_circles%d", ++gCirclesTestNo);
66 if (!testPathOp(state.fReporter, pathA, pathB, (SkPathOp) op, testName.c_str())) {
67 if (state.fReporter->verbose()) {
68 ++loopNo;
69 goto skipToNext;
70 }
71 }
73 }
74 }
75 }
76skipToNext: ;
77 }
78 }
79 }
80 }
81}
bool testPathOp(skiatest::Reporter *reporter, const SkPath &a, const SkPath &b, const SkPathOp shapeOp, const char *testName)
static int loopNo
static std::atomic< int > gCirclesTestNo
#define SkASSERT(cond)
Definition SkAssert.h:116
SkPathOp
Definition SkPathOps.h:22
@ kXOR_SkPathOp
exclusive-or the two paths
Definition SkPathOps.h:26
SkPathDirection
Definition SkPathTypes.h:34
SkPathFillType
Definition SkPathTypes.h:11
#define SkIntToScalar(x)
Definition SkScalar.h:57
static bool gCheckForDuplicateNames
static const char * OpStr(SkPathOp)
SkPath & addCircle(SkScalar x, SkScalar y, SkScalar radius, SkPathDirection dir=SkPathDirection::kCW)
Definition SkPath.cpp:1149
void setFillType(SkPathFillType ft)
Definition SkPath.h:235
void printf(const char format[],...) SK_PRINTF_LIKE(2
Definition SkString.cpp:534
const char * c_str() const
Definition SkString.h:133
void void void appendf(const char format[],...) SK_PRINTF_LIKE(2
Definition SkString.cpp:550
AtkStateType state
DEF_SWITCHES_START aot vmservice shared library Name of the *so containing AOT compiled Dart assets for launching the service isolate vm snapshot data
Definition switches.h:41

Variable Documentation

◆ gCirclesTestNo

std::atomic<int> gCirclesTestNo {0}
static

Definition at line 24 of file PathOpsOpCircleThreadedTest.cpp.

24{0};

◆ loopNo

int loopNo = 4
static

Definition at line 23 of file PathOpsOpCircleThreadedTest.cpp.