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/PathOpsSimplifyTest.cpp

Issue 2427253005: fix more fuzz, carsvg (Closed)
Patch Set: Created 4 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/PathOpsSimplifyFailTest.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
(...skipping 5540 matching lines...) Expand 10 before | Expand all | Expand 10 after
5551 SkPath path; 5551 SkPath path;
5552 path.setFillType((SkPath::FillType) 0); 5552 path.setFillType((SkPath::FillType) 0);
5553 path.moveTo(SkBits2Float(0x42b93333), SkBits2Float(0x43d5a666)); // 92.6f, 427. 3f 5553 path.moveTo(SkBits2Float(0x42b93333), SkBits2Float(0x43d5a666)); // 92.6f, 427. 3f
5554 path.cubicTo(SkBits2Float(0x42b93333), SkBits2Float(0x43d5a666), SkBits2Float(0x 42b5cccd), SkBits2Float(0x43da1999), SkBits2Float(0x42b80000), SkBits2Float(0x43 ddf333)); // 92.6f, 427.3f, 90.9f, 436.2f, 92, 443.9f 5554 path.cubicTo(SkBits2Float(0x42b93333), SkBits2Float(0x43d5a666), SkBits2Float(0x 42b5cccd), SkBits2Float(0x43da1999), SkBits2Float(0x42b80000), SkBits2Float(0x43 ddf333)); // 92.6f, 427.3f, 90.9f, 436.2f, 92, 443.9f
5555 path.cubicTo(SkBits2Float(0x42b80000), SkBits2Float(0x43ddf333), SkBits2Float(0x 42b30000), SkBits2Float(0x43e17333), SkBits2Float(0x42cf999a), SkBits2Float(0x43 e1b333)); // 92, 443.9f, 89.5f, 450.9f, 103.8f, 451.4f 5555 path.cubicTo(SkBits2Float(0x42b80000), SkBits2Float(0x43ddf333), SkBits2Float(0x 42b30000), SkBits2Float(0x43e17333), SkBits2Float(0x42cf999a), SkBits2Float(0x43 e1b333)); // 92, 443.9f, 89.5f, 450.9f, 103.8f, 451.4f
5556 path.cubicTo(SkBits2Float(0x42ec3334), SkBits2Float(0x43e14ccd), SkBits2Float(0x 42e73334), SkBits2Float(0x43ddf333), SkBits2Float(0x42e73334), SkBits2Float(0x43 ddf333)); // 118.1f, 450.6f, 115.6f, 443.9f, 115.6f, 443.9f 5556 path.cubicTo(SkBits2Float(0x42ec3334), SkBits2Float(0x43e14ccd), SkBits2Float(0x 42e73334), SkBits2Float(0x43ddf333), SkBits2Float(0x42e73334), SkBits2Float(0x43 ddf333)); // 118.1f, 450.6f, 115.6f, 443.9f, 115.6f, 443.9f
5557 path.cubicTo(SkBits2Float(0x42e7999a), SkBits2Float(0x43de8000), SkBits2Float(0x 42ea6667), SkBits2Float(0x43db4000), SkBits2Float(0x42e60001), SkBits2Float(0x43 d5a666)); // 115.8f, 445, 117.2f, 438.5f, 115, 427.3f 5557 path.cubicTo(SkBits2Float(0x42e7999a), SkBits2Float(0x43de8000), SkBits2Float(0x 42ea6667), SkBits2Float(0x43db4000), SkBits2Float(0x42e60001), SkBits2Float(0x43 d5a666)); // 115.8f, 445, 117.2f, 438.5f, 115, 427.3f
5558 testSimplify(reporter, path, filename); 5558 testSimplify(reporter, path, filename);
5559 } 5559 }
5560 5560
5561 // triggers angle assert from distance field code
5562 static void carsvg_1(skiatest::Reporter* reporter, const char* filename) {
5563 SkPath path;
5564 path.setFillType((SkPath::FillType) 0);
5565 path.moveTo(SkBits2Float(0x4393d61e), SkBits2Float(0x43e768f9)); // 295.673f, 4 62.82f
5566 path.cubicTo(SkBits2Float(0x4396b50e), SkBits2Float(0x43e63c20), SkBits2Float(0x 43998931), SkBits2Float(0x43e6c43e), SkBits2Float(0x439cb6a8), SkBits2Float(0x43 e70ef9)); // 301.414f, 460.47f, 307.072f, 461.533f, 313.427f, 462.117f
5567 path.cubicTo(SkBits2Float(0x439dfc1e), SkBits2Float(0x43e72ce0), SkBits2Float(0x 439a285c), SkBits2Float(0x43e717fb), SkBits2Float(0x4398e23c), SkBits2Float(0x43 e7027c)); // 315.97f, 462.351f, 308.315f, 462.187f, 305.767f, 462.019f
5568 path.cubicTo(SkBits2Float(0x4398136f), SkBits2Float(0x43e6f4db), SkBits2Float(0x 439a7e14), SkBits2Float(0x43e6d390), SkBits2Float(0x439b4ba9), SkBits2Float(0x43 e6b956)); // 304.152f, 461.913f, 308.985f, 461.653f, 310.591f, 461.448f
5569 path.cubicTo(SkBits2Float(0x439c2b19), SkBits2Float(0x43e68603), SkBits2Float(0x 43abf4df), SkBits2Float(0x43e9ca9e), SkBits2Float(0x43a1daea), SkBits2Float(0x43 e912a5)); // 312.337f, 461.047f, 343.913f, 467.583f, 323.71f, 466.146f
5570 path.cubicTo(SkBits2Float(0x43a4f45a), SkBits2Float(0x43e78baf), SkBits2Float(0x 43a2a391), SkBits2Float(0x43e86a82), SkBits2Float(0x43a946bd), SkBits2Float(0x43 e90c56)); // 329.909f, 463.091f, 325.278f, 464.832f, 338.553f, 466.096f
5571 path.lineTo(SkBits2Float(0x43a4250b), SkBits2Float(0x43e998dc)); // 328.289f, 4 67.194f
5572 path.cubicTo(SkBits2Float(0x43a8a9c8), SkBits2Float(0x43e8f06c), SkBits2Float(0x 43a95cb5), SkBits2Float(0x43e84ea6), SkBits2Float(0x43a6f7c1), SkBits2Float(0x43 e9bdb5)); // 337.326f, 465.878f, 338.724f, 464.614f, 333.936f, 467.482f
5573 path.cubicTo(SkBits2Float(0x43a59ed0), SkBits2Float(0x43e9d2ca), SkBits2Float(0x 4395ea4d), SkBits2Float(0x43e92afe), SkBits2Float(0x43a06569), SkBits2Float(0x43 e7773d)); // 331.241f, 467.647f, 299.83f, 466.336f, 320.792f, 462.932f
5574 path.cubicTo(SkBits2Float(0x438bf0ff), SkBits2Float(0x43ea0fef), SkBits2Float(0x 43a0e17a), SkBits2Float(0x43e5f41b), SkBits2Float(0x4398f3fb), SkBits2Float(0x43 e804c8)); // 279.883f, 468.124f, 321.762f, 459.907f, 305.906f, 464.037f
5575 path.lineTo(SkBits2Float(0x4393d61e), SkBits2Float(0x43e768f9)); // 295.673f, 4 62.82f
5576 path.close();
5577
5578 testSimplify(reporter, path, filename);
5579 }
5580
5561 static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0; 5581 static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0;
5562 static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0; 5582 static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0;
5563 static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0; 5583 static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0;
5564 5584
5565 static TestDesc tests[] = { 5585 static TestDesc tests[] = {
5586 TEST(carsvg_1),
5566 TEST(tiger8_393), 5587 TEST(tiger8_393),
5567 TEST(bug5169), 5588 TEST(bug5169),
5568 TEST(testQuads73), 5589 TEST(testQuads73),
5569 TEST(testQuads72), 5590 TEST(testQuads72),
5570 TEST(testQuads71), 5591 TEST(testQuads71),
5571 TEST(testQuads70), 5592 TEST(testQuads70),
5572 TEST(testQuads69), 5593 TEST(testQuads69),
5573 TEST(testQuads68), 5594 TEST(testQuads68),
5574 TEST(testQuads67), 5595 TEST(testQuads67),
5575 TEST(testQuads66), 5596 TEST(testQuads66),
(...skipping 446 matching lines...) Expand 10 before | Expand all | Expand 10 after
6022 6043
6023 DEF_TEST(PathOpsSimplify, reporter) { 6044 DEF_TEST(PathOpsSimplify, reporter) {
6024 if (runSubTests && runSubTestsFirst) { 6045 if (runSubTests && runSubTestsFirst) {
6025 RunTestSet(reporter, subTests, subTestCount, firstSubTest, nullptr, stop Test, runReverse); 6046 RunTestSet(reporter, subTests, subTestCount, firstSubTest, nullptr, stop Test, runReverse);
6026 } 6047 }
6027 RunTestSet(reporter, tests, testCount, firstTest, skipTest, stopTest, runRev erse); 6048 RunTestSet(reporter, tests, testCount, firstTest, skipTest, stopTest, runRev erse);
6028 if (runSubTests && !runSubTestsFirst) { 6049 if (runSubTests && !runSubTestsFirst) {
6029 RunTestSet(reporter, subTests, subTestCount, firstSubTest, nullptr, stop Test, runReverse); 6050 RunTestSet(reporter, subTests, subTestCount, firstSubTest, nullptr, stop Test, runReverse);
6030 } 6051 }
6031 } 6052 }
OLDNEW
« no previous file with comments | « tests/PathOpsSimplifyFailTest.cpp ('k') | tools/pathops_sorter.htm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698