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

Side by Side Diff: tests/PathOpsSkpTest.cpp

Issue 252243003: fix cubic/line intersection; add skp tests (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: bracket new test correctly Created 6 years, 7 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/PathOpsOpTest.cpp ('k') | no next file » | 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
(...skipping 2944 matching lines...) Expand 10 before | Expand all | Expand 10 after
2955 path.close(); 2955 path.close();
2956 SkPath pathB; 2956 SkPath pathB;
2957 pathB.setFillType(SkPath::kWinding_FillType); 2957 pathB.setFillType(SkPath::kWinding_FillType);
2958 pathB.moveTo(276, 7703); 2958 pathB.moveTo(276, 7703);
2959 pathB.lineTo(277.01001f, 7703); 2959 pathB.lineTo(277.01001f, 7703);
2960 pathB.lineTo(277, 9600); 2960 pathB.lineTo(277, 9600);
2961 pathB.lineTo(276, 9600); 2961 pathB.lineTo(276, 9600);
2962 testPathOp(reporter, path, pathB, kIntersect_PathOp, filename); 2962 testPathOp(reporter, path, pathB, kIntersect_PathOp, filename);
2963 } 2963 }
2964 2964
2965 // checkSmall / addTPair / addT assert
2966 #if TRY_NEW_TESTS
2967 static void skpwww_uniquefx_net_442(skiatest::Reporter* reporter, const char* fi lename) {
2968 SkPath path;
2969 path.setFillType(SkPath::kEvenOdd_FillType);
2970 path.moveTo(960, 306);
2971 path.lineTo(960, 305);
2972 path.lineTo(1000, 305);
2973 path.lineTo(1000, 306.708527f);
2974 path.lineTo(960, 306);
2975 path.close();
2976 SkPath pathB;
2977 pathB.setFillType(SkPath::kWinding_FillType);
2978 pathB.moveTo(960, 305);
2979 pathB.lineTo(958.997253f, 306.002747f);
2980 pathB.lineTo(1017, 307);
2981 pathB.lineTo(1019, 305);
2982 testPathOp(reporter, path, pathB, kIntersect_PathOp, filename);
2983 }
2984 #endif
2985
2986 // rightAngleWinding
2987 #if TRY_NEW_TESTS
2988 static void skpwww_kitcheninspirations_wordpress_com_32(skiatest::Reporter* repo rter, const char* filename) {
2989 SkPath path;
2990 path.setFillType(SkPath::kEvenOdd_FillType);
2991 path.moveTo(47.1666679f, 19651.334f);
2992 path.lineTo(65.8333359f, 19651.332f);
2993 path.lineTo(65.8333359f, 19651.5f);
2994 path.lineTo(47.1666679f, 19651.5f);
2995 path.lineTo(47.1666679f, 19651.334f);
2996 path.close();
2997 SkPath pathB;
2998 pathB.setFillType(SkPath::kWinding_FillType);
2999 pathB.moveTo(47.1666679f, 19651.5f);
3000 pathB.lineTo(47.1666679f, 19651.332f);
3001 pathB.lineTo(65.8333359f, 19651.334f);
3002 pathB.lineTo(65.8333359f, 19651.5f);
3003 testPathOp(reporter, path, pathB, kIntersect_PathOp, filename);
3004 }
3005 #endif
3006
2965 static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0; 3007 static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0;
2966 3008
2967 static struct TestDesc tests[] = { 3009 static struct TestDesc tests[] = {
3010 #if TRY_NEW_TESTS
3011 TEST(skpwww_kitcheninspirations_wordpress_com_32), // rightanglewinding
3012 #endif
3013 #if TRY_NEW_TESTS
3014 TEST(skpwww_uniquefx_net_442), // checkSmall / addTPair / addT assert
3015 #endif
2968 TEST(skpwww_defense_studies_blogspot_com_64), 3016 TEST(skpwww_defense_studies_blogspot_com_64),
2969 TEST(skpwww_kenlevine_blogspot_com_28), 3017 TEST(skpwww_kenlevine_blogspot_com_28),
2970 TEST(skpwww_fashionscandal_com_94), 3018 TEST(skpwww_fashionscandal_com_94),
2971 #if TRY_NEW_TESTS 3019 #if TRY_NEW_TESTS
2972 TEST(skpwww_thaienews_blogspot_com_36), // completes but fails to produce c orrect output 3020 TEST(skpwww_thaienews_blogspot_com_36), // completes but fails to produce c orrect output
2973 #endif 3021 #endif
2974 TEST(skpwww_galaxystwo_com_4), 3022 TEST(skpwww_galaxystwo_com_4),
2975 TEST(skpwww_catingueiraonline_com_352), 3023 TEST(skpwww_catingueiraonline_com_352),
2976 TEST(skpwww_evolvehq_com_210), 3024 TEST(skpwww_evolvehq_com_210),
2977 TEST(skpwww_odia_com_br_26), // asserts expecting isClosed 3025 TEST(skpwww_odia_com_br_26), // asserts expecting isClosed
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
3071 3119
3072 static bool runReverse = false; 3120 static bool runReverse = false;
3073 static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0; 3121 static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0;
3074 3122
3075 DEF_TEST(PathOpsSkp, reporter) { 3123 DEF_TEST(PathOpsSkp, reporter) {
3076 #if DEBUG_SHOW_TEST_NAME 3124 #if DEBUG_SHOW_TEST_NAME
3077 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH); 3125 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH);
3078 #endif 3126 #endif
3079 RunTestSet(reporter, tests, testCount, firstTest, stopTest, runReverse); 3127 RunTestSet(reporter, tests, testCount, firstTest, stopTest, runReverse);
3080 } 3128 }
OLDNEW
« no previous file with comments | « tests/PathOpsOpTest.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698