Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Functions
PathOpsInverseTest.cpp File Reference
#include "include/core/SkPath.h"
#include "include/core/SkPathTypes.h"
#include "include/core/SkString.h"
#include "include/pathops/SkPathOps.h"
#include "tests/PathOpsExtendedTest.h"
#include "tests/Test.h"

Go to the source code of this file.

Functions

 DEF_TEST (PathOpsInverse, reporter)
 

Function Documentation

◆ DEF_TEST()

DEF_TEST ( PathOpsInverse  ,
reporter   
)

Definition at line 14 of file PathOpsInverseTest.cpp.

14 {
16 const SkPathFillType fts[] = {
19 };
20 SkPath one, two;
21 int testCount = 0;
22 for (int op = kDifference_SkPathOp; op <= kReverseDifference_SkPathOp; ++op) {
23 for (auto oneFill : fts) {
24 for (auto oneDir : dirs) {
25 one.reset();
26 one.setFillType(oneFill);
27 one.addRect(0, 0, 6, 6, oneDir);
28 for (auto twoFill : fts) {
29 for (auto twoDir : dirs) {
30 two.reset();
31 two.setFillType(twoFill);
32 two.addRect(3, 3, 9, 9, twoDir);
34 testName.printf("inverseTest%d", ++testCount);
35 testPathOp(reporter, one, two, (SkPathOp) op, testName.c_str());
36 }
37 }
38 }
39 }
40 }
41}
reporter
static const size_t testCount
bool testPathOp(skiatest::Reporter *reporter, const SkPath &a, const SkPath &b, const SkPathOp shapeOp, const char *testName)
SkPathOp
Definition SkPathOps.h:22
@ kReverseDifference_SkPathOp
subtract the first path from the op path
Definition SkPathOps.h:27
@ kDifference_SkPathOp
subtract the op path from the first path
Definition SkPathOps.h:23
SkPathDirection
Definition SkPathTypes.h:34
SkPathFillType
Definition SkPathTypes.h:11
void setFillType(SkPathFillType ft)
Definition SkPath.h:235
SkPath & reset()
Definition SkPath.cpp:360
SkPath & addRect(const SkRect &rect, SkPathDirection dir, unsigned start)
Definition SkPath.cpp:854