Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(31)

Side by Side Diff: tests/PathOpsExtendedTest.cpp

Issue 2237223002: pathops coincident work (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: remove unused code Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « tests/PathOpsExtendedTest.h ('k') | tests/PathOpsOpTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 490 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 } 501 }
502 reporter->bumpTestCount(); 502 reporter->bumpTestCount();
503 return errors == 0; 503 return errors == 0;
504 } 504 }
505 505
506 bool testSimplify(skiatest::Reporter* reporter, const SkPath& path, const char* filename) { 506 bool testSimplify(skiatest::Reporter* reporter, const SkPath& path, const char* filename) {
507 return inner_simplify(reporter, path, filename, ExpectSuccess::kYes, SkipAss ert::kNo, 507 return inner_simplify(reporter, path, filename, ExpectSuccess::kYes, SkipAss ert::kNo,
508 ExpectMatch::kYes); 508 ExpectMatch::kYes);
509 } 509 }
510 510
511 bool testSimplifyFailSkipAssert(skiatest::Reporter* reporter, const SkPath& path , const char* filename) { 511 bool testSimplifyFuzz(skiatest::Reporter* reporter, const SkPath& path, const ch ar* filename) {
512 return inner_simplify(reporter, path, filename, ExpectSuccess::kNo, SkipAsse rt::kYes, 512 return inner_simplify(reporter, path, filename, ExpectSuccess::kFlaky, SkipA ssert::kYes,
513 ExpectMatch::kNo); 513 ExpectMatch::kFlaky);
514 } 514 }
515 515
516 bool testSimplifyCheck(skiatest::Reporter* reporter, const SkPath& path, const c har* filename, 516 bool testSimplifyCheck(skiatest::Reporter* reporter, const SkPath& path, const c har* filename,
517 bool checkFail) { 517 bool checkFail) {
518 return inner_simplify(reporter, path, filename, checkFail ? 518 return inner_simplify(reporter, path, filename, checkFail ?
519 ExpectSuccess::kYes : ExpectSuccess::kNo, SkipAssert::kNo, ExpectMat ch::kNo); 519 ExpectSuccess::kYes : ExpectSuccess::kNo, SkipAssert::kNo, ExpectMat ch::kNo);
520 } 520 }
521 521
522 #if DEBUG_SHOW_TEST_NAME 522 #if DEBUG_SHOW_TEST_NAME
523 static void showName(const SkPath& a, const SkPath& b, const SkPathOp shapeOp) { 523 static void showName(const SkPath& a, const SkPath& b, const SkPathOp shapeOp) {
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 return innerPathOp(reporter, a, b, shapeOp, testName, ExpectSuccess::kYes, S kipAssert::kNo, 586 return innerPathOp(reporter, a, b, shapeOp, testName, ExpectSuccess::kYes, S kipAssert::kNo,
587 ExpectMatch::kYes); 587 ExpectMatch::kYes);
588 } 588 }
589 589
590 bool testPathOpCheck(skiatest::Reporter* reporter, const SkPath& a, const SkPath & b, 590 bool testPathOpCheck(skiatest::Reporter* reporter, const SkPath& a, const SkPath & b,
591 const SkPathOp shapeOp, const char* testName, bool checkFail) { 591 const SkPathOp shapeOp, const char* testName, bool checkFail) {
592 return innerPathOp(reporter, a, b, shapeOp, testName, checkFail ? 592 return innerPathOp(reporter, a, b, shapeOp, testName, checkFail ?
593 ExpectSuccess::kYes : ExpectSuccess::kNo, SkipAssert::kNo, ExpectMat ch::kNo); 593 ExpectSuccess::kYes : ExpectSuccess::kNo, SkipAssert::kNo, ExpectMat ch::kNo);
594 } 594 }
595 595
596 bool testPathOpFailCheck(skiatest::Reporter* reporter, const SkPath& a, const Sk Path& b, 596 bool testPathOpFuzz(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
597 const SkPathOp shapeOp, const char* testName) {
598 return innerPathOp(reporter, a, b, shapeOp, testName, ExpectSuccess::kNo, Sk ipAssert::kNo,
599 ExpectMatch::kNo);
600 }
601
602 bool testPathOpSkipAssert(skiatest::Reporter* reporter, const SkPath& a, const S kPath& b,
603 const SkPathOp shapeOp, const char* testName) {
604 return innerPathOp(reporter, a, b, shapeOp, testName, ExpectSuccess::kYes, S kipAssert::kYes,
605 ExpectMatch::kYes);
606 }
607
608 bool testPathOpFailSkipAssert(skiatest::Reporter* reporter, const SkPath& a, con st SkPath& b,
609 const SkPathOp shapeOp, const char* testName) {
610 return innerPathOp(reporter, a, b, shapeOp, testName, ExpectSuccess::kNo, Sk ipAssert::kYes,
611 ExpectMatch::kNo);
612 }
613
614 bool testPathOpFlakySkipAssert(skiatest::Reporter* reporter, const SkPath& a, co nst SkPath& b,
615 const SkPathOp shapeOp, const char* testName) { 597 const SkPathOp shapeOp, const char* testName) {
616 return innerPathOp(reporter, a, b, shapeOp, testName, ExpectSuccess::kFlaky, SkipAssert::kYes, 598 return innerPathOp(reporter, a, b, shapeOp, testName, ExpectSuccess::kFlaky, SkipAssert::kYes,
617 ExpectMatch::kFlaky); 599 ExpectMatch::kFlaky);
618 } 600 }
619 601
620 bool testPathOpFail(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b, 602 bool testPathOpFail(skiatest::Reporter* reporter, const SkPath& a, const SkPath& b,
621 const SkPathOp shapeOp, const char* testName) { 603 const SkPathOp shapeOp, const char* testName) {
622 #if DEBUG_SHOW_TEST_NAME 604 #if DEBUG_SHOW_TEST_NAME
623 showName(a, b, shapeOp); 605 showName(a, b, shapeOp);
624 #endif 606 #endif
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 size_t last = reverse ? 0 : count - 1; 682 size_t last = reverse ? 0 : count - 1;
701 bool foundSkip = !skipTest; 683 bool foundSkip = !skipTest;
702 do { 684 do {
703 if (tests[index].fun == skipTest) { 685 if (tests[index].fun == skipTest) {
704 foundSkip = true; 686 foundSkip = true;
705 } 687 }
706 if (foundSkip && tests[index].fun != firstTest) { 688 if (foundSkip && tests[index].fun != firstTest) {
707 #if DEBUG_SHOW_TEST_NAME 689 #if DEBUG_SHOW_TEST_NAME
708 SkDebugf("\n<div id=\"%s\">\n", tests[index].str); 690 SkDebugf("\n<div id=\"%s\">\n", tests[index].str);
709 #endif 691 #endif
710 (*tests[index].fun)(reporter, tests[index].str); 692 (*tests[index].fun)(reporter, tests[index].str);
711 } 693 }
712 if (tests[index].fun == stopTest || index == last) { 694 if (tests[index].fun == stopTest || index == last) {
713 break; 695 break;
714 } 696 }
715 index += reverse ? -1 : 1; 697 index += reverse ? -1 : 1;
716 } while (true); 698 } while (true);
717 #if DEBUG_SHOW_TEST_NAME 699 #if DEBUG_SHOW_TEST_NAME
718 SkDebugf( 700 SkDebugf(
719 "\n" 701 "\n"
720 "</div>\n" 702 "</div>\n"
(...skipping 12 matching lines...) Expand all
733 if (foundSkip && tests[index].fun != firstTest) { 715 if (foundSkip && tests[index].fun != firstTest) {
734 SkDebugf(" %s,\n", tests[index].str); 716 SkDebugf(" %s,\n", tests[index].str);
735 } 717 }
736 if (tests[index].fun == stopTest || index == last) { 718 if (tests[index].fun == stopTest || index == last) {
737 break; 719 break;
738 } 720 }
739 index += reverse ? -1 : 1; 721 index += reverse ? -1 : 1;
740 } while (true); 722 } while (true);
741 #endif 723 #endif
742 } 724 }
OLDNEW
« no previous file with comments | « tests/PathOpsExtendedTest.h ('k') | tests/PathOpsOpTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698