Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
third_party
skia
tests
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
*/
7
#include "
include/core/SkPath.h
"
8
#include "
include/core/SkPathTypes.h
"
9
#include "
include/core/SkString.h
"
10
#include "
include/pathops/SkPathOps.h
"
11
#include "
tests/PathOpsExtendedTest.h
"
12
#include "
tests/Test.h
"
13
14
DEF_TEST
(PathOpsInverse,
reporter
) {
15
const
SkPathDirection
dirs[] = {
SkPathDirection::kCW
,
SkPathDirection::kCCW
};
16
const
SkPathFillType
fts[] = {
17
SkPathFillType::kWinding
,
SkPathFillType::kEvenOdd
,
18
SkPathFillType::kInverseWinding
,
SkPathFillType::kInverseEvenOdd
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);
33
SkString
testName;
34
testName.printf(
"inverseTest%d"
, ++
testCount
);
35
testPathOp
(
reporter
, one, two, (
SkPathOp
) op, testName.c_str());
36
}
37
}
38
}
39
}
40
}
41
}
reporter
reporter
Definition
FontMgrTest.cpp:39
testCount
static const size_t testCount
Definition
PathOpsBattles.cpp:11126
testPathOp
bool testPathOp(skiatest::Reporter *reporter, const SkPath &a, const SkPath &b, const SkPathOp shapeOp, const char *testName)
Definition
PathOpsExtendedTest.cpp:618
PathOpsExtendedTest.h
SkPathOps.h
SkPathOp
SkPathOp
Definition
SkPathOps.h:22
kReverseDifference_SkPathOp
@ kReverseDifference_SkPathOp
subtract the first path from the op path
Definition
SkPathOps.h:27
kDifference_SkPathOp
@ kDifference_SkPathOp
subtract the op path from the first path
Definition
SkPathOps.h:23
SkPathTypes.h
SkPathDirection
SkPathDirection
Definition
SkPathTypes.h:34
SkPathDirection::kCCW
@ kCCW
SkPathDirection::kCW
@ kCW
SkPathFillType
SkPathFillType
Definition
SkPathTypes.h:11
SkPathFillType::kInverseWinding
@ kInverseWinding
SkPathFillType::kWinding
@ kWinding
SkPathFillType::kInverseEvenOdd
@ kInverseEvenOdd
SkPathFillType::kEvenOdd
@ kEvenOdd
SkPath.h
SkString.h
Test.h
DEF_TEST
#define DEF_TEST(name, reporter)
Definition
Test.h:312
SkPath
Definition
SkPath.h:59
SkPath::setFillType
void setFillType(SkPathFillType ft)
Definition
SkPath.h:235
SkPath::reset
SkPath & reset()
Definition
SkPath.cpp:360
SkPath::addRect
SkPath & addRect(const SkRect &rect, SkPathDirection dir, unsigned start)
Definition
SkPath.cpp:854
SkString
Definition
SkString.h:118
Generated on Fri Apr 26 2024 06:17:52 for Flutter Engine by
1.9.8