skia2/tests/PathOpsInverseTest.cpp
Mike Reed 7d34dc7747 Revert "Revert "switch to new filltype for SkPath""
This reverts commit 3e7af41224.

Change-Id: Id4f66b3956f4bdbe690db20fc478b7365ee89717
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/256676
Reviewed-by: Mike Reed <reed@google.com>
Commit-Queue: Mike Reed <reed@google.com>
Auto-Submit: Mike Reed <reed@google.com>
2019-11-26 17:43:14 +00:00

37 lines
1.3 KiB
C++

/*
* Copyright 2013 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#include "tests/PathOpsExtendedTest.h"
DEF_TEST(PathOpsInverse, reporter) {
const SkPathDirection dirs[] = {SkPathDirection::kCW, SkPathDirection::kCCW};
const SkPathFillType fts[] = {
SkPathFillType::kWinding, SkPathFillType::kEvenOdd,
SkPathFillType::kInverseWinding, SkPathFillType::kInverseEvenOdd
};
SkPath one, two;
int testCount = 0;
for (int op = kDifference_SkPathOp; op <= kReverseDifference_SkPathOp; ++op) {
for (auto oneFill : fts) {
for (auto oneDir : dirs) {
one.reset();
one.setFillType(oneFill);
one.addRect(0, 0, 6, 6, oneDir);
for (auto twoFill : fts) {
for (auto twoDir : dirs) {
two.reset();
two.setFillType(twoFill);
two.addRect(3, 3, 9, 9, twoDir);
SkString testName;
testName.printf("inverseTest%d", ++testCount);
testPathOp(reporter, one, two, (SkPathOp) op, testName.c_str());
}
}
}
}
}
}