| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright 2012 Google Inc. | 2 * Copyright 2012 Google Inc. |
| 3 * | 3 * |
| 4 * Use of this source code is governed by a BSD-style license that can be | 4 * Use of this source code is governed by a BSD-style license that can be |
| 5 * found in the LICENSE file. | 5 * found in the LICENSE file. |
| 6 */ | 6 */ |
| 7 | 7 |
| 8 #include "PathOpsExtendedTest.h" | 8 #include "PathOpsExtendedTest.h" |
| 9 #include "PathOpsThreadedCommon.h" | 9 #include "PathOpsThreadedCommon.h" |
| 10 #include "SkBitmap.h" | 10 #include "SkBitmap.h" |
| (...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 324 SK_DECLARE_STATIC_MUTEX(compareDebugOut3); | 324 SK_DECLARE_STATIC_MUTEX(compareDebugOut3); |
| 325 SK_DECLARE_STATIC_MUTEX(compareDebugOut4); | 325 SK_DECLARE_STATIC_MUTEX(compareDebugOut4); |
| 326 static int comparePaths(skiatest::Reporter* reporter, const char* testName, cons
t SkPath& one, | 326 static int comparePaths(skiatest::Reporter* reporter, const char* testName, cons
t SkPath& one, |
| 327 const SkPath& scaledOne, const SkPath& two, const SkPath& scaledTwo, SkB
itmap& bitmap, | 327 const SkPath& scaledOne, const SkPath& two, const SkPath& scaledTwo, SkB
itmap& bitmap, |
| 328 const SkPath& a, const SkPath& b, const SkPathOp shapeOp, const SkMatrix
& scale, | 328 const SkPath& a, const SkPath& b, const SkPathOp shapeOp, const SkMatrix
& scale, |
| 329 bool expectSuccess, bool flaky) { | 329 bool expectSuccess, bool flaky) { |
| 330 int errors2x2; | 330 int errors2x2; |
| 331 const int MAX_ERRORS = 8; | 331 const int MAX_ERRORS = 8; |
| 332 (void) pathsDrawTheSame(bitmap, scaledOne, scaledTwo, errors2x2); | 332 (void) pathsDrawTheSame(bitmap, scaledOne, scaledTwo, errors2x2); |
| 333 if (!expectSuccess) { | 333 if (!expectSuccess) { |
| 334 if (errors2x2 <= MAX_ERRORS) { | 334 if (errors2x2 <= MAX_ERRORS && !flaky) { |
| 335 REPORTER_ASSERT(reporter, 0); | 335 REPORTER_ASSERT(reporter, 0); |
| 336 } | 336 } |
| 337 return 0; | 337 return 0; |
| 338 } | 338 } |
| 339 if (errors2x2 == 0) { | 339 if (errors2x2 == 0) { |
| 340 return 0; | 340 return 0; |
| 341 } | 341 } |
| 342 if (flaky) { | 342 if (flaky) { |
| 343 return 0; | 343 return 0; |
| 344 } | 344 } |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 552 return innerPathOp(reporter, a, b, shapeOp, testName, false, true, true); | 552 return innerPathOp(reporter, a, b, shapeOp, testName, false, true, true); |
| 553 } | 553 } |
| 554 | 554 |
| 555 bool testPathOpCheck(skiatest::Reporter* reporter, const SkPath& a, const SkPath
& b, | 555 bool testPathOpCheck(skiatest::Reporter* reporter, const SkPath& a, const SkPath
& b, |
| 556 const SkPathOp shapeOp, const char* testName, bool checkFail) { | 556 const SkPathOp shapeOp, const char* testName, bool checkFail) { |
| 557 return innerPathOp(reporter, a, b, shapeOp, testName, false, checkFail, fals
e); | 557 return innerPathOp(reporter, a, b, shapeOp, testName, false, checkFail, fals
e); |
| 558 } | 558 } |
| 559 | 559 |
| 560 bool testPathOpFailCheck(skiatest::Reporter* reporter, const SkPath& a, const Sk
Path& b, | 560 bool testPathOpFailCheck(skiatest::Reporter* reporter, const SkPath& a, const Sk
Path& b, |
| 561 const SkPathOp shapeOp, const char* testName) { | 561 const SkPathOp shapeOp, const char* testName) { |
| 562 return innerPathOp(reporter, a, b, shapeOp, testName, false, false, false); | 562 return innerPathOp(reporter, a, b, shapeOp, testName, false, false, true); |
| 563 } | 563 } |
| 564 | 564 |
| 565 bool testPathFailOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath&
b, | 565 bool testPathFailOp(skiatest::Reporter* reporter, const SkPath& a, const SkPath&
b, |
| 566 const SkPathOp shapeOp, const char* testName) { | 566 const SkPathOp shapeOp, const char* testName) { |
| 567 #if DEBUG_SHOW_TEST_NAME | 567 #if DEBUG_SHOW_TEST_NAME |
| 568 showName(a, b, shapeOp); | 568 showName(a, b, shapeOp); |
| 569 #endif | 569 #endif |
| 570 SkPath orig; | 570 SkPath orig; |
| 571 orig.lineTo(54, 43); | 571 orig.lineTo(54, 43); |
| 572 SkPath out = orig; | 572 SkPath out = orig; |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 687 if (foundSkip && tests[index].fun != firstTest) { | 687 if (foundSkip && tests[index].fun != firstTest) { |
| 688 SkDebugf(" %s,\n", tests[index].str); | 688 SkDebugf(" %s,\n", tests[index].str); |
| 689 } | 689 } |
| 690 if (tests[index].fun == stopTest || index == last) { | 690 if (tests[index].fun == stopTest || index == last) { |
| 691 break; | 691 break; |
| 692 } | 692 } |
| 693 index += reverse ? -1 : 1; | 693 index += reverse ? -1 : 1; |
| 694 } while (true); | 694 } while (true); |
| 695 #endif | 695 #endif |
| 696 } | 696 } |
| OLD | NEW |