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

Side by Side Diff: tests/PathTest.cpp

Issue 2021343004: Add a test for crbug 613918 and fix a style issue. (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: Minimize test and add a comment Created 4 years, 6 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/SkPath.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 466 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 "L-0.340154098751264,-0.11341791238732665L-0.340162664924548,-0.11343788 99559977" 477 "L-0.340154098751264,-0.11341791238732665L-0.340162664924548,-0.11343788 99559977"
478 "L-0.34017979727111597,-0.11340126558629839L-0.3401655203156427,-0.11338 129083212668" 478 "L-0.34017979727111597,-0.11340126558629839L-0.3401655203156427,-0.11338 129083212668"
479 "L-0.34012268944922275,-0.11332137577529414L-0.34007414780061346,-0.1133 4467443478255Z" 479 "L-0.34012268944922275,-0.11332137577529414L-0.34007414780061346,-0.1133 4467443478255Z"
480 "M-0.3400027630232468,-0.11290567901106024L-0.3400113291965308,-0.112988 76531245433" 480 "M-0.3400027630232468,-0.11290567901106024L-0.3400113291965308,-0.112988 76531245433"
481 "L-0.33997991989448945,-0.11301535852306784L-0.33990282433493346,-0.1129 6217481488612" 481 "L-0.33997991989448945,-0.11301535852306784L-0.33990282433493346,-0.1129 6217481488612"
482 "L-0.33993994441916414,-0.11288906492739594Z"; 482 "L-0.33993994441916414,-0.11288906492739594Z";
483 test_tiny_path_convexity(reporter, originalFiddleData, 22682.240000000005f,7 819.72220766405f, 483 test_tiny_path_convexity(reporter, originalFiddleData, 22682.240000000005f,7 819.72220766405f,
484 65536); 484 65536);
485 } 485 }
486 486
487 static void test_crbug_613918() {
488 SkPath path;
489 path.conicTo(-6.62478e-08f, 4.13885e-08f, -6.36935e-08f, 3.97927e-08f, 0.729 058f);
490 path.quadTo(2.28206e-09f, -1.42572e-09f, 3.91919e-09f, -2.44852e-09f);
491 path.cubicTo(-16752.2f, -26792.9f, -21.4673f, 10.9347f, -8.57322f, -7.22739f );
492
493 // This call could lead to an assert or uninitialized read due to a failure
494 // to check the return value from SkCubicClipper::ChopMonoAtY.
495 path.contains(-1.84817e-08f, 1.15465e-08f);
496 }
497
487 static void test_addrect(skiatest::Reporter* reporter) { 498 static void test_addrect(skiatest::Reporter* reporter) {
488 SkPath path; 499 SkPath path;
489 path.lineTo(0, 0); 500 path.lineTo(0, 0);
490 path.addRect(SkRect::MakeWH(50, 100)); 501 path.addRect(SkRect::MakeWH(50, 100));
491 REPORTER_ASSERT(reporter, path.isRect(nullptr)); 502 REPORTER_ASSERT(reporter, path.isRect(nullptr));
492 503
493 path.reset(); 504 path.reset();
494 path.lineTo(FLT_EPSILON, FLT_EPSILON); 505 path.lineTo(FLT_EPSILON, FLT_EPSILON);
495 path.addRect(SkRect::MakeWH(50, 100)); 506 path.addRect(SkRect::MakeWH(50, 100));
496 REPORTER_ASSERT(reporter, !path.isRect(nullptr)); 507 REPORTER_ASSERT(reporter, !path.isRect(nullptr));
(...skipping 3675 matching lines...) Expand 10 before | Expand all | Expand 10 after
4172 test_islastcontourclosed(reporter); 4183 test_islastcontourclosed(reporter);
4173 test_arb_round_rect_is_convex(reporter); 4184 test_arb_round_rect_is_convex(reporter);
4174 test_arb_zero_rad_round_rect_is_rect(reporter); 4185 test_arb_zero_rad_round_rect_is_rect(reporter);
4175 test_addrect(reporter); 4186 test_addrect(reporter);
4176 test_addrect_isfinite(reporter); 4187 test_addrect_isfinite(reporter);
4177 test_tricky_cubic(); 4188 test_tricky_cubic();
4178 test_clipped_cubic(); 4189 test_clipped_cubic();
4179 test_crbug_170666(); 4190 test_crbug_170666();
4180 test_crbug_493450(reporter); 4191 test_crbug_493450(reporter);
4181 test_crbug_495894(reporter); 4192 test_crbug_495894(reporter);
4193 test_crbug_613918();
4182 test_bad_cubic_crbug229478(); 4194 test_bad_cubic_crbug229478();
4183 test_bad_cubic_crbug234190(); 4195 test_bad_cubic_crbug234190();
4184 test_gen_id(reporter); 4196 test_gen_id(reporter);
4185 test_path_close_issue1474(reporter); 4197 test_path_close_issue1474(reporter);
4186 test_path_to_region(reporter); 4198 test_path_to_region(reporter);
4187 test_rrect(reporter); 4199 test_rrect(reporter);
4188 test_arc(reporter); 4200 test_arc(reporter);
4189 test_arc_ovals(reporter); 4201 test_arc_ovals(reporter);
4190 test_arcTo(reporter); 4202 test_arcTo(reporter);
4191 test_addPath(reporter); 4203 test_addPath(reporter);
(...skipping 10 matching lines...) Expand all
4202 PathTest_Private::TestPathTo(reporter); 4214 PathTest_Private::TestPathTo(reporter);
4203 PathRefTest_Private::TestPathRef(reporter); 4215 PathRefTest_Private::TestPathRef(reporter);
4204 PathTest_Private::TestPathrefListeners(reporter); 4216 PathTest_Private::TestPathrefListeners(reporter);
4205 test_dump(reporter); 4217 test_dump(reporter);
4206 test_path_crbug389050(reporter); 4218 test_path_crbug389050(reporter);
4207 test_path_crbugskia2820(reporter); 4219 test_path_crbugskia2820(reporter);
4208 test_skbug_3469(reporter); 4220 test_skbug_3469(reporter);
4209 test_skbug_3239(reporter); 4221 test_skbug_3239(reporter);
4210 test_bounds_crbug_513799(reporter); 4222 test_bounds_crbug_513799(reporter);
4211 } 4223 }
OLDNEW
« no previous file with comments | « src/core/SkPath.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698