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

Side by Side Diff: tests/PathTest.cpp

Issue 2284303004: merge per request (Closed) Base URL: https://skia.googlesource.com/skia@m53
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 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 auto surface(SkSurface::MakeRasterN32Premul(84, 88)); 103 auto surface(SkSurface::MakeRasterN32Premul(84, 88));
104 SkCanvas* canvas = surface->getCanvas(); 104 SkCanvas* canvas = surface->getCanvas();
105 105
106 make_path_crbug364224_simplified(&path); 106 make_path_crbug364224_simplified(&path);
107 canvas->drawPath(path, paint); 107 canvas->drawPath(path, paint);
108 108
109 make_path_crbug364224(&path); 109 make_path_crbug364224(&path);
110 canvas->drawPath(path, paint); 110 canvas->drawPath(path, paint);
111 } 111 }
112 112
113 // this is a unit test instead of a GM because it doesn't draw anything
114 static void test_fuzz_crbug_638223() {
115 auto surface(SkSurface::MakeRasterN32Premul(250, 250));
116 SkCanvas* canvas = surface->getCanvas();
117 SkPath path;
118 path.moveTo(SkBits2Float(0x47452a00), SkBits2Float(0x43211d01)); // 50474, 161.113f
119 path.conicTo(SkBits2Float(0x401c0000), SkBits2Float(0x40680000),
120 SkBits2Float(0x02c25a81), SkBits2Float(0x981a1fa0),
121 SkBits2Float(0x6bf9abea)); // 2.4375f, 3.625f, 2.85577e-37f, -1.992e-24 f, 6.03669e+26f
122 SkPaint paint;
123 paint.setAntiAlias(true);
124 canvas->drawPath(path, paint);
125 }
126
113 /** 127 /**
114 * In debug mode, this path was causing an assertion to fail in 128 * In debug mode, this path was causing an assertion to fail in
115 * SkPathStroker::preJoinTo() and, in Release, the use of an unitialized value. 129 * SkPathStroker::preJoinTo() and, in Release, the use of an unitialized value.
116 */ 130 */
117 static void make_path_crbugskia2820(SkPath* path, skiatest::Reporter* reporter) { 131 static void make_path_crbugskia2820(SkPath* path, skiatest::Reporter* reporter) {
118 SkPoint orig, p1, p2, p3; 132 SkPoint orig, p1, p2, p3;
119 orig = SkPoint::Make(1.f, 1.f); 133 orig = SkPoint::Make(1.f, 1.f);
120 p1 = SkPoint::Make(1.f - SK_ScalarNearlyZero, 1.f); 134 p1 = SkPoint::Make(1.f - SK_ScalarNearlyZero, 1.f);
121 p2 = SkPoint::Make(1.f, 1.f + SK_ScalarNearlyZero); 135 p2 = SkPoint::Make(1.f, 1.f + SK_ScalarNearlyZero);
122 p3 = SkPoint::Make(2.f, 2.f); 136 p3 = SkPoint::Make(2.f, 2.f);
(...skipping 4218 matching lines...) Expand 10 before | Expand all | Expand 10 after
4341 test_contains(reporter); 4355 test_contains(reporter);
4342 PathTest_Private::TestPathTo(reporter); 4356 PathTest_Private::TestPathTo(reporter);
4343 PathRefTest_Private::TestPathRef(reporter); 4357 PathRefTest_Private::TestPathRef(reporter);
4344 PathTest_Private::TestPathrefListeners(reporter); 4358 PathTest_Private::TestPathrefListeners(reporter);
4345 test_dump(reporter); 4359 test_dump(reporter);
4346 test_path_crbug389050(reporter); 4360 test_path_crbug389050(reporter);
4347 test_path_crbugskia2820(reporter); 4361 test_path_crbugskia2820(reporter);
4348 test_skbug_3469(reporter); 4362 test_skbug_3469(reporter);
4349 test_skbug_3239(reporter); 4363 test_skbug_3239(reporter);
4350 test_bounds_crbug_513799(reporter); 4364 test_bounds_crbug_513799(reporter);
4365 test_fuzz_crbug_638223();
4351 } 4366 }
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