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

Side by Side Diff: tests/PathOpsOpTest.cpp

Issue 607913007: fail on extremely large coincident curves (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 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 | « src/pathops/SkOpSegment.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 #include "PathOpsTestCommon.h" 8 #include "PathOpsTestCommon.h"
9 9
10 #define TEST(name) { name, #name } 10 #define TEST(name) { name, #name }
(...skipping 3881 matching lines...) Expand 10 before | Expand all | Expand 10 after
3892 path.lineTo(SkBits2Float(0x42053333), SkBits2Float(0xc1cccccd)); 3892 path.lineTo(SkBits2Float(0x42053333), SkBits2Float(0xc1cccccd));
3893 path.lineTo(SkBits2Float(0x42780000), SkBits2Float(0xc18f3334)); 3893 path.lineTo(SkBits2Float(0x42780000), SkBits2Float(0xc18f3334));
3894 path.cubicTo(SkBits2Float(0x43206666), SkBits2Float(0x43134ccd), SkBits2Float(0x 43213333), SkBits2Float(0x430db333), SkBits2Float(0x43213333), SkBits2Float(0x43 080000)); 3894 path.cubicTo(SkBits2Float(0x43206666), SkBits2Float(0x43134ccd), SkBits2Float(0x 43213333), SkBits2Float(0x430db333), SkBits2Float(0x43213333), SkBits2Float(0x43 080000));
3895 path.lineTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000)); 3895 path.lineTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000));
3896 path.close(); 3896 path.close();
3897 3897
3898 SkPath path2(path); 3898 SkPath path2(path);
3899 testPathFailOp(reporter, path1, path2, (SkPathOp) 2, filename); 3899 testPathFailOp(reporter, path1, path2, (SkPathOp) 2, filename);
3900 } 3900 }
3901 3901
3902 static void fuzz714(skiatest::Reporter* reporter, const char* filename) {
3903 SkPath path;
3904 path.setFillType((SkPath::FillType) 1);
3905 path.moveTo(SkBits2Float(0x430c0000), SkBits2Float(0x42200000));
3906 path.lineTo(SkBits2Float(0x43480000), SkBits2Float(0x43520000));
3907 path.lineTo(SkBits2Float(0x42200000), SkBits2Float(0x42c80000));
3908 path.lineTo(SkBits2Float(0x64969569), SkBits2Float(0x42c80000));
3909 path.lineTo(SkBits2Float(0x64969569), SkBits2Float(0x43520000));
3910 path.lineTo(SkBits2Float(0x430c0000), SkBits2Float(0x42200000));
3911 path.close();
3912
3913 SkPath path1(path);
3914 path.reset();
3915 path.setFillType((SkPath::FillType) 0);
3916 path.moveTo(SkBits2Float(0x43200000), SkBits2Float(0x42700000));
3917 path.lineTo(SkBits2Float(0x435c0000), SkBits2Float(0x43660000));
3918 path.lineTo(SkBits2Float(0x42700000), SkBits2Float(0x42f00000));
3919 path.lineTo(SkBits2Float(0x64969569), SkBits2Float(0x42f00000));
3920 path.lineTo(SkBits2Float(0x64969569), SkBits2Float(0x43660000));
3921 path.lineTo(SkBits2Float(0x43200000), SkBits2Float(0x42700000));
3922 path.close();
3923
3924 SkPath path2(path);
3925 testPathFailOp(reporter, path1, path2, (SkPathOp) 2, filename);
3926 }
3927
3902 static struct TestDesc failTests[] = { 3928 static struct TestDesc failTests[] = {
3929 TEST(fuzz714),
3903 TEST(fuzz487a), 3930 TEST(fuzz487a),
3904 TEST(fuzz487b), 3931 TEST(fuzz487b),
3905 TEST(fuzz433b), 3932 TEST(fuzz433b),
3906 TEST(fuzz433), 3933 TEST(fuzz433),
3907 TEST(bufferOverflow), 3934 TEST(bufferOverflow),
3908 }; 3935 };
3909 3936
3910 static const size_t failTestCount = SK_ARRAY_COUNT(failTests); 3937 static const size_t failTestCount = SK_ARRAY_COUNT(failTests);
3911 3938
3912 DEF_TEST(PathOpsFailOp, reporter) { 3939 DEF_TEST(PathOpsFailOp, reporter) {
3913 #if DEBUG_SHOW_TEST_NAME 3940 #if DEBUG_SHOW_TEST_NAME
3914 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH); 3941 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH);
3915 #endif 3942 #endif
3916 RunTestSet(reporter, failTests, failTestCount, 0, 0, false); 3943 RunTestSet(reporter, failTests, failTestCount, 0, 0, false);
3917 } 3944 }
OLDNEW
« no previous file with comments | « src/pathops/SkOpSegment.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698