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

Side by Side Diff: tests/PathOpsSkpTest.cpp

Issue 400033002: update pathops core and tests (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: fix uninitialized variable Created 6 years, 5 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/PathOpsSkpClipTest.cpp ('k') | tools/pathops_sorter.htm » ('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 #include "PathOpsExtendedTest.h" 7 #include "PathOpsExtendedTest.h"
8 8
9 #define TEST(name) { name, #name } 9 #define TEST(name) { name, #name }
10 10
11 #define TEST_NEW_FAILURES 0
12
11 static void skpcheeseandburger_com225(skiatest::Reporter* reporter, const char* filename) { 13 static void skpcheeseandburger_com225(skiatest::Reporter* reporter, const char* filename) {
12 SkPath path; 14 SkPath path;
13 path.setFillType(SkPath::kEvenOdd_FillType); 15 path.setFillType(SkPath::kEvenOdd_FillType);
14 path.moveTo(555, 468); 16 path.moveTo(555, 468);
15 path.lineTo(555, 362); 17 path.lineTo(555, 362);
16 path.lineTo(872, 362); 18 path.lineTo(872, 362);
17 path.lineTo(872, 468); 19 path.lineTo(872, 468);
18 path.lineTo(555, 468); 20 path.lineTo(555, 468);
19 path.close(); 21 path.close();
20 SkPath pathB; 22 SkPath pathB;
(...skipping 3519 matching lines...) Expand 10 before | Expand all | Expand 10 after
3540 path.close(); 3542 path.close();
3541 SkPath pathB; 3543 SkPath pathB;
3542 pathB.setFillType(SkPath::kWinding_FillType); 3544 pathB.setFillType(SkPath::kWinding_FillType);
3543 pathB.moveTo(813, 773); 3545 pathB.moveTo(813, 773);
3544 pathB.lineTo(814, 773); 3546 pathB.lineTo(814, 773);
3545 pathB.lineTo(826.01001f, 785); 3547 pathB.lineTo(826.01001f, 785);
3546 pathB.lineTo(813, 785); 3548 pathB.lineTo(813, 785);
3547 testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); 3549 testPathOp(reporter, path, pathB, kIntersect_PathOp, filename);
3548 } 3550 }
3549 3551
3552 static void skpwww_9to5mac_com_64(skiatest::Reporter* reporter, const char* file name) {
3553 SkPath path;
3554 path.setFillType(SkPath::kEvenOdd_FillType);
3555 path.moveTo(365, 5101);
3556 path.lineTo(365, 5082);
3557 path.lineTo(366, 5083);
3558 path.lineTo(367, 5092.96631f);
3559 path.lineTo(367, 5100);
3560 path.quadTo(367, 5101.50537f, 367.967712f, 5102.61084f);
3561 path.lineTo(368.278717f, 5105.71045f);
3562 path.quadTo(367.277618f, 5105.34863f, 366.464478f, 5104.53564f);
3563 path.quadTo(365, 5103.07129f, 365, 5101);
3564 path.close();
3565 SkPath pathB;
3566 pathB.setFillType(SkPath::kWinding_FillType);
3567 pathB.moveTo(365, 5082);
3568 pathB.lineTo(365.848175f, 5081.15186f);
3569 pathB.lineTo(368, 5103);
3570 pathB.lineTo(365, 5106);
3571 testPathOp(reporter, path, pathB, kIntersect_PathOp, filename);
3572 }
3573
3574 #if TEST_NEW_FAILURES
3575 // addTCoincident SkASSERT(test->fT < 1);
3576 static void skpwww_googleventures_com_32(skiatest::Reporter* reporter, const cha r* filename) {
3577 SkPath path;
3578 path.setFillType(SkPath::kEvenOdd_FillType);
3579 path.moveTo(725.911682f, 898.767456f);
3580 path.lineTo(741.232544f, 885.911682f);
3581 path.lineTo(754.088318f, 901.232544f);
3582 path.lineTo(738.767456f, 914.088318f);
3583 path.lineTo(725.911682f, 898.767456f);
3584 path.close();
3585 SkPath pathB;
3586 pathB.setFillType(SkPath::kWinding_FillType);
3587 pathB.moveTo(728.37677f, 870.59082f);
3588 pathB.lineTo(754.088257f, 901.232605f);
3589 pathB.lineTo(738.767395f, 914.088379f);
3590 pathB.lineTo(713.055908f, 883.446594f);
3591 pathB.close();
3592 testPathOp(reporter, path, pathB, kIntersect_PathOp, filename);
3593 }
3594
3595 // checkSmallCoincidence failed assertion "!next->fSmall || checkMultiple"
3596 static void skpwww_devbridge_com_22(skiatest::Reporter* reporter, const char* fi lename) {
3597 SkPath path;
3598 path.setFillType(SkPath::kEvenOdd_FillType);
3599 path.moveTo(4915, 1523);
3600 path.quadTo(4887.24756f, 1523, 4867.62402f, 1542.6239f);
3601 path.quadTo(4848, 1562.24768f, 4848, 1590);
3602 path.quadTo(4848, 1617.75232f, 4867.62402f, 1637.3761f);
3603 path.quadTo(4887.24756f, 1657, 4915, 1657);
3604 path.quadTo(4942.75244f, 1657, 4962.37598f, 1637.3761f);
3605 path.quadTo(4982, 1617.75232f, 4982, 1590);
3606 path.quadTo(4982, 1562.24768f, 4962.37598f, 1542.6239f);
3607 path.quadTo(4942.75244f, 1523, 4915, 1523);
3608 path.close();
3609 SkPath pathB;
3610 pathB.setFillType(SkPath::kWinding_FillType);
3611 pathB.moveTo(4981.99902f, 1590);
3612 pathB.quadTo(4981.99902f, 1617.75232f, 4962.375f, 1637.3761f);
3613 pathB.quadTo(4942.75146f, 1657, 4914.99902f, 1657);
3614 pathB.quadTo(4887.24658f, 1657, 4867.62305f, 1637.3761f);
3615 pathB.quadTo(4847.99902f, 1617.75232f, 4847.99902f, 1590);
3616 pathB.quadTo(4847.99902f, 1562.24768f, 4867.62305f, 1542.6239f);
3617 pathB.quadTo(4887.24658f, 1523, 4914.99902f, 1523);
3618 pathB.quadTo(4942.75146f, 1523, 4962.375f, 1542.6239f);
3619 pathB.quadTo(4981.99902f, 1562.24768f, 4981.99902f, 1590);
3620 pathB.close();
3621 testPathOp(reporter, path, pathB, kIntersect_PathOp, filename);
3622 }
3623
3624 // cubic/quad intersection
3625 static void skpwww_alamdi_com_3(skiatest::Reporter* reporter, const char* filena me) {
3626 SkPath path;
3627 path.setFillType(SkPath::kEvenOdd_FillType);
3628 path.moveTo(10210.8789f, 5315.87891f);
3629 path.quadTo(10211.7578f, 5315, 10213, 5315);
3630 path.lineTo(10230, 5315);
3631 path.quadTo(10231.2422f, 5315, 10232.1211f, 5315.87891f);
3632 path.quadTo(10233, 5316.75732f, 10233, 5318);
3633 path.lineTo(10233, 5338);
3634 path.quadTo(10233, 5339.24268f, 10232.1211f, 5340.12109f);
3635 path.quadTo(10231.2422f, 5341, 10230, 5341);
3636 path.lineTo(10213, 5341);
3637 path.quadTo(10211.7578f, 5341, 10210.8789f, 5340.12109f);
3638 path.quadTo(10210, 5339.24268f, 10210, 5338);
3639 path.lineTo(10210, 5318);
3640 path.quadTo(10210, 5316.75732f, 10210.8789f, 5315.87891f);
3641 path.close();
3642 SkPath pathB;
3643 pathB.setFillType(SkPath::kEvenOdd_FillType);
3644 pathB.moveTo(10213, 5315);
3645 pathB.lineTo(10230, 5315);
3646 pathB.cubicTo(10231.6572f, 5315, 10233, 5316.34326f, 10233, 5318);
3647 pathB.lineTo(10233, 5338);
3648 pathB.cubicTo(10233, 5339.10449f, 10231.6572f, 5340, 10230, 5340);
3649 pathB.lineTo(10213, 5340);
3650 pathB.cubicTo(10211.3428f, 5340, 10210, 5339.10449f, 10210, 5338);
3651 pathB.lineTo(10210, 5318);
3652 pathB.cubicTo(10210, 5316.34326f, 10211.3428f, 5315, 10213, 5315);
3653 pathB.close();
3654 testPathOp(reporter, path, pathB, kIntersect_PathOp, filename);
3655 }
3656
3657 // bumpSpan failed assertion "span->fOppValue >= 0"
3658 static void skpwww_familysurvivalprotocol_wordpress_com_61(skiatest::Reporter* r eporter, const char* filename) {
3659 SkPath path;
3660 path.setFillType(SkPath::kEvenOdd_FillType);
3661 path.moveTo(143, 14557);
3662 path.lineTo(165, 14557);
3663 path.lineTo(165, 14555.9902f);
3664 path.lineTo(143, 14556);
3665 path.lineTo(143, 14557);
3666 path.close();
3667 SkPath pathB;
3668 pathB.setFillType(SkPath::kWinding_FillType);
3669 pathB.moveTo(143, 14557);
3670 pathB.lineTo(143, 14555.9902f);
3671 pathB.lineTo(165, 14556);
3672 pathB.lineTo(165, 14557);
3673 testPathOp(reporter, path, pathB, kIntersect_PathOp, filename);
3674 }
3675
3676 // addTCancel: failed assertion "oIndex > 0"
3677 static void skpwww_firstunitedbank_com_19(skiatest::Reporter* reporter, const ch ar* filename) {
3678 SkPath path;
3679 path.setFillType(SkPath::kEvenOdd_FillType);
3680 path.moveTo(808.585815f, 11673.5859f);
3681 path.quadTo(809.17157f, 11673, 810, 11673);
3682 path.lineTo(1032, 11673);
3683 path.quadTo(1038.21326f, 11673, 1042.60657f, 11677.3936f);
3684 path.quadTo(1047, 11681.7871f, 1047, 11688);
3685 path.quadTo(1047, 11682.2012f, 1042.60657f, 11678.1006f);
3686 path.quadTo(1038.21326f, 11674, 1032, 11674);
3687 path.lineTo(810, 11674);
3688 path.quadTo(809.585815f, 11674, 809.292908f, 11674.293f);
3689 path.quadTo(809, 11674.5859f, 809, 11675);
3690 path.lineTo(809, 11701);
3691 path.quadTo(809, 11701.4141f, 809.292908f, 11701.707f);
3692 path.quadTo(809.585815f, 11702, 810, 11702);
3693 path.lineTo(1032, 11702);
3694 path.quadTo(1038.21326f, 11702, 1042.60657f, 11697.8994f);
3695 path.quadTo(1047, 11693.7988f, 1047, 11688);
3696 path.quadTo(1047, 11694.2129f, 1042.60657f, 11698.6064f);
3697 path.quadTo(1038.21326f, 11703, 1032, 11703);
3698 path.lineTo(810, 11703);
3699 path.quadTo(809.17157f, 11703, 808.585815f, 11702.4141f);
3700 path.quadTo(808, 11701.8281f, 808, 11701);
3701 path.lineTo(808, 11675);
3702 path.quadTo(808, 11674.1719f, 808.585815f, 11673.5859f);
3703 path.close();
3704 SkPath pathB;
3705 pathB.setFillType(SkPath::kWinding_FillType);
3706 pathB.moveTo(808, 11703);
3707 pathB.lineTo(809.5f, 11701.5f);
3708 pathB.lineTo(1062.91907f, 11687.0811f);
3709 pathB.lineTo(1047, 11703);
3710 testPathOp(reporter, path, pathB, kIntersect_PathOp, filename);
3711 }
3712 #endif
3713
3714 // addSimpleAngle: failed assertion "index == count() - 2"
3715 static void skpwww_shinydemos_com_5(skiatest::Reporter* reporter, const char* fi lename) {
3716 SkPath path;
3717 path.setFillType(SkPath::kEvenOdd_FillType);
3718 path.moveTo(205.884888f, 648.203857f);
3719 path.lineTo(771.570374f, 82.5183716f);
3720 path.lineTo(1110.98169f, 421.929626f);
3721 path.lineTo(545.296143f, 987.615112f);
3722 path.lineTo(205.884888f, 648.203857f);
3723 path.close();
3724 SkPath pathB;
3725 pathB.setFillType(SkPath::kWinding_FillType);
3726 pathB.moveTo(771.570374f, 82.5183716f);
3727 pathB.lineTo(1110.98169f, 421.929626f);
3728 pathB.lineTo(545.296204f, 987.615051f);
3729 pathB.lineTo(205.884949f, 648.203796f);
3730 pathB.close();
3731 testPathOp(reporter, path, pathB, kIntersect_PathOp, filename);
3732 }
3733
3734 // addTCoincident oPeek = &other->fTs[++oPeekIndex];
3735 static void skpwww_lptemp_com_3(skiatest::Reporter* reporter, const char* filena me) {
3736 SkPath path;
3737 path.setFillType(SkPath::kEvenOdd_FillType);
3738 path.moveTo(78.6429825f, 1394.30969f);
3739 path.quadTo(79.6192932f, 1393.33337f, 81.0000076f, 1393.33337f);
3740 path.lineTo(341, 1393.33337f);
3741 path.quadTo(342.380707f, 1393.33337f, 343.357025f, 1394.30969f);
3742 path.quadTo(344.333344f, 1395.28601f, 344.333344f, 1396.66675f);
3743 path.lineTo(344.333344f, 1465.66663f);
3744 path.quadTo(344.333344f, 1467.04736f, 343.357025f, 1468.02368f);
3745 path.quadTo(342.380707f, 1469, 341, 1469);
3746 path.lineTo(81.0000076f, 1469);
3747 path.quadTo(79.6192932f, 1469, 78.6429825f, 1468.02368f);
3748 path.quadTo(77.6666718f, 1467.04736f, 77.6666718f, 1465.66663f);
3749 path.lineTo(77.6666718f, 1396.66675f);
3750 path.quadTo(77.6666718f, 1395.28601f, 78.6429825f, 1394.30969f);
3751 path.close();
3752 SkPath pathB;
3753 pathB.setFillType(SkPath::kEvenOdd_FillType);
3754 pathB.moveTo(81, 1393.33337f);
3755 pathB.lineTo(341, 1393.33337f);
3756 pathB.cubicTo(342.840942f, 1393.33337f, 344.333344f, 1394.82568f, 344.333344 f, 1396.66675f);
3757 pathB.lineTo(344.333344f, 1465.66675f);
3758 pathB.cubicTo(344.333344f, 1467.32361f, 342.840942f, 1468.66675f, 341, 1468. 66675f);
3759 pathB.lineTo(81, 1468.66675f);
3760 pathB.cubicTo(79.15905f, 1468.66675f, 77.6666718f, 1467.32361f, 77.6666718f, 1465.66675f);
3761 pathB.lineTo(77.6666718f, 1396.66675f);
3762 pathB.cubicTo(77.6666718f, 1394.82568f, 79.15905f, 1393.33337f, 81, 1393.333 37f);
3763 pathB.close();
3764 testPathOp(reporter, path, pathB, kIntersect_PathOp, filename);
3765 }
3766
3550 static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0; 3767 static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0;
3551 3768
3552 static struct TestDesc tests[] = { 3769 static struct TestDesc tests[] = {
3770 TEST(skpwww_lptemp_com_3),
3771 TEST(skpwww_shinydemos_com_5),
3772 #if TEST_NEW_FAILURES
3773 TEST(skpwww_familysurvivalprotocol_wordpress_com_61),
3774 TEST(skpwww_alamdi_com_3),
3775 TEST(skpwww_devbridge_com_22),
3776 TEST(skpwww_googleventures_com_32),
3777 #endif
3778 TEST(skpwww_9to5mac_com_64),
3553 TEST(skpwww_wartepop_blogspot_com_br_6), 3779 TEST(skpwww_wartepop_blogspot_com_br_6),
3554 TEST(skpwww_wartepop_blogspot_com_br_6a), 3780 TEST(skpwww_wartepop_blogspot_com_br_6a),
3555 TEST(skpwww_cooksnaps_com_32a), 3781 TEST(skpwww_cooksnaps_com_32a),
3556 TEST(skpwww_argus_presse_fr_41), 3782 TEST(skpwww_argus_presse_fr_41),
3557 TEST(skpwww_cooksnaps_com_17), 3783 TEST(skpwww_cooksnaps_com_17),
3558 TEST(skpwww_cooksnaps_com_32), 3784 TEST(skpwww_cooksnaps_com_32),
3559 TEST(skpwww_kitcheninspirations_wordpress_com_66), 3785 TEST(skpwww_kitcheninspirations_wordpress_com_66),
3560 TEST(skpwww_tcmevents_org_13), 3786 TEST(skpwww_tcmevents_org_13),
3561 TEST(skpwww_narayana_publishers_com_194), 3787 TEST(skpwww_narayana_publishers_com_194),
3562 TEST(skpwww_swapspacesystems_com_5), 3788 TEST(skpwww_swapspacesystems_com_5),
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
3660 3886
3661 static bool runReverse = false; 3887 static bool runReverse = false;
3662 static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0; 3888 static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0;
3663 3889
3664 DEF_TEST(PathOpsSkp, reporter) { 3890 DEF_TEST(PathOpsSkp, reporter) {
3665 #if DEBUG_SHOW_TEST_NAME 3891 #if DEBUG_SHOW_TEST_NAME
3666 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH); 3892 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH);
3667 #endif 3893 #endif
3668 RunTestSet(reporter, tests, testCount, firstTest, stopTest, runReverse); 3894 RunTestSet(reporter, tests, testCount, firstTest, stopTest, runReverse);
3669 } 3895 }
OLDNEW
« no previous file with comments | « tests/PathOpsSkpClipTest.cpp ('k') | tools/pathops_sorter.htm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698