PathOpsInverseTest.cpp 1.4 KB

12345678910111213141516171819202122232425262728293031323334
  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. DEF_TEST(PathOpsInverse, reporter) {
  9. SkPath one, two;
  10. int testCount = 0;
  11. for (int op = kDifference_SkPathOp; op <= kReverseDifference_SkPathOp; ++op) {
  12. for (int oneFill = SkPath::kWinding_FillType; oneFill <= SkPath::kInverseEvenOdd_FillType;
  13. ++oneFill) {
  14. for (int oneDir = SkPath::kCW_Direction; oneDir != SkPath::kCCW_Direction; ++oneDir) {
  15. one.reset();
  16. one.setFillType((SkPath::FillType) oneFill);
  17. one.addRect(0, 0, 6, 6, (SkPath::Direction) oneDir);
  18. for (int twoFill = SkPath::kWinding_FillType;
  19. twoFill <= SkPath::kInverseEvenOdd_FillType; ++twoFill) {
  20. for (int twoDir = SkPath::kCW_Direction; twoDir != SkPath::kCCW_Direction;
  21. ++twoDir) {
  22. two.reset();
  23. two.setFillType((SkPath::FillType) twoFill);
  24. two.addRect(3, 3, 9, 9, (SkPath::Direction) twoDir);
  25. SkString testName;
  26. testName.printf("inverseTest%d", ++testCount);
  27. testPathOp(reporter, one, two, (SkPathOp) op, testName.c_str());
  28. }
  29. }
  30. }
  31. }
  32. }
  33. }