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 "tests/PathOpsExtendedTest.h" 8 9DEF_TEST(PathOpsInverse, reporter) { 10 const SkPathDirection dirs[] = {SkPathDirection::kCW, SkPathDirection::kCCW}; 11 const SkPathFillType fts[] = { 12 SkPathFillType::kWinding, SkPathFillType::kEvenOdd, 13 SkPathFillType::kInverseWinding, SkPathFillType::kInverseEvenOdd 14 }; 15 SkPath one, two; 16 int testCount = 0; 17 for (int op = kDifference_SkPathOp; op <= kReverseDifference_SkPathOp; ++op) { 18 for (auto oneFill : fts) { 19 for (auto oneDir : dirs) { 20 one.reset(); 21 one.setFillType(oneFill); 22 one.addRect(0, 0, 6, 6, oneDir); 23 for (auto twoFill : fts) { 24 for (auto twoDir : dirs) { 25 two.reset(); 26 two.setFillType(twoFill); 27 two.addRect(3, 3, 9, 9, twoDir); 28 SkString testName; 29 testName.printf("inverseTest%d", ++testCount); 30 testPathOp(reporter, one, two, (SkPathOp) op, testName.c_str()); 31 } 32 } 33 } 34 } 35 } 36} 37