Flutter Engine
The Flutter Engine
PathOpsInverseTest.cpp
Go to the documentation of this file.
1/*
2 * Copyright 2013 Google Inc.
3 *
4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file.
6 */
12#include "tests/Test.h"
13
14DEF_TEST(PathOpsInverse, reporter) {
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
Definition: FontMgrTest.cpp:39
static const size_t testCount
bool testPathOp(skiatest::Reporter *reporter, const SkPath &a, const SkPath &b, const SkPathOp shapeOp, const char *testName)
DEF_TEST(PathOpsInverse, reporter)
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
Definition: SkPath.h:59
void setFillType(SkPathFillType ft)
Definition: SkPath.h:235
SkPath & reset()
Definition: SkPath.cpp:370
SkPath & addRect(const SkRect &rect, SkPathDirection dir, unsigned start)
Definition: SkPath.cpp:864