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

Side by Side Diff: tests/PathTest.cpp

Issue 913743002: check for nonfinites in rrects (Closed) Base URL: https://chromium.googlesource.com/skia.git@master
Patch Set: update test for nonfinites Created 5 years, 10 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/SkRRect.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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkPaint.h" 9 #include "SkPaint.h"
10 #include "SkParse.h" 10 #include "SkParse.h"
(...skipping 3095 matching lines...) Expand 10 before | Expand all | Expand 10 after
3106 REPORTER_ASSERT(reporter, !p.isConvex()); 3106 REPORTER_ASSERT(reporter, !p.isConvex());
3107 p.reset(); 3107 p.reset();
3108 SkRect emptyR = {10, 20, 10, 30}; 3108 SkRect emptyR = {10, 20, 10, 30};
3109 rr.setRectRadii(emptyR, radii); 3109 rr.setRectRadii(emptyR, radii);
3110 p.addRRect(rr); 3110 p.addRRect(rr);
3111 REPORTER_ASSERT(reporter, p.isEmpty()); 3111 REPORTER_ASSERT(reporter, p.isEmpty());
3112 SkRect largeR = {0, 0, SK_ScalarMax, SK_ScalarMax}; 3112 SkRect largeR = {0, 0, SK_ScalarMax, SK_ScalarMax};
3113 rr.setRectRadii(largeR, radii); 3113 rr.setRectRadii(largeR, radii);
3114 p.addRRect(rr); 3114 p.addRRect(rr);
3115 test_rrect_convexity_is_unknown(reporter, &p, SkPath::kCW_Direction); 3115 test_rrect_convexity_is_unknown(reporter, &p, SkPath::kCW_Direction);
3116
3117 // we check for non-finites
3116 SkRect infR = {0, 0, SK_ScalarMax, SK_ScalarInfinity}; 3118 SkRect infR = {0, 0, SK_ScalarMax, SK_ScalarInfinity};
3117 rr.setRectRadii(infR, radii); 3119 rr.setRectRadii(infR, radii);
3118 p.addRRect(rr); 3120 REPORTER_ASSERT(reporter, rr.isEmpty());
3119 test_rrect_convexity_is_unknown(reporter, &p, SkPath::kCW_Direction); 3121
3120 SkRect tinyR = {0, 0, 1e-9f, 1e-9f}; 3122 SkRect tinyR = {0, 0, 1e-9f, 1e-9f};
3121 p.addRoundRect(tinyR, 5e-11f, 5e-11f); 3123 p.addRoundRect(tinyR, 5e-11f, 5e-11f);
3122 test_rrect_is_convex(reporter, &p, SkPath::kCW_Direction); 3124 test_rrect_is_convex(reporter, &p, SkPath::kCW_Direction);
3123 } 3125 }
3124 3126
3125 static void test_arc(skiatest::Reporter* reporter) { 3127 static void test_arc(skiatest::Reporter* reporter) {
3126 SkPath p; 3128 SkPath p;
3127 SkRect emptyOval = {10, 20, 30, 20}; 3129 SkRect emptyOval = {10, 20, 30, 20};
3128 REPORTER_ASSERT(reporter, emptyOval.isEmpty()); 3130 REPORTER_ASSERT(reporter, emptyOval.isEmpty());
3129 p.addArc(emptyOval, 1, 2); 3131 p.addArc(emptyOval, 1, 2);
(...skipping 633 matching lines...) Expand 10 before | Expand all | Expand 10 after
3763 test_addEmptyPath(reporter, SkPath::kAppend_AddPathMode); 3765 test_addEmptyPath(reporter, SkPath::kAppend_AddPathMode);
3764 test_conicTo_special_case(reporter); 3766 test_conicTo_special_case(reporter);
3765 test_get_point(reporter); 3767 test_get_point(reporter);
3766 test_contains(reporter); 3768 test_contains(reporter);
3767 PathTest_Private::TestPathTo(reporter); 3769 PathTest_Private::TestPathTo(reporter);
3768 PathRefTest_Private::TestPathRef(reporter); 3770 PathRefTest_Private::TestPathRef(reporter);
3769 test_dump(reporter); 3771 test_dump(reporter);
3770 test_path_crbugskia2820(reporter); 3772 test_path_crbugskia2820(reporter);
3771 test_skbug_3239(reporter); 3773 test_skbug_3239(reporter);
3772 } 3774 }
OLDNEW
« no previous file with comments | « src/core/SkRRect.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698