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

Side by Side Diff: tests/PathTest.cpp

Issue 2361473004: Revert of fix for conic fuzz (Closed)
Patch Set: Created 4 years, 3 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/core/SkGeometry.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 2011 Google Inc. 2 * Copyright 2011 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 7
8 #include <cmath> 8 #include <cmath>
9 #include "SkCanvas.h" 9 #include "SkCanvas.h"
10 #include "SkGeometry.h" 10 #include "SkGeometry.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 SkBits2Float(0x721aee0c)); // 3.0687e+30f 150 SkBits2Float(0x721aee0c)); // 3.0687e+30f
151 canvas->drawPath(path, paint); 151 canvas->drawPath(path, paint);
152 path.reset(); 152 path.reset();
153 path.moveTo(0, 0); 153 path.moveTo(0, 0);
154 path.conicTo(SkBits2Float(0x00007ff2), SkBits2Float(0x4169ffff), // 4.58981 e-41f, 14.625f 154 path.conicTo(SkBits2Float(0x00007ff2), SkBits2Float(0x4169ffff), // 4.58981 e-41f, 14.625f
155 SkBits2Float(0x43ff2261), SkBits2Float(0x41eeea04), // 510.269f, 29.864 3f 155 SkBits2Float(0x43ff2261), SkBits2Float(0x41eeea04), // 510.269f, 29.864 3f
156 SkBits2Float(0x5d06eff8)); // 6.07704e+17f 156 SkBits2Float(0x5d06eff8)); // 6.07704e+17f
157 canvas->drawPath(path, paint); 157 canvas->drawPath(path, paint);
158 } 158 }
159 159
160 static void test_fuzz_crbug_647922() {
161 auto surface(SkSurface::MakeRasterN32Premul(250, 250));
162 SkCanvas* canvas = surface->getCanvas();
163 SkPaint paint;
164 paint.setAntiAlias(true);
165 SkPath path;
166 path.moveTo(0, 0);
167 path.conicTo(SkBits2Float(0x00003939), SkBits2Float(0x42487fff), // 2.05276 e-41f, 50.125f
168 SkBits2Float(0x48082361), SkBits2Float(0x4408e8e9), // 139406, 547. 639f
169 SkBits2Float(0x4d1ade0f)); // 1.6239e+08f
170 canvas->drawPath(path, paint);
171 }
172
173 /** 160 /**
174 * In debug mode, this path was causing an assertion to fail in 161 * In debug mode, this path was causing an assertion to fail in
175 * SkPathStroker::preJoinTo() and, in Release, the use of an unitialized value. 162 * SkPathStroker::preJoinTo() and, in Release, the use of an unitialized value.
176 */ 163 */
177 static void make_path_crbugskia2820(SkPath* path, skiatest::Reporter* reporter) { 164 static void make_path_crbugskia2820(SkPath* path, skiatest::Reporter* reporter) {
178 SkPoint orig, p1, p2, p3; 165 SkPoint orig, p1, p2, p3;
179 orig = SkPoint::Make(1.f, 1.f); 166 orig = SkPoint::Make(1.f, 1.f);
180 p1 = SkPoint::Make(1.f - SK_ScalarNearlyZero, 1.f); 167 p1 = SkPoint::Make(1.f - SK_ScalarNearlyZero, 1.f);
181 p2 = SkPoint::Make(1.f, 1.f + SK_ScalarNearlyZero); 168 p2 = SkPoint::Make(1.f, 1.f + SK_ScalarNearlyZero);
182 p3 = SkPoint::Make(2.f, 2.f); 169 p3 = SkPoint::Make(2.f, 2.f);
(...skipping 4098 matching lines...) Expand 10 before | Expand all | Expand 10 after
4281 4268
4282 DEF_TEST(PathInterp, reporter) { 4269 DEF_TEST(PathInterp, reporter) {
4283 test_interp(reporter); 4270 test_interp(reporter);
4284 } 4271 }
4285 4272
4286 DEF_TEST(PathContains, reporter) { 4273 DEF_TEST(PathContains, reporter) {
4287 test_contains(reporter); 4274 test_contains(reporter);
4288 } 4275 }
4289 4276
4290 DEF_TEST(Paths, reporter) { 4277 DEF_TEST(Paths, reporter) {
4291 test_fuzz_crbug_647922();
4292 test_fuzz_crbug_643933(); 4278 test_fuzz_crbug_643933();
4293 test_sect_with_horizontal_needs_pinning(); 4279 test_sect_with_horizontal_needs_pinning();
4294 test_crbug_629455(reporter); 4280 test_crbug_629455(reporter);
4295 test_fuzz_crbug_627414(reporter); 4281 test_fuzz_crbug_627414(reporter);
4296 test_path_crbug364224(); 4282 test_path_crbug364224();
4297 4283
4298 SkTSize<SkScalar>::Make(3,4); 4284 SkTSize<SkScalar>::Make(3,4);
4299 4285
4300 SkPath p, empty; 4286 SkPath p, empty;
4301 SkRect bounds, bounds2; 4287 SkRect bounds, bounds2;
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
4442 PathRefTest_Private::TestPathRef(reporter); 4428 PathRefTest_Private::TestPathRef(reporter);
4443 PathTest_Private::TestPathrefListeners(reporter); 4429 PathTest_Private::TestPathrefListeners(reporter);
4444 test_dump(reporter); 4430 test_dump(reporter);
4445 test_path_crbug389050(reporter); 4431 test_path_crbug389050(reporter);
4446 test_path_crbugskia2820(reporter); 4432 test_path_crbugskia2820(reporter);
4447 test_skbug_3469(reporter); 4433 test_skbug_3469(reporter);
4448 test_skbug_3239(reporter); 4434 test_skbug_3239(reporter);
4449 test_bounds_crbug_513799(reporter); 4435 test_bounds_crbug_513799(reporter);
4450 test_fuzz_crbug_638223(); 4436 test_fuzz_crbug_638223();
4451 } 4437 }
OLDNEW
« no previous file with comments | « src/core/SkGeometry.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698