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

Side by Side Diff: tests/PathOpsSimplifyTest.cpp

Issue 1394503003: fix some pathops bugs found in 1M skps (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: init to avoid warning Created 5 years, 2 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') | tests/PathOpsSkpTest.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 #include "PathOpsExtendedTest.h" 7 #include "PathOpsExtendedTest.h"
8 8
9 #define TEST(name) { name, #name } 9 #define TEST(name) { name, #name }
10 10
(...skipping 4976 matching lines...) Expand 10 before | Expand all | Expand 10 after
4987 path.moveTo(SkBits2Float(0x43ef6720), SkBits2Float(0x42480000)); // 478.806f, 5 0 4987 path.moveTo(SkBits2Float(0x43ef6720), SkBits2Float(0x42480000)); // 478.806f, 5 0
4988 path.conicTo(SkBits2Float(0x43ef6720), SkBits2Float(0x00000000), SkBits2Float(0x 43d66720), SkBits2Float(0x00000000), SkBits2Float(0x3f3504f3)); // 478.806f, 0, 428.806f, 0, 0.707107f 4988 path.conicTo(SkBits2Float(0x43ef6720), SkBits2Float(0x00000000), SkBits2Float(0x 43d66720), SkBits2Float(0x00000000), SkBits2Float(0x3f3504f3)); // 478.806f, 0, 428.806f, 0, 0.707107f
4989 path.conicTo(SkBits2Float(0x43bd6720), SkBits2Float(0x00000000), SkBits2Float(0x 43bd6720), SkBits2Float(0x42480000), SkBits2Float(0x3f3504f3)); // 378.806f, 0, 378.806f, 50, 0.707107f 4989 path.conicTo(SkBits2Float(0x43bd6720), SkBits2Float(0x00000000), SkBits2Float(0x 43bd6720), SkBits2Float(0x42480000), SkBits2Float(0x3f3504f3)); // 378.806f, 0, 378.806f, 50, 0.707107f
4990 path.conicTo(SkBits2Float(0x43bd6720), SkBits2Float(0x42c80000), SkBits2Float(0x 43d66720), SkBits2Float(0x42c80000), SkBits2Float(0x3f3504f3)); // 378.806f, 10 0, 428.806f, 100, 0.707107f 4990 path.conicTo(SkBits2Float(0x43bd6720), SkBits2Float(0x42c80000), SkBits2Float(0x 43d66720), SkBits2Float(0x42c80000), SkBits2Float(0x3f3504f3)); // 378.806f, 10 0, 428.806f, 100, 0.707107f
4991 path.conicTo(SkBits2Float(0x43ef6720), SkBits2Float(0x42c80000), SkBits2Float(0x 43ef6720), SkBits2Float(0x42480000), SkBits2Float(0x3f3504f3)); // 478.806f, 10 0, 478.806f, 50, 0.707107f 4991 path.conicTo(SkBits2Float(0x43ef6720), SkBits2Float(0x42c80000), SkBits2Float(0x 43ef6720), SkBits2Float(0x42480000), SkBits2Float(0x3f3504f3)); // 478.806f, 10 0, 478.806f, 50, 0.707107f
4992 path.close(); 4992 path.close();
4993 4993
4994 testSimplify(reporter, path, filename); 4994 testSimplify(reporter, path, filename);
4995 } 4995 }
4996 4996
4997 static void fuzz_twister(skiatest::Reporter* reporter, const char* filename) {
4998 SkPath path;
4999 path.setFillType((SkPath::FillType) 0);
5000 path.moveTo(0, 600);
5001 path.lineTo(3.35544e+07f, 600);
5002 path.lineTo(3.35544e+07f, 0);
5003 path.lineTo(0, 0);
5004 path.lineTo(0, 600);
5005 path.close();
5006 path.moveTo(63, 600);
5007 path.lineTo(3.35545e+07f, 600);
5008 path.lineTo(3.35545e+07f, 0);
5009 path.lineTo(63, 0);
5010 path.lineTo(63, 600);
5011 path.close();
5012 path.moveTo(93, 600);
5013 path.lineTo(3.35545e+07f, 600);
5014 path.lineTo(3.35545e+07f, 0);
5015 path.lineTo(93, 0);
5016 path.lineTo(93, 600);
5017 path.close();
5018 path.moveTo(123, 600);
5019 path.lineTo(3.35546e+07f, 600);
5020 path.lineTo(3.35546e+07f, 0);
5021 path.lineTo(123, 0);
5022 path.lineTo(123, 600);
5023 path.close();
5024 testSimplify(reporter, path, filename);
5025 }
5026
4997 static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0; 5027 static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0;
4998 static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0; 5028 static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0;
4999 static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0; 5029 static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0;
5000 5030
5001 static TestDesc tests[] = { 5031 static TestDesc tests[] = {
5032 TEST(fuzz_twister),
5002 TEST(fuzz994s_3414), 5033 TEST(fuzz994s_3414),
5003 TEST(fuzz994s_11), 5034 TEST(fuzz994s_11),
5004 TEST(cr514118), 5035 TEST(cr514118),
5005 TEST(fuzz864a), 5036 TEST(fuzz864a),
5006 TEST(testQuads65), 5037 TEST(testQuads65),
5007 TEST(testIssue3838_3), 5038 TEST(testIssue3838_3),
5008 TEST(testIssue3838), 5039 TEST(testIssue3838),
5009 TEST(testArc), 5040 TEST(testArc),
5010 TEST(testTriangle2), 5041 TEST(testTriangle2),
5011 TEST(testTriangle1), 5042 TEST(testTriangle1),
(...skipping 432 matching lines...) Expand 10 before | Expand all | Expand 10 after
5444 5475
5445 DEF_TEST(PathOpsSimplify, reporter) { 5476 DEF_TEST(PathOpsSimplify, reporter) {
5446 if (runSubTests && runSubTestsFirst) { 5477 if (runSubTests && runSubTestsFirst) {
5447 RunTestSet(reporter, subTests, subTestCount, firstSubTest, nullptr, stop Test, runReverse); 5478 RunTestSet(reporter, subTests, subTestCount, firstSubTest, nullptr, stop Test, runReverse);
5448 } 5479 }
5449 RunTestSet(reporter, tests, testCount, firstTest, skipTest, stopTest, runRev erse); 5480 RunTestSet(reporter, tests, testCount, firstTest, skipTest, stopTest, runRev erse);
5450 if (runSubTests && !runSubTestsFirst) { 5481 if (runSubTests && !runSubTestsFirst) {
5451 RunTestSet(reporter, subTests, subTestCount, firstSubTest, nullptr, stop Test, runReverse); 5482 RunTestSet(reporter, subTests, subTestCount, firstSubTest, nullptr, stop Test, runReverse);
5452 } 5483 }
5453 } 5484 }
OLDNEW
« no previous file with comments | « tests/PathOpsOpTest.cpp ('k') | tests/PathOpsSkpTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698