Flutter Engine
The Flutter Engine
Functions | Variables
PathOpsOpCubicThreadedTest.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 testOpCubicsMain (PathOpsThreadState *data)
 
 DEF_TEST (PathOpsOpCubicsThreaded, reporter)
 

Variables

static int loopNo = 158
 
static std::atomic< intgCubicsTestNo {0}
 

Function Documentation

◆ DEF_TEST()

DEF_TEST ( PathOpsOpCubicsThreaded  ,
reporter   
)

Definition at line 90 of file PathOpsOpCubicThreadedTest.cpp.

90 {
91 initializeTests(reporter, "cubicOp");
93 for (int a = 0; a < 6; ++a) { // outermost
94 for (int b = a + 1; b < 7; ++b) {
95 for (int c = 0 ; c < 6; ++c) {
96 for (int d = c + 1; d < 7; ++d) {
97 *testRunner.fRunnables.append() =
98 new PathOpsThreadedRunnable(&testOpCubicsMain, a, b, c, d, &testRunner);
99 }
100 }
101 if (!reporter->allowExtendedTest()) goto finish;
102 }
103 }
104finish:
105 testRunner.render();
106}
reporter
Definition: FontMgrTest.cpp:39
void initializeTests(skiatest::Reporter *reporter, const char *test)
static void testOpCubicsMain(PathOpsThreadState *data)
VULKAN_HPP_DEFAULT_DISPATCH_LOADER_DYNAMIC_STORAGE auto & d
Definition: main.cc:19
static bool b
struct MyStruct a[10]

◆ testOpCubicsMain()

static void testOpCubicsMain ( PathOpsThreadState data)
static

Definition at line 25 of file PathOpsOpCubicThreadedTest.cpp.

25 {
29 SkString pathStr;
30 for (int a = 0 ; a < 6; ++a) {
31 for (int b = a + 1 ; b < 7; ++b) {
32 for (int c = 0 ; c < 6; ++c) {
33 for (int d = c + 1 ; d < 7; ++d) {
34 for (auto e : fts) {
35 for (auto f : fts) {
36 SkPath pathA, pathB;
41 pathA.close();
46 pathB.close();
47 for (int op = 0 ; op <= kXOR_SkPathOp; ++op) {
48 if (state.fReporter->verbose()) {
49 pathStr.printf("static void cubicOp%d(skiatest::Reporter* reporter,"
50 " const char* filename) {\n", loopNo);
51 pathStr.appendf(" SkPath path, pathB;\n");
52 pathStr.appendf(" path.setFillType(SkPathFillType::k%s);\n",
54 ? "EvenOdd" : "?UNDEFINED");
55 pathStr.appendf(" path.moveTo(%d,%d);\n", state.fA, state.fB);
56 pathStr.appendf(" path.cubicTo(%d,%d, %d,%d, %d,%d);\n", state.fC, state.fD,
57 b, a, d, c);
58 pathStr.appendf(" path.close();\n");
59 pathStr.appendf(" pathB.setFillType(SkPathFillType::k%s);\n",
61 ? "EvenOdd" : "?UNDEFINED");
62 pathStr.appendf(" pathB.moveTo(%d,%d);\n", a, b);
63 pathStr.appendf(" pathB.cubicTo(%d,%d, %d,%d, %d,%d);\n", c, d,
64 state.fB, state.fA, state.fD, state.fC);
65 pathStr.appendf(" pathB.close();\n");
66 pathStr.appendf(" testPathOp(reporter, path, pathB, %s, filename);\n",
68 pathStr.appendf("}\n");
69 state.outputProgress(pathStr.c_str(), (SkPathOp) op);
70 }
72 testName.printf("thread_cubics%d", ++gCubicsTestNo);
73 if (!testPathOp(state.fReporter, pathA, pathB, (SkPathOp) op, testName.c_str())) {
74 if (state.fReporter->verbose()) {
75 ++loopNo;
76 goto skipToNext;
77 }
78 }
80 }
81 }
82 }
83skipToNext: ;
84 }
85 }
86 }
87 }
88}
bool testPathOp(skiatest::Reporter *reporter, const SkPath &a, const SkPath &b, const SkPathOp shapeOp, const char *testName)
static int loopNo
static std::atomic< int > gCubicsTestNo
#define SkASSERT(cond)
Definition: SkAssert.h:116
SkPathOp
Definition: SkPathOps.h:22
@ kXOR_SkPathOp
exclusive-or the two paths
Definition: SkPathOps.h:26
SkPathFillType
Definition: SkPathTypes.h:11
#define SkIntToScalar(x)
Definition: SkScalar.h:57
static bool gCheckForDuplicateNames
Definition: PathOpsDebug.h:18
static const char * OpStr(SkPathOp)
Definition: SkPath.h:59
SkPath & moveTo(SkScalar x, SkScalar y)
Definition: SkPath.cpp:688
void setFillType(SkPathFillType ft)
Definition: SkPath.h:235
SkPath & cubicTo(SkScalar x1, SkScalar y1, SkScalar x2, SkScalar y2, SkScalar x3, SkScalar y3)
Definition: SkPath.cpp:799
SkPath & close()
Definition: SkPath.cpp:823
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
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

Variable Documentation

◆ gCubicsTestNo

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

Definition at line 23 of file PathOpsOpCubicThreadedTest.cpp.

◆ loopNo

int loopNo = 158
static

Definition at line 22 of file PathOpsOpCubicThreadedTest.cpp.