aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pathops/SkPathOpsSimplify.cpp
diff options
context:
space:
mode:
authorGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-22 14:37:05 +0000
committerGravatar caryclark@google.com <caryclark@google.com@2bbb7eff-a529-9590-31e7-b0007b416f81>2013-04-22 14:37:05 +0000
commit7dfbb0720a133c0f63ac7be504f335bbcc62a291 (patch)
tree819a38446c52c07f941e2bf09ec236823f1032f3 /src/pathops/SkPathOpsSimplify.cpp
parentc4c9870953037be94da00ac9db887d171f6e479c (diff)
path ops : add support for inverse fill
add inverse fill, reverse diff, and gm tests cleaned up some interfaces Review URL: https://codereview.chromium.org/14371011 git-svn-id: http://skia.googlecode.com/svn/trunk@8798 2bbb7eff-a529-9590-31e7-b0007b416f81
Diffstat (limited to 'src/pathops/SkPathOpsSimplify.cpp')
-rw-r--r--src/pathops/SkPathOpsSimplify.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/pathops/SkPathOpsSimplify.cpp b/src/pathops/SkPathOpsSimplify.cpp
index 2213c68334..5c9d683f51 100644
--- a/src/pathops/SkPathOpsSimplify.cpp
+++ b/src/pathops/SkPathOpsSimplify.cpp
@@ -149,7 +149,9 @@ void Simplify(const SkPath& path, SkPath* result) {
#endif
// returns 1 for evenodd, -1 for winding, regardless of inverse-ness
result->reset();
- result->setFillType(SkPath::kEvenOdd_FillType);
+ SkPath::FillType fillType = path.isInverseFillType() ? SkPath::kInverseEvenOdd_FillType
+ : SkPath::kEvenOdd_FillType;
+ result->setFillType(fillType);
SkPathWriter simple(*result);
// turn path into list of segments
@@ -187,7 +189,7 @@ void Simplify(const SkPath& path, SkPath* result) {
: !bridgeXor(contourList, &simple))
{ // if some edges could not be resolved, assemble remaining fragments
SkPath temp;
- temp.setFillType(SkPath::kEvenOdd_FillType);
+ temp.setFillType(fillType);
SkPathWriter assembled(temp);
Assemble(simple, &assembled);
*result = *assembled.nativePath();