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

Side by Side Diff: tests/PathTest.cpp

Issue 2268073004: fix conic path fuzz (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add warn unused output 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 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 auto surface(SkSurface::MakeRasterN32Premul(84, 88)); 117 auto surface(SkSurface::MakeRasterN32Premul(84, 88));
118 SkCanvas* canvas = surface->getCanvas(); 118 SkCanvas* canvas = surface->getCanvas();
119 119
120 make_path_crbug364224_simplified(&path); 120 make_path_crbug364224_simplified(&path);
121 canvas->drawPath(path, paint); 121 canvas->drawPath(path, paint);
122 122
123 make_path_crbug364224(&path); 123 make_path_crbug364224(&path);
124 canvas->drawPath(path, paint); 124 canvas->drawPath(path, paint);
125 } 125 }
126 126
127 // this is a unit test instead of a GM because it doesn't draw anything
128 static void test_fuzz_crbug_638223() {
129 auto surface(SkSurface::MakeRasterN32Premul(250, 250));
130 SkCanvas* canvas = surface->getCanvas();
131 SkPath path;
132 path.moveTo(SkBits2Float(0x47452a00), SkBits2Float(0x43211d01)); // 50474, 161.113f
133 path.conicTo(SkBits2Float(0x401c0000), SkBits2Float(0x40680000),
134 SkBits2Float(0x02c25a81), SkBits2Float(0x981a1fa0),
135 SkBits2Float(0x6bf9abea)); // 2.4375f, 3.625f, 2.85577e-37f, -1.992e-24 f, 6.03669e+26f
136 SkPaint paint;
137 paint.setAntiAlias(true);
138 canvas->drawPath(path, paint);
139 }
140
127 /** 141 /**
128 * In debug mode, this path was causing an assertion to fail in 142 * In debug mode, this path was causing an assertion to fail in
129 * SkPathStroker::preJoinTo() and, in Release, the use of an unitialized value. 143 * SkPathStroker::preJoinTo() and, in Release, the use of an unitialized value.
130 */ 144 */
131 static void make_path_crbugskia2820(SkPath* path, skiatest::Reporter* reporter) { 145 static void make_path_crbugskia2820(SkPath* path, skiatest::Reporter* reporter) {
132 SkPoint orig, p1, p2, p3; 146 SkPoint orig, p1, p2, p3;
133 orig = SkPoint::Make(1.f, 1.f); 147 orig = SkPoint::Make(1.f, 1.f);
134 p1 = SkPoint::Make(1.f - SK_ScalarNearlyZero, 1.f); 148 p1 = SkPoint::Make(1.f - SK_ScalarNearlyZero, 1.f);
135 p2 = SkPoint::Make(1.f, 1.f + SK_ScalarNearlyZero); 149 p2 = SkPoint::Make(1.f, 1.f + SK_ScalarNearlyZero);
136 p3 = SkPoint::Make(2.f, 2.f); 150 p3 = SkPoint::Make(2.f, 2.f);
(...skipping 4255 matching lines...) Expand 10 before | Expand all | Expand 10 after
4392 test_contains(reporter); 4406 test_contains(reporter);
4393 PathTest_Private::TestPathTo(reporter); 4407 PathTest_Private::TestPathTo(reporter);
4394 PathRefTest_Private::TestPathRef(reporter); 4408 PathRefTest_Private::TestPathRef(reporter);
4395 PathTest_Private::TestPathrefListeners(reporter); 4409 PathTest_Private::TestPathrefListeners(reporter);
4396 test_dump(reporter); 4410 test_dump(reporter);
4397 test_path_crbug389050(reporter); 4411 test_path_crbug389050(reporter);
4398 test_path_crbugskia2820(reporter); 4412 test_path_crbugskia2820(reporter);
4399 test_skbug_3469(reporter); 4413 test_skbug_3469(reporter);
4400 test_skbug_3239(reporter); 4414 test_skbug_3239(reporter);
4401 test_bounds_crbug_513799(reporter); 4415 test_bounds_crbug_513799(reporter);
4416 test_fuzz_crbug_638223();
4402 } 4417 }
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