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

Side by Side Diff: tests/PathTest.cpp

Issue 971773002: treat backwards quads as not convex (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: add fall through comments Created 5 years, 9 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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkPaint.h" 9 #include "SkPaint.h"
10 #include "SkParse.h" 10 #include "SkParse.h"
(...skipping 20 matching lines...) Expand all
31 SkRRect rrect; 31 SkRRect rrect;
32 rrect.setRectRadii(bounds, radii); 32 rrect.setRectRadii(bounds, radii);
33 REPORTER_ASSERT(reporter, bounds == rrect.rect()); 33 REPORTER_ASSERT(reporter, bounds == rrect.rect());
34 34
35 SkPath path; 35 SkPath path;
36 // this line should not assert in the debug build (from validate) 36 // this line should not assert in the debug build (from validate)
37 path.addRRect(rrect); 37 path.addRRect(rrect);
38 REPORTER_ASSERT(reporter, bounds == path.getBounds()); 38 REPORTER_ASSERT(reporter, bounds == path.getBounds());
39 } 39 }
40 40
41 static void test_skbug_3469(skiatest::Reporter* reporter) {
42 SkPath path;
43 path.moveTo(20, 20);
44 path.quadTo(20, 50, 80, 50);
45 path.quadTo(20, 50, 20, 80);
46 REPORTER_ASSERT(reporter, !path.isConvex());
47 }
48
41 static void test_skbug_3239(skiatest::Reporter* reporter) { 49 static void test_skbug_3239(skiatest::Reporter* reporter) {
42 const float min = SkBits2Float(0xcb7f16c8); /* -16717512.000000 */ 50 const float min = SkBits2Float(0xcb7f16c8); /* -16717512.000000 */
43 const float max = SkBits2Float(0x4b7f1c1d); /* 16718877.000000 */ 51 const float max = SkBits2Float(0x4b7f1c1d); /* 16718877.000000 */
44 const float big = SkBits2Float(0x4b7f1bd7); /* 16718807.000000 */ 52 const float big = SkBits2Float(0x4b7f1bd7); /* 16718807.000000 */
45 53
46 const float rad = 33436320; 54 const float rad = 33436320;
47 55
48 const SkRect rectx = SkRect::MakeLTRB(min, min, max, big); 56 const SkRect rectx = SkRect::MakeLTRB(min, min, max, big);
49 const SkRect recty = SkRect::MakeLTRB(min, min, big, max); 57 const SkRect recty = SkRect::MakeLTRB(min, min, big, max);
50 58
(...skipping 3674 matching lines...) Expand 10 before | Expand all | Expand 10 after
3725 test_extendClosedPath(reporter); 3733 test_extendClosedPath(reporter);
3726 test_addEmptyPath(reporter, SkPath::kExtend_AddPathMode); 3734 test_addEmptyPath(reporter, SkPath::kExtend_AddPathMode);
3727 test_addEmptyPath(reporter, SkPath::kAppend_AddPathMode); 3735 test_addEmptyPath(reporter, SkPath::kAppend_AddPathMode);
3728 test_conicTo_special_case(reporter); 3736 test_conicTo_special_case(reporter);
3729 test_get_point(reporter); 3737 test_get_point(reporter);
3730 test_contains(reporter); 3738 test_contains(reporter);
3731 PathTest_Private::TestPathTo(reporter); 3739 PathTest_Private::TestPathTo(reporter);
3732 PathRefTest_Private::TestPathRef(reporter); 3740 PathRefTest_Private::TestPathRef(reporter);
3733 test_dump(reporter); 3741 test_dump(reporter);
3734 test_path_crbugskia2820(reporter); 3742 test_path_crbugskia2820(reporter);
3743 test_skbug_3469(reporter);
3735 test_skbug_3239(reporter); 3744 test_skbug_3239(reporter);
3736 } 3745 }
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