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 470 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
481 | 481 |
482 #if DEBUG_SHOW_TEST_NAME | 482 #if DEBUG_SHOW_TEST_NAME |
483 static void showName(const SkPath& a, const SkPath& b, const SkPathOp shapeOp) { | 483 static void showName(const SkPath& a, const SkPath& b, const SkPathOp shapeOp) { |
484 SkDebugf("\n"); | 484 SkDebugf("\n"); |
485 showPathData(a); | 485 showPathData(a); |
486 showOp(shapeOp); | 486 showOp(shapeOp); |
487 showPathData(b); | 487 showPathData(b); |
488 } | 488 } |
489 #endif | 489 #endif |
490 | 490 |
491 bool OpDebug(const SkPath& one, const SkPath& two, SkPathOp op, SkPath* result,
bool expectSuccess); | 491 bool OpDebug(const SkPath& one, const SkPath& two, SkPathOp op, SkPath* result, |
| 492 bool expectSuccess SkDEBUGPARAMS(const char* testName)); |
492 | 493 |
493 static bool innerPathOp(skiatest::Reporter* reporter, const SkPath& a, const SkP
ath& b, | 494 static bool innerPathOp(skiatest::Reporter* reporter, const SkPath& a, const SkP
ath& b, |
494 const SkPathOp shapeOp, const char* testName, bool expectSuccess) { | 495 const SkPathOp shapeOp, const char* testName, bool expectSuccess) { |
495 #if 0 && DEBUG_SHOW_TEST_NAME | 496 #if 0 && DEBUG_SHOW_TEST_NAME |
496 showName(a, b, shapeOp); | 497 showName(a, b, shapeOp); |
497 #endif | 498 #endif |
498 SkPath out; | 499 SkPath out; |
499 if (!OpDebug(a, b, shapeOp, &out, expectSuccess)) { | 500 if (!OpDebug(a, b, shapeOp, &out, expectSuccess SkDEBUGPARAMS(testName))) { |
500 SkDebugf("%s did not expect failure\n", __FUNCTION__); | 501 SkDebugf("%s did not expect failure\n", __FUNCTION__); |
501 REPORTER_ASSERT(reporter, 0); | 502 REPORTER_ASSERT(reporter, 0); |
502 return false; | 503 return false; |
503 } | 504 } |
504 if (!reporter->verbose()) { | 505 if (!reporter->verbose()) { |
505 return true; | 506 return true; |
506 } | 507 } |
507 SkPath pathOut, scaledPathOut; | 508 SkPath pathOut, scaledPathOut; |
508 SkRegion rgnA, rgnB, openClip, rgnOut; | 509 SkRegion rgnA, rgnB, openClip, rgnOut; |
509 openClip.setRect(-16000, -16000, 16000, 16000); | 510 openClip.setRect(-16000, -16000, 16000, 16000); |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 if (foundSkip && tests[index].fun != firstTest) { | 670 if (foundSkip && tests[index].fun != firstTest) { |
670 SkDebugf(" %s,\n", tests[index].str); | 671 SkDebugf(" %s,\n", tests[index].str); |
671 } | 672 } |
672 if (tests[index].fun == stopTest || index == last) { | 673 if (tests[index].fun == stopTest || index == last) { |
673 break; | 674 break; |
674 } | 675 } |
675 index += reverse ? -1 : 1; | 676 index += reverse ? -1 : 1; |
676 } while (true); | 677 } while (true); |
677 #endif | 678 #endif |
678 } | 679 } |
OLD | NEW |