1cb93a386Sopenharmony_ci/* 2cb93a386Sopenharmony_ci * Copyright 2013 Google Inc. 3cb93a386Sopenharmony_ci * 4cb93a386Sopenharmony_ci * Use of this source code is governed by a BSD-style license that can be 5cb93a386Sopenharmony_ci * found in the LICENSE file. 6cb93a386Sopenharmony_ci */ 7cb93a386Sopenharmony_ci#include "tests/PathOpsExtendedTest.h" 8cb93a386Sopenharmony_ci 9cb93a386Sopenharmony_ciDEF_TEST(PathOpsInverse, reporter) { 10cb93a386Sopenharmony_ci const SkPathDirection dirs[] = {SkPathDirection::kCW, SkPathDirection::kCCW}; 11cb93a386Sopenharmony_ci const SkPathFillType fts[] = { 12cb93a386Sopenharmony_ci SkPathFillType::kWinding, SkPathFillType::kEvenOdd, 13cb93a386Sopenharmony_ci SkPathFillType::kInverseWinding, SkPathFillType::kInverseEvenOdd 14cb93a386Sopenharmony_ci }; 15cb93a386Sopenharmony_ci SkPath one, two; 16cb93a386Sopenharmony_ci int testCount = 0; 17cb93a386Sopenharmony_ci for (int op = kDifference_SkPathOp; op <= kReverseDifference_SkPathOp; ++op) { 18cb93a386Sopenharmony_ci for (auto oneFill : fts) { 19cb93a386Sopenharmony_ci for (auto oneDir : dirs) { 20cb93a386Sopenharmony_ci one.reset(); 21cb93a386Sopenharmony_ci one.setFillType(oneFill); 22cb93a386Sopenharmony_ci one.addRect(0, 0, 6, 6, oneDir); 23cb93a386Sopenharmony_ci for (auto twoFill : fts) { 24cb93a386Sopenharmony_ci for (auto twoDir : dirs) { 25cb93a386Sopenharmony_ci two.reset(); 26cb93a386Sopenharmony_ci two.setFillType(twoFill); 27cb93a386Sopenharmony_ci two.addRect(3, 3, 9, 9, twoDir); 28cb93a386Sopenharmony_ci SkString testName; 29cb93a386Sopenharmony_ci testName.printf("inverseTest%d", ++testCount); 30cb93a386Sopenharmony_ci testPathOp(reporter, one, two, (SkPathOp) op, testName.c_str()); 31cb93a386Sopenharmony_ci } 32cb93a386Sopenharmony_ci } 33cb93a386Sopenharmony_ci } 34cb93a386Sopenharmony_ci } 35cb93a386Sopenharmony_ci } 36cb93a386Sopenharmony_ci} 37