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

Side by Side Diff: tests/PathTest.cpp

Issue 727283003: Fix yet another convexicator issue (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 6 years, 1 month 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
« src/core/SkPath.cpp ('K') | « 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 1188 matching lines...) Expand 10 before | Expand all | Expand 10 after
1199 // http://crbug.com/412640 1199 // http://crbug.com/412640
1200 SkPath degenerateConcave; 1200 SkPath degenerateConcave;
1201 degenerateConcave.moveTo(148.67912f, 191.875f); 1201 degenerateConcave.moveTo(148.67912f, 191.875f);
1202 degenerateConcave.lineTo(470.37695f, 7.5f); 1202 degenerateConcave.lineTo(470.37695f, 7.5f);
1203 degenerateConcave.lineTo(148.67912f, 191.875f); 1203 degenerateConcave.lineTo(148.67912f, 191.875f);
1204 degenerateConcave.lineTo(41.446522f, 376.25f); 1204 degenerateConcave.lineTo(41.446522f, 376.25f);
1205 degenerateConcave.lineTo(-55.971577f, 460.0f); 1205 degenerateConcave.lineTo(-55.971577f, 460.0f);
1206 degenerateConcave.lineTo(41.446522f, 376.25f); 1206 degenerateConcave.lineTo(41.446522f, 376.25f);
1207 check_convexity(reporter, degenerateConcave, SkPath::kConcave_Convexity); 1207 check_convexity(reporter, degenerateConcave, SkPath::kConcave_Convexity);
1208 check_direction(reporter, degenerateConcave, SkPath::kUnknown_Direction); 1208 check_direction(reporter, degenerateConcave, SkPath::kUnknown_Direction);
1209
1210 // http://crbug.com/433683
1211 SkPath badFirstVector;
1212 badFirstVector.moveTo(501.087708f, 319.610352f);
1213 badFirstVector.lineTo(501.087708f, 319.610352f);
1214 badFirstVector.cubicTo(501.087677f, 319.610321f, 449.271606f, 258.078674f, 3 95.084564f, 198.711182f);
1215 badFirstVector.cubicTo(358.967072f, 159.140717f, 321.910553f, 120.650436f, 2 98.442322f, 101.955399f);
1216 badFirstVector.lineTo(301.557678f, 98.044601f);
1217 badFirstVector.cubicTo(325.283844f, 116.945084f, 362.615204f, 155.720825f, 3 98.777557f, 195.340454f);
1218 badFirstVector.cubicTo(453.031860f, 254.781662f, 504.912262f, 316.389618f, 5 04.912292f, 316.389648f);
1219 badFirstVector.lineTo(504.912292f, 316.389648f);
1220 badFirstVector.lineTo(501.087708f, 319.610352f);
1221 badFirstVector.close();
1222 check_convexity(reporter, badFirstVector, SkPath::kConcave_Convexity);
1209 } 1223 }
1210 1224
1211 static void check_convex_bounds(skiatest::Reporter* reporter, const SkPath& p, 1225 static void check_convex_bounds(skiatest::Reporter* reporter, const SkPath& p,
1212 const SkRect& bounds) { 1226 const SkRect& bounds) {
1213 REPORTER_ASSERT(reporter, p.isConvex()); 1227 REPORTER_ASSERT(reporter, p.isConvex());
1214 REPORTER_ASSERT(reporter, p.getBounds() == bounds); 1228 REPORTER_ASSERT(reporter, p.getBounds() == bounds);
1215 1229
1216 SkPath p2(p); 1230 SkPath p2(p);
1217 REPORTER_ASSERT(reporter, p2.isConvex()); 1231 REPORTER_ASSERT(reporter, p2.isConvex());
1218 REPORTER_ASSERT(reporter, p2.getBounds() == bounds); 1232 REPORTER_ASSERT(reporter, p2.getBounds() == bounds);
(...skipping 2408 matching lines...) Expand 10 before | Expand all | Expand 10 after
3627 test_addEmptyPath(reporter, SkPath::kExtend_AddPathMode); 3641 test_addEmptyPath(reporter, SkPath::kExtend_AddPathMode);
3628 test_addEmptyPath(reporter, SkPath::kAppend_AddPathMode); 3642 test_addEmptyPath(reporter, SkPath::kAppend_AddPathMode);
3629 test_conicTo_special_case(reporter); 3643 test_conicTo_special_case(reporter);
3630 test_get_point(reporter); 3644 test_get_point(reporter);
3631 test_contains(reporter); 3645 test_contains(reporter);
3632 PathTest_Private::TestPathTo(reporter); 3646 PathTest_Private::TestPathTo(reporter);
3633 PathRefTest_Private::TestPathRef(reporter); 3647 PathRefTest_Private::TestPathRef(reporter);
3634 test_dump(reporter); 3648 test_dump(reporter);
3635 test_path_crbugskia2820(reporter); 3649 test_path_crbugskia2820(reporter);
3636 } 3650 }
OLDNEW
« src/core/SkPath.cpp ('K') | « src/core/SkPath.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698