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

Side by Side Diff: tests/PathOpsOpTest.cpp

Issue 1037953004: add conics to path ops (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: turn off pathops specific debuggging Created 5 years, 8 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/PathOpsOpRectThreadedTest.cpp ('k') | tests/PathOpsQuadIntersectionTest.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 #include "PathOpsTestCommon.h" 8 #include "PathOpsTestCommon.h"
9 9
10 #define TEST(name) { name, #name } 10 #define TEST(name) { name, #name }
(...skipping 3777 matching lines...) Expand 10 before | Expand all | Expand 10 after
3788 path.moveTo(0,1); 3788 path.moveTo(0,1);
3789 path.cubicTo(0,3, 3,2, 5,2); 3789 path.cubicTo(0,3, 3,2, 5,2);
3790 path.close(); 3790 path.close();
3791 pathB.setFillType(SkPath::kWinding_FillType); 3791 pathB.setFillType(SkPath::kWinding_FillType);
3792 pathB.moveTo(2,3); 3792 pathB.moveTo(2,3);
3793 pathB.cubicTo(2,5, 1,0, 3,0); 3793 pathB.cubicTo(2,5, 1,0, 3,0);
3794 pathB.close(); 3794 pathB.close();
3795 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename); 3795 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3796 } 3796 }
3797 3797
3798 static void cubicOp129(skiatest::Reporter* reporter, const char* filename) {
3799 SkPath path, pathB;
3800 path.setFillType(SkPath::kWinding_FillType);
3801 path.moveTo(5,6);
3802 path.cubicTo(3,4, 2,0, 2,1);
3803 path.close();
3804 pathB.setFillType(SkPath::kWinding_FillType);
3805 pathB.moveTo(0,2);
3806 pathB.cubicTo(1,2, 6,5, 4,3);
3807 pathB.close();
3808 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3809 }
3810
3811 static void cubicOp130(skiatest::Reporter* reporter, const char* filename) {
3812 SkPath path, pathB;
3813 path.setFillType(SkPath::kWinding_FillType);
3814 path.moveTo(5,6);
3815 path.cubicTo(4,6, 3,0, 2,1);
3816 path.close();
3817 pathB.setFillType(SkPath::kWinding_FillType);
3818 pathB.moveTo(0,3);
3819 pathB.cubicTo(1,2, 6,5, 6,4);
3820 pathB.close();
3821 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3822 }
3823
3824 #include "SkGeometry.h"
3825
3826 static void complex_to_quads(const SkPoint pts[], SkPath* path) {
3827 SkScalar loopT;
3828 if (SkDCubic::ComplexBreak(pts, &loopT)) {
3829 SkPoint cubicPair[7];
3830 SkChopCubicAt(pts, cubicPair, loopT);
3831 SkDCubic c1, c2;
3832 c1.set(cubicPair);
3833 c2.set(&cubicPair[3]);
3834 SkDQuad q1 = c1.toQuad();
3835 SkDQuad q2 = c2.toQuad();
3836 path->quadTo(q1[1].asSkPoint(), q1[2].asSkPoint());
3837 path->quadTo(q2[1].asSkPoint(), q2[2].asSkPoint());
3838 } else {
3839 path->cubicTo(pts[1], pts[2], pts[3]);
3840 }
3841 }
3842
3843 static void cubicOp130a(skiatest::Reporter* reporter, const char* filename) {
3844 SkPath path, pathB;
3845 path.setFillType(SkPath::kWinding_FillType);
3846 path.moveTo(5,6);
3847 SkPoint pts[] = { {5,6}, {4,6}, {3,0}, {2,1} };
3848 complex_to_quads(pts, &path);
3849 path.close();
3850 pathB.setFillType(SkPath::kWinding_FillType);
3851 pathB.moveTo(0,3);
3852 SkPoint pts2[] = { {0,3}, {1,2}, {6,5}, {6,4} };
3853 complex_to_quads(pts2, &path);
3854 pathB.close();
3855 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3856 }
3857
3858 static void cubicOp131(skiatest::Reporter* reporter, const char* filename) {
3859 SkPath path, pathB;
3860 path.setFillType(SkPath::kWinding_FillType);
3861 path.moveTo(0,1);
3862 path.cubicTo(3,4, 3,0, 6,2);
3863 path.close();
3864 pathB.setFillType(SkPath::kWinding_FillType);
3865 pathB.moveTo(0,3);
3866 pathB.cubicTo(2,6, 1,0, 4,3);
3867 pathB.close();
3868 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3869 }
3870
3871 static void circlesOp1(skiatest::Reporter* reporter, const char* filename) {
3872 SkPath path, pathB;
3873 path.setFillType(SkPath::kWinding_FillType);
3874 path.addCircle(0, 1, 2, SkPath::kCCW_Direction);
3875 pathB.setFillType(SkPath::kWinding_FillType);
3876 pathB.addCircle(0, 1, 1, SkPath::kCW_Direction);
3877 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3878 }
3879
3880 static void circlesOp2(skiatest::Reporter* reporter, const char* filename) {
3881 SkPath path, pathB;
3882 path.setFillType(SkPath::kWinding_FillType);
3883 path.addCircle(0, 1, 4, SkPath::kCCW_Direction);
3884 pathB.setFillType(SkPath::kWinding_FillType);
3885 pathB.addCircle(0, 4, 3, SkPath::kCW_Direction);
3886 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
3887 }
3888
3889 static void rRect1x(skiatest::Reporter* reporter, const char* filename) {
3890 SkPath path, pathB;
3891 path.setFillType(SkPath::kEvenOdd_FillType);
3892 path.moveTo(20.65f, 5.65f);
3893 path.conicTo(20.65f, 1.13612f, 25.1404f, 0.65f, 0.888488f);
3894 path.lineTo(25.65f, 0.65f);
3895 path.lineTo(26.1596f, 0.67604f);
3896 path.conicTo(30.65f, 1.13612f, 30.65f, 5.65f, 0.888488f);
3897 path.lineTo(30.65f, 25.65f);
3898 path.conicTo(30.65f, 20.65f, 25.65f, 20.65f, 0.707107f);
3899 path.lineTo(20.65f, 20.65f);
3900 path.lineTo(20.65f, 5.65f);
3901 path.close();
3902 path.moveTo(20.65f, 20.65f);
3903 path.lineTo(5.65f, 20.65f);
3904 path.conicTo(0.65f, 20.65f, 0.65f, 25.65f, 0.707107f);
3905 path.lineTo(0.65f, 45.65f);
3906 path.conicTo(0.65f, 50.65f, 5.65f, 50.65f, 0.707107f);
3907 path.lineTo(25.65f, 50.65f);
3908 path.conicTo(30.65f, 50.65f, 30.65f, 45.65f, 0.707107f);
3909 path.lineTo(30.65f, 25.65f);
3910 path.conicTo(30.65f, 30.65f, 25.65f, 30.65f, 0.707107f);
3911 path.conicTo(20.65f, 30.65f, 20.65f, 25.65f, 0.707107f);
3912 path.lineTo(20.65f, 20.65f);
3913 path.close();
3914 SkPath path1(path);
3915
3916 path.reset();
3917 path.setFillType(SkPath::kWinding_FillType);
3918 path.moveTo(20.65f, 45.65f);
3919 path.lineTo(20.65f, 25.65f);
3920 path.conicTo(20.65f, 20.65f, 25.65f, 20.65f, 0.707107f);
3921 path.lineTo(45.65f, 20.65f);
3922 path.conicTo(50.65f, 20.65f, 50.65f, 25.65f, 0.707107f);
3923 path.lineTo(50.65f, 45.65f);
3924 path.conicTo(50.65f, 50.65f, 45.65f, 50.65f, 0.707107f);
3925 path.lineTo(25.65f, 50.65f);
3926 path.conicTo(20.65f, 50.65f, 20.65f, 45.65f, 0.707107f);
3927 path.close();
3928 SkPath path2(path);
3929
3930 testPathOp(reporter, path1, path2, kDifference_SkPathOp, filename);
3931 }
3932
3933 static void loop7(skiatest::Reporter* reporter, const char* filename) {
3934 SkPath path, pathB;
3935 path.moveTo(0,1);
3936 path.cubicTo(3,4, -1,0, 8.5f,-2.5f);
3937 path.close();
3938 pathB.moveTo(3,4);
3939 pathB.cubicTo(-1,0, 8.5f,-2.5f, 0,1);
3940 pathB.close();
3941 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
3942 }
3943
3944 static void rects5(skiatest::Reporter* reporter, const char* filename) {
3945 SkPath path, pathB;
3946 path.setFillType(SkPath::kWinding_FillType);
3947 path.addRect(5, 5, 6, 6, SkPath::kCW_Direction);
3948 path.addRect(5, 5, 6, 6, SkPath::kCW_Direction);
3949 pathB.setFillType(SkPath::kEvenOdd_FillType);
3950 pathB.addRect(0, 0, 6, 6, SkPath::kCW_Direction);
3951 pathB.addRect(5, 5, 6, 6, SkPath::kCW_Direction);
3952 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3953 }
3954
3955 static void loop8(skiatest::Reporter* reporter, const char* filename) {
3956 SkPath path, pathB;
3957 path.moveTo(0,1);
3958 path.cubicTo(1,4, -3.83333325f,0.166666627f, 6,-1);
3959 path.close();
3960 pathB.moveTo(1,4);
3961 pathB.cubicTo(-3.83333325f,0.166666627f, 6,-1, 0,1);
3962 pathB.close();
3963 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
3964 }
3965
3966 static void loop9(skiatest::Reporter* reporter, const char* filename) {
3967 SkPath path, pathB;
3968 path.moveTo(0,1);
3969 path.cubicTo(1,3, -2.5f,0, 3.33333325f,-0.666666627f);
3970 path.close();
3971 pathB.moveTo(1,3);
3972 pathB.cubicTo(-2.5f,0, 3.33333325f,-0.666666627f, 0,1);
3973 pathB.close();
3974 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
3975 }
3976
3977 static void circlesOp3(skiatest::Reporter* reporter, const char* filename) {
3978 SkPath path, pathB;
3979 path.setFillType(SkPath::kWinding_FillType);
3980 path.addCircle(0, 1, 2, SkPath::kCCW_Direction);
3981 pathB.setFillType(SkPath::kWinding_FillType);
3982 pathB.addCircle(3, 5, 3, SkPath::kCW_Direction);
3983 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
3984 }
3985
3986 static void loop10(skiatest::Reporter* reporter, const char* filename) {
3987 SkPath path, pathB;
3988 path.moveTo(5,6);
3989 path.cubicTo(1,2, 1,2, -3.66666651f,13.333334f);
3990 path.close();
3991 pathB.moveTo(1,2);
3992 pathB.cubicTo(1,2, -3.66666651f,13.333334f, 5,6);
3993 pathB.close();
3994 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
3995 }
3996
3997 static void loop11(skiatest::Reporter* reporter, const char* filename) {
3998 SkPath path, pathB;
3999 path.moveTo(0,1);
4000 path.cubicTo(1,3, -1.83333349f,1.33333337f, 4,-1);
4001 path.close();
4002 pathB.moveTo(1,3);
4003 pathB.cubicTo(-1.83333349f,1.33333337f, 4,-1, 0,1);
4004 pathB.close();
4005 testPathOp(reporter, path, pathB, kIntersect_SkPathOp, filename);
4006 }
4007
4008 static void cubicOp132(skiatest::Reporter* reporter, const char* filename) {
4009 SkPath path, pathB;
4010 path.setFillType(SkPath::kWinding_FillType);
4011 path.moveTo(5,6);
4012 path.cubicTo(3,4, 3,0, 3,2);
4013 path.close();
4014 pathB.setFillType(SkPath::kWinding_FillType);
4015 pathB.moveTo(0,3);
4016 pathB.cubicTo(2,3, 6,5, 4,3);
4017 pathB.close();
4018 testPathOp(reporter, path, pathB, kDifference_SkPathOp, filename);
4019 }
4020
3798 static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0; 4021 static void (*skipTest)(skiatest::Reporter* , const char* filename) = 0;
3799 static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0; 4022 static void (*firstTest)(skiatest::Reporter* , const char* filename) = 0;
3800 static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0; 4023 static void (*stopTest)(skiatest::Reporter* , const char* filename) = 0;
3801 4024
3802 static struct TestDesc tests[] = { 4025 static struct TestDesc tests[] = {
4026 TEST(cubicOp132),
4027 TEST(loop11),
4028 TEST(loop10),
4029 TEST(circlesOp3),
4030 TEST(loop9),
4031 TEST(loop8),
4032 TEST(rects5),
4033 TEST(loop7),
4034 TEST(cubicOp130a),
4035 TEST(rRect1x),
4036 TEST(circlesOp2),
4037 TEST(circlesOp1),
4038 TEST(cubicOp131),
4039 TEST(cubicOp130),
4040 TEST(cubicOp129),
3803 TEST(cubicOp128), 4041 TEST(cubicOp128),
3804 TEST(cubicOp127), 4042 TEST(cubicOp127),
3805 TEST(cubicOp126), 4043 TEST(cubicOp126),
3806 TEST(cubicOp125), 4044 TEST(cubicOp125),
3807 TEST(cubicOp124), 4045 TEST(cubicOp124),
3808 TEST(loop6), 4046 TEST(loop6),
3809 TEST(loop5), 4047 TEST(loop5),
3810 TEST(cubicOp123), 4048 TEST(cubicOp123),
3811 TEST(cubicOp122), 4049 TEST(cubicOp122),
3812 TEST(cubicOp121), 4050 TEST(cubicOp121),
(...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after
4081 path1.lineTo(-170,11000000000.0f); 4319 path1.lineTo(-170,11000000000.0f);
4082 path1.close(); 4320 path1.close();
4083 4321
4084 path2.moveTo(100 + 20,0 + 20); 4322 path2.moveTo(100 + 20,0 + 20);
4085 path2.lineTo(60 + 20,170 + 20); 4323 path2.lineTo(60 + 20,170 + 20);
4086 path2.lineTo(-160 + 20,-110 + 20); 4324 path2.lineTo(-160 + 20,-110 + 20);
4087 path2.lineTo(200 + 20,0 + 20); 4325 path2.lineTo(200 + 20,0 + 20);
4088 path2.lineTo(-170 + 20,11000000000.0f + 20); 4326 path2.lineTo(-170 + 20,11000000000.0f + 20);
4089 path2.close(); 4327 path2.close();
4090 4328
4091 testPathOpCheck(reporter, path1, path2, kIntersect_SkPathOp, filename, FLAGS _runFail); 4329 testPathOpFailCheck(reporter, path1, path2, kIntersect_SkPathOp, filename);
4092 } 4330 }
4093 4331
4094 static void fuzz433b(skiatest::Reporter* reporter, const char* filename) { 4332 static void fuzz433b(skiatest::Reporter* reporter, const char* filename) {
4095 SkPath path1, path2; 4333 SkPath path1, path2;
4096 path1.setFillType(SkPath::kEvenOdd_FillType); 4334 path1.setFillType(SkPath::kEvenOdd_FillType);
4097 path1.moveTo(140, 40); 4335 path1.moveTo(140, 40);
4098 path1.lineTo(200, 210); 4336 path1.lineTo(200, 210);
4099 path1.lineTo(40, 100); 4337 path1.lineTo(40, 100);
4100 path1.lineTo(240, 100); 4338 path1.lineTo(240, 100);
4101 path1.lineTo(70, 1.1e+10f); 4339 path1.lineTo(70, 1.1e+10f);
4102 path1.lineTo(140, 40); 4340 path1.lineTo(140, 40);
4103 path1.close(); 4341 path1.close();
4104 4342
4105 path1.setFillType(SkPath::kWinding_FillType); 4343 path1.setFillType(SkPath::kWinding_FillType);
4106 path2.moveTo(190, 60); 4344 path2.moveTo(190, 60);
4107 path2.lineTo(250, 230); 4345 path2.lineTo(250, 230);
4108 path2.lineTo(90, 120); 4346 path2.lineTo(90, 120);
4109 path2.lineTo(290, 120); 4347 path2.lineTo(290, 120);
4110 path2.lineTo(120, 1.1e+10f); 4348 path2.lineTo(120, 1.1e+10f);
4111 path2.lineTo(190, 60); 4349 path2.lineTo(190, 60);
4112 path2.close(); 4350 path2.close();
4113 4351
4114 testPathOpCheck(reporter, path1, path2, kUnion_SkPathOp, filename, FLAGS_run Fail); 4352 testPathOpFailCheck(reporter, path1, path2, kUnion_SkPathOp, filename);
4115 } 4353 }
4116 4354
4117 static void fuzz487a(skiatest::Reporter* reporter, const char* filename) { 4355 static void fuzz487a(skiatest::Reporter* reporter, const char* filename) {
4118 SkPath path; 4356 SkPath path;
4119 path.setFillType((SkPath::FillType) 0); 4357 path.setFillType((SkPath::FillType) 0);
4120 path.moveTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000)); 4358 path.moveTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000));
4121 path.lineTo(SkBits2Float(0x4309999a), SkBits2Float(0x42c00000)); 4359 path.lineTo(SkBits2Float(0x4309999a), SkBits2Float(0x42c00000));
4122 path.cubicTo(SkBits2Float(0x4309999a), SkBits2Float(0x429a6666), SkBits2Float(0x 42f9999a), SkBits2Float(0x4275999a), SkBits2Float(0x42d70001), SkBits2Float(0x42 633333)); 4360 path.cubicTo(SkBits2Float(0x4309999a), SkBits2Float(0x429a6666), SkBits2Float(0x 42f9999a), SkBits2Float(0x4275999a), SkBits2Float(0x42d70001), SkBits2Float(0x42 633333));
4123 path.lineTo(SkBits2Float(0x42e90001), SkBits2Float(0x41b8cccc)); 4361 path.lineTo(SkBits2Float(0x42e90001), SkBits2Float(0x41b8cccc));
4124 path.cubicTo(SkBits2Float(0x42dc6667), SkBits2Float(0x41ab3332), SkBits2Float(0x 42cf3334), SkBits2Float(0x41a3ffff), SkBits2Float(0x42c20001), SkBits2Float(0x41 a3ffff)); 4362 path.cubicTo(SkBits2Float(0x42dc6667), SkBits2Float(0x41ab3332), SkBits2Float(0x 42cf3334), SkBits2Float(0x41a3ffff), SkBits2Float(0x42c20001), SkBits2Float(0x41 a3ffff));
(...skipping 25 matching lines...) Expand all
4150 path.cubicTo(SkBits2Float(0x4272cccc), SkBits2Float(0x4303199a), SkBits2Float(0x 423d3332), SkBits2Float(0x430de667), SkBits2Float(0x422d9999), SkBits2Float(0x43 1cb334)); 4388 path.cubicTo(SkBits2Float(0x4272cccc), SkBits2Float(0x4303199a), SkBits2Float(0x 423d3332), SkBits2Float(0x430de667), SkBits2Float(0x422d9999), SkBits2Float(0x43 1cb334));
4151 path.lineTo(SkBits2Float(0x7086a1dc), SkBits2Float(0x42eecccd)); 4389 path.lineTo(SkBits2Float(0x7086a1dc), SkBits2Float(0x42eecccd));
4152 path.lineTo(SkBits2Float(0x41eb3333), SkBits2Float(0xc12ccccd)); 4390 path.lineTo(SkBits2Float(0x41eb3333), SkBits2Float(0xc12ccccd));
4153 path.lineTo(SkBits2Float(0x42053333), SkBits2Float(0xc1cccccd)); 4391 path.lineTo(SkBits2Float(0x42053333), SkBits2Float(0xc1cccccd));
4154 path.lineTo(SkBits2Float(0x42780000), SkBits2Float(0xc18f3334)); 4392 path.lineTo(SkBits2Float(0x42780000), SkBits2Float(0xc18f3334));
4155 path.cubicTo(SkBits2Float(0x43206666), SkBits2Float(0x43134ccd), SkBits2Float(0x 43213333), SkBits2Float(0x430db333), SkBits2Float(0x43213333), SkBits2Float(0x43 080000)); 4393 path.cubicTo(SkBits2Float(0x43206666), SkBits2Float(0x43134ccd), SkBits2Float(0x 43213333), SkBits2Float(0x430db333), SkBits2Float(0x43213333), SkBits2Float(0x43 080000));
4156 path.lineTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000)); 4394 path.lineTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000));
4157 path.close(); 4395 path.close();
4158 4396
4159 SkPath path2(path); 4397 SkPath path2(path);
4160 testPathOpCheck(reporter, path1, path2, (SkPathOp) 2, filename, FLAGS_runFai l); 4398 testPathOpFailCheck(reporter, path1, path2, (SkPathOp) 2, filename);
4161 } 4399 }
4162 4400
4163 static void fuzz487b(skiatest::Reporter* reporter, const char* filename) { 4401 static void fuzz487b(skiatest::Reporter* reporter, const char* filename) {
4164 SkPath path; 4402 SkPath path;
4165 path.setFillType((SkPath::FillType) 0); 4403 path.setFillType((SkPath::FillType) 0);
4166 path.moveTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000)); 4404 path.moveTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000));
4167 path.lineTo(SkBits2Float(0x4309999a), SkBits2Float(0x42c00000)); 4405 path.lineTo(SkBits2Float(0x4309999a), SkBits2Float(0x42c00000));
4168 path.cubicTo(SkBits2Float(0x4309999a), SkBits2Float(0x429a6666), SkBits2Float(0x 42f9999a), SkBits2Float(0x4275999a), SkBits2Float(0x42d70001), SkBits2Float(0x42 633333)); 4406 path.cubicTo(SkBits2Float(0x4309999a), SkBits2Float(0x429a6666), SkBits2Float(0x 42f9999a), SkBits2Float(0x4275999a), SkBits2Float(0x42d70001), SkBits2Float(0x42 633333));
4169 path.lineTo(SkBits2Float(0x42e90001), SkBits2Float(0x41b8cccc)); 4407 path.lineTo(SkBits2Float(0x42e90001), SkBits2Float(0x41b8cccc));
4170 path.cubicTo(SkBits2Float(0x42dc6667), SkBits2Float(0x41ab3332), SkBits2Float(0x 42cf3334), SkBits2Float(0x41a3ffff), SkBits2Float(0x42c20001), SkBits2Float(0x41 a3ffff)); 4408 path.cubicTo(SkBits2Float(0x42dc6667), SkBits2Float(0x41ab3332), SkBits2Float(0x 42cf3334), SkBits2Float(0x41a3ffff), SkBits2Float(0x42c20001), SkBits2Float(0x41 a3ffff));
(...skipping 25 matching lines...) Expand all
4196 path.cubicTo(SkBits2Float(0x4272cccc), SkBits2Float(0x4303199a), SkBits2Float(0x 423d3332), SkBits2Float(0x430de667), SkBits2Float(0x422d9999), SkBits2Float(0x43 1cb334)); 4434 path.cubicTo(SkBits2Float(0x4272cccc), SkBits2Float(0x4303199a), SkBits2Float(0x 423d3332), SkBits2Float(0x430de667), SkBits2Float(0x422d9999), SkBits2Float(0x43 1cb334));
4197 path.lineTo(SkBits2Float(0x7086a1dc), SkBits2Float(0x42eecccd)); 4435 path.lineTo(SkBits2Float(0x7086a1dc), SkBits2Float(0x42eecccd));
4198 path.lineTo(SkBits2Float(0x41eb3333), SkBits2Float(0xc12ccccd)); 4436 path.lineTo(SkBits2Float(0x41eb3333), SkBits2Float(0xc12ccccd));
4199 path.lineTo(SkBits2Float(0x42053333), SkBits2Float(0xc1cccccd)); 4437 path.lineTo(SkBits2Float(0x42053333), SkBits2Float(0xc1cccccd));
4200 path.lineTo(SkBits2Float(0x42780000), SkBits2Float(0xc18f3334)); 4438 path.lineTo(SkBits2Float(0x42780000), SkBits2Float(0xc18f3334));
4201 path.cubicTo(SkBits2Float(0x43206666), SkBits2Float(0x43134ccd), SkBits2Float(0x 43213333), SkBits2Float(0x430db333), SkBits2Float(0x43213333), SkBits2Float(0x43 080000)); 4439 path.cubicTo(SkBits2Float(0x43206666), SkBits2Float(0x43134ccd), SkBits2Float(0x 43213333), SkBits2Float(0x430db333), SkBits2Float(0x43213333), SkBits2Float(0x43 080000));
4202 path.lineTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000)); 4440 path.lineTo(SkBits2Float(0x432c8000), SkBits2Float(0x42c00000));
4203 path.close(); 4441 path.close();
4204 4442
4205 SkPath path2(path); 4443 SkPath path2(path);
4206 testPathOpCheck(reporter, path1, path2, (SkPathOp) 2, filename, FLAGS_runFai l); 4444 testPathOpFailCheck(reporter, path1, path2, (SkPathOp) 2, filename);
4207 } 4445 }
4208 4446
4209 static void fuzz714(skiatest::Reporter* reporter, const char* filename) { 4447 static void fuzz714(skiatest::Reporter* reporter, const char* filename) {
4210 SkPath path; 4448 SkPath path;
4211 path.setFillType((SkPath::FillType) 1); 4449 path.setFillType((SkPath::FillType) 1);
4212 path.moveTo(SkBits2Float(0x430c0000), SkBits2Float(0x42200000)); 4450 path.moveTo(SkBits2Float(0x430c0000), SkBits2Float(0x42200000));
4213 path.lineTo(SkBits2Float(0x43480000), SkBits2Float(0x43520000)); 4451 path.lineTo(SkBits2Float(0x43480000), SkBits2Float(0x43520000));
4214 path.lineTo(SkBits2Float(0x42200000), SkBits2Float(0x42c80000)); 4452 path.lineTo(SkBits2Float(0x42200000), SkBits2Float(0x42c80000));
4215 path.lineTo(SkBits2Float(0x64969569), SkBits2Float(0x42c80000)); 4453 path.lineTo(SkBits2Float(0x64969569), SkBits2Float(0x42c80000));
4216 path.lineTo(SkBits2Float(0x64969569), SkBits2Float(0x43520000)); 4454 path.lineTo(SkBits2Float(0x64969569), SkBits2Float(0x43520000));
4217 path.lineTo(SkBits2Float(0x430c0000), SkBits2Float(0x42200000)); 4455 path.lineTo(SkBits2Float(0x430c0000), SkBits2Float(0x42200000));
4218 path.close(); 4456 path.close();
4219 4457
4220 SkPath path1(path); 4458 SkPath path1(path);
4221 path.reset(); 4459 path.reset();
4222 path.setFillType((SkPath::FillType) 0); 4460 path.setFillType((SkPath::FillType) 0);
4223 path.moveTo(SkBits2Float(0x43200000), SkBits2Float(0x42700000)); 4461 path.moveTo(SkBits2Float(0x43200000), SkBits2Float(0x42700000));
4224 path.lineTo(SkBits2Float(0x435c0000), SkBits2Float(0x43660000)); 4462 path.lineTo(SkBits2Float(0x435c0000), SkBits2Float(0x43660000));
4225 path.lineTo(SkBits2Float(0x42700000), SkBits2Float(0x42f00000)); 4463 path.lineTo(SkBits2Float(0x42700000), SkBits2Float(0x42f00000));
4226 path.lineTo(SkBits2Float(0x64969569), SkBits2Float(0x42f00000)); 4464 path.lineTo(SkBits2Float(0x64969569), SkBits2Float(0x42f00000));
4227 path.lineTo(SkBits2Float(0x64969569), SkBits2Float(0x43660000)); 4465 path.lineTo(SkBits2Float(0x64969569), SkBits2Float(0x43660000));
4228 path.lineTo(SkBits2Float(0x43200000), SkBits2Float(0x42700000)); 4466 path.lineTo(SkBits2Float(0x43200000), SkBits2Float(0x42700000));
4229 path.close(); 4467 path.close();
4230 4468
4231 SkPath path2(path); 4469 SkPath path2(path);
4232 testPathFailOp(reporter, path1, path2, (SkPathOp) 2, filename); 4470 testPathOpFailCheck(reporter, path1, path2, (SkPathOp) 2, filename);
4233 } 4471 }
4234 4472
4235 static void fuzz1(skiatest::Reporter* reporter, const char* filename) { 4473 static void fuzz1(skiatest::Reporter* reporter, const char* filename) {
4236 SkPath path; 4474 SkPath path;
4237 path.setFillType((SkPath::FillType) 0); 4475 path.setFillType((SkPath::FillType) 0);
4238 path.moveTo(SkBits2Float(0x7f800000), SkBits2Float(0x7f800000)); 4476 path.moveTo(SkBits2Float(0x7f800000), SkBits2Float(0x7f800000));
4239 path.quadTo(SkBits2Float(0x7f800000), SkBits2Float(0x7f800000), SkBits2Float(0x7 f800000), SkBits2Float(0x7f800000)); 4477 path.quadTo(SkBits2Float(0x7f800000), SkBits2Float(0x7f800000), SkBits2Float(0x7 f800000), SkBits2Float(0x7f800000));
4240 path.quadTo(SkBits2Float(0x7f800000), SkBits2Float(0x7f800000), SkBits2Float(0x7 f800000), SkBits2Float(0x7f800000)); 4478 path.quadTo(SkBits2Float(0x7f800000), SkBits2Float(0x7f800000), SkBits2Float(0x7 f800000), SkBits2Float(0x7f800000));
4241 path.quadTo(SkBits2Float(0xffc00000), SkBits2Float(0x7f800000), SkBits2Float(0xf fc00000), SkBits2Float(0x7f800000)); 4479 path.quadTo(SkBits2Float(0xffc00000), SkBits2Float(0x7f800000), SkBits2Float(0xf fc00000), SkBits2Float(0x7f800000));
4242 path.quadTo(SkBits2Float(0xff000001), SkBits2Float(0x7f800000), SkBits2Float(0xf f000001), SkBits2Float(0x7f800000)); 4480 path.quadTo(SkBits2Float(0xff000001), SkBits2Float(0x7f800000), SkBits2Float(0xf f000001), SkBits2Float(0x7f800000));
(...skipping 22 matching lines...) Expand all
4265 }; 4503 };
4266 4504
4267 static const size_t failTestCount = SK_ARRAY_COUNT(failTests); 4505 static const size_t failTestCount = SK_ARRAY_COUNT(failTests);
4268 4506
4269 DEF_TEST(PathOpsFailOp, reporter) { 4507 DEF_TEST(PathOpsFailOp, reporter) {
4270 #if DEBUG_SHOW_TEST_NAME 4508 #if DEBUG_SHOW_TEST_NAME
4271 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH); 4509 strncpy(DEBUG_FILENAME_STRING, "", DEBUG_FILENAME_STRING_LENGTH);
4272 #endif 4510 #endif
4273 RunTestSet(reporter, failTests, failTestCount, NULL, NULL, NULL, false); 4511 RunTestSet(reporter, failTests, failTestCount, NULL, NULL, NULL, false);
4274 } 4512 }
OLDNEW
« no previous file with comments | « tests/PathOpsOpRectThreadedTest.cpp ('k') | tests/PathOpsQuadIntersectionTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698