21#include <initializer_list>
28 { 100000000000.0f, 100000000000.0f }, { 0, 0 }, { 10, 10 },
29 { 10, 10 }, { 0, 0 }, { 10, 10 }
33 for (
size_t i = 1; i < std::size(pts); i += 3) {
34 path.cubicTo(pts[i], pts[i + 1], pts[i + 2]);
50 constexpr float resScale = 1000;
60 { 100000000000.0f, 100000000000.0f }, { 0, 0 },
65 for (
size_t i = 1; i < std::size(pts); i += 2) {
66 path.quadTo(pts[i], pts[i + 1]);
83 for (
size_t i = 1; i < std::size(pts); ++i) {
234 meas = std::move(meas2);
238 SkPoint stdP, hiP, pts[] = {{0,0}, {100,0}, {100,0}};
241 p.conicTo(pts[1], pts[2], 1);
246 p.conicTo(pts[1], pts[2], 10);
256 path.moveTo(0, 0); path.lineTo(100, 0);
267 SkScalar distance = cm->length() / 4;
268 bool success = cm->getPosTan(distance, &
pos, &tan);
280 path.moveTo(0, 0).lineTo(100, 100).lineTo(200, 100);
281 path.moveTo(2, 2).moveTo(3, 3);
282 path.moveTo(4, 4).close().close().close();
283 path.moveTo(5, 5).lineTo(5, 5);
284 path.moveTo(5, 5).lineTo(5, 5).close();
285 path.moveTo(5, 5).lineTo(5, 5).close().close();
286 path.moveTo(6, 6).lineTo(7, 7);
303 path.moveTo(10, 10).lineTo(20, 20).moveTo(30, 30);
305 for (
bool forceClosed : {
false,
true}) {
314 path.addRect({1, 2, 3, 4});
315 path.incReserve(100);
332 path.addCircle(0, 0, 100);
333 path.addCircle(0, 0, 10);
338 auto cm0 = fact.
next();
339 auto cm1 = fact.
next();
351 auto cm2 = fact.
next();
static void test_empty_contours(skiatest::Reporter *reporter)
static void test_small_segment3(skiatest::Reporter *reporter)
static void test_small_segment2()
static void test_shrink(skiatest::Reporter *reporter)
static void test_90_degrees(const sk_sp< SkContourMeasure > &cm, SkScalar radius, skiatest::Reporter *reporter)
static void test_small_segment()
static void test_MLM_contours(skiatest::Reporter *reporter)
static bool SkScalarNearlyEqual(SkScalar x, SkScalar y, SkScalar tolerance=SK_ScalarNearlyZero)
#define DEF_TEST(name, reporter)
#define REPORTER_ASSERT(r, cond,...)
sk_sp< SkContourMeasure > next()
static size_t CountSegments(const SkPathMeasure &)
void setPath(const SkPath *, bool forceClosed)
bool getPosTan(SkScalar distance, SkPoint *position, SkVector *tangent)
static void ShrinkToFit(SkPath *path)