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

Side by Side Diff: tests/PathTest.cpp

Issue 1580463002: Cherry pick to M48: give up on quad root if infinite (Closed) Base URL: https://skia.googlesource.com/skia.git@m48
Patch Set: Created 4 years, 11 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 "SkCanvas.h" 8 #include "SkCanvas.h"
9 #include "SkPaint.h" 9 #include "SkPaint.h"
10 #include "SkParse.h" 10 #include "SkParse.h"
(...skipping 3489 matching lines...) Expand 10 before | Expand all | Expand 10 after
3500 p.setLastPt(10, 10); 3500 p.setLastPt(10, 10);
3501 pt = p.getPoint(0); 3501 pt = p.getPoint(0);
3502 REPORTER_ASSERT(reporter, pt == SkPoint::Make(10, 10)); 3502 REPORTER_ASSERT(reporter, pt == SkPoint::Make(10, 10));
3503 REPORTER_ASSERT(reporter, p.getLastPt(nullptr)); 3503 REPORTER_ASSERT(reporter, p.getLastPt(nullptr));
3504 p.rMoveTo(10, 10); 3504 p.rMoveTo(10, 10);
3505 REPORTER_ASSERT(reporter, p.getLastPt(&pt) && pt == SkPoint::Make(20, 20)); 3505 REPORTER_ASSERT(reporter, p.getLastPt(&pt) && pt == SkPoint::Make(20, 20));
3506 } 3506 }
3507 3507
3508 static void test_contains(skiatest::Reporter* reporter) { 3508 static void test_contains(skiatest::Reporter* reporter) {
3509 SkPath p; 3509 SkPath p;
3510 p.moveTo(SkBits2Float(0xe085e7b1), SkBits2Float(0x5f512c00)); // -7.7191e+1 9f, 1.50724e+19f
3511 p.conicTo(SkBits2Float(0xdfdaa221), SkBits2Float(0x5eaac338), SkBits2Float(0 x60342f13), SkBits2Float(0xdf0cbb58), SkBits2Float(0x3f3504f3)); // -3.15084e+1 9f, 6.15237e+18f, 5.19345e+19f, -1.01408e+19f, 0.707107f
3512 p.conicTo(SkBits2Float(0x60ead799), SkBits2Float(0xdfb76c24), SkBits2Float(0 x609b9872), SkBits2Float(0xdf730de8), SkBits2Float(0x3f3504f4)); // 1.35377e+20 f, -2.6434e+19f, 8.96947e+19f, -1.75139e+19f, 0.707107f
3513 p.lineTo(SkBits2Float(0x609b9872), SkBits2Float(0xdf730de8)); // 8.96947e+1 9f, -1.75139e+19f
3514 p.conicTo(SkBits2Float(0x6018b296), SkBits2Float(0xdeee870d), SkBits2Float(0 xe008cd8e), SkBits2Float(0x5ed5b2db), SkBits2Float(0x3f3504f3)); // 4.40121e+19 f, -8.59386e+18f, -3.94308e+19f, 7.69931e+18f, 0.707107f
3515 p.conicTo(SkBits2Float(0xe0d526d9), SkBits2Float(0x5fa67b31), SkBits2Float(0 xe085e7b2), SkBits2Float(0x5f512c01), SkBits2Float(0x3f3504f3)); // -1.22874e+2 0f, 2.39925e+19f, -7.7191e+19f, 1.50724e+19f, 0.707107f
3516 REPORTER_ASSERT(reporter, !p.contains(-77.2027664f, 15.3066053f));
3517
3518 p.reset();
3510 p.setFillType(SkPath::kInverseWinding_FillType); 3519 p.setFillType(SkPath::kInverseWinding_FillType);
3511 REPORTER_ASSERT(reporter, p.contains(0, 0)); 3520 REPORTER_ASSERT(reporter, p.contains(0, 0));
3512 p.setFillType(SkPath::kWinding_FillType); 3521 p.setFillType(SkPath::kWinding_FillType);
3513 REPORTER_ASSERT(reporter, !p.contains(0, 0)); 3522 REPORTER_ASSERT(reporter, !p.contains(0, 0));
3514 p.moveTo(4, 4); 3523 p.moveTo(4, 4);
3515 p.lineTo(6, 8); 3524 p.lineTo(6, 8);
3516 p.lineTo(8, 4); 3525 p.lineTo(8, 4);
3517 // test quick reject 3526 // test quick reject
3518 REPORTER_ASSERT(reporter, !p.contains(4, 0)); 3527 REPORTER_ASSERT(reporter, !p.contains(4, 0));
3519 REPORTER_ASSERT(reporter, !p.contains(0, 4)); 3528 REPORTER_ASSERT(reporter, !p.contains(0, 4));
(...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after
3941 PathTest_Private::TestPathTo(reporter); 3950 PathTest_Private::TestPathTo(reporter);
3942 PathRefTest_Private::TestPathRef(reporter); 3951 PathRefTest_Private::TestPathRef(reporter);
3943 PathTest_Private::TestPathrefListeners(reporter); 3952 PathTest_Private::TestPathrefListeners(reporter);
3944 test_dump(reporter); 3953 test_dump(reporter);
3945 test_path_crbug389050(reporter); 3954 test_path_crbug389050(reporter);
3946 test_path_crbugskia2820(reporter); 3955 test_path_crbugskia2820(reporter);
3947 test_skbug_3469(reporter); 3956 test_skbug_3469(reporter);
3948 test_skbug_3239(reporter); 3957 test_skbug_3239(reporter);
3949 test_bounds_crbug_513799(reporter); 3958 test_bounds_crbug_513799(reporter);
3950 } 3959 }
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