blob: adbb80da98d6b890a5597caf66c16e0a565d33f0 [file] [log] [blame]
caryclark@google.com7dfbb072013-04-22 14:37:05 +00001/*
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 "PathOpsExtendedTest.h"
tfarina@chromium.org78e7b4e2014-01-02 21:45:03 +00008#include "TestClassDef.h"
caryclark@google.com7dfbb072013-04-22 14:37:05 +00009
tfarina@chromium.org78e7b4e2014-01-02 21:45:03 +000010DEF_TEST(PathOpsInverse, reporter) {
caryclark@google.com7dfbb072013-04-22 14:37:05 +000011 SkPath one, two;
12 for (int op = kDifference_PathOp; op <= kReverseDifference_PathOp; ++op) {
13 for (int oneFill = SkPath::kWinding_FillType; oneFill <= SkPath::kInverseEvenOdd_FillType;
14 ++oneFill) {
15 for (int oneDir = SkPath::kCW_Direction; oneDir != SkPath::kCCW_Direction; ++oneDir) {
16 one.reset();
17 one.setFillType((SkPath::FillType) oneFill);
18 one.addRect(0, 0, 6, 6, (SkPath::Direction) oneDir);
19 for (int twoFill = SkPath::kWinding_FillType;
20 twoFill <= SkPath::kInverseEvenOdd_FillType; ++twoFill) {
21 for (int twoDir = SkPath::kCW_Direction; twoDir != SkPath::kCCW_Direction;
22 ++twoDir) {
23 two.reset();
24 two.setFillType((SkPath::FillType) twoFill);
25 two.addRect(3, 3, 9, 9, (SkPath::Direction) twoDir);
26 testPathOp(reporter, one, two, (SkPathOp) op);
27 }
28 }
29 }
30 }
31 }
32}