本文整理汇总了C++中SkPath::rQuadTo方法的典型用法代码示例。如果您正苦于以下问题:C++ SkPath::rQuadTo方法的具体用法?C++ SkPath::rQuadTo怎么用?C++ SkPath::rQuadTo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkPath
的用法示例。
在下文中一共展示了SkPath::rQuadTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
void draw(SkCanvas* canvas) {
SkPaint paint;
paint.setAntiAlias(true);
SkPath path;
path.moveTo(128, 20);
path.rQuadTo(-6, 10, -7, 10);
for (int i = 1; i < 32; i += 4) {
path.rQuadTo(10 + i, 10 + i, 10 + i * 4, 10);
path.rQuadTo(-10 - i, 10 + i, -10 - (i + 2) * 4, 10);
}
path.quadTo(92, 220, 128, 215);
canvas->drawPath(path, paint);
}
示例2:
void
skiaDrawQuadraticCurve(caskbench_context_t *ctx, shapes_t *args)
{
path.reset();
path.moveTo(args->x, args->y);
path.rQuadTo(args->dx1, args->dy1,
args->width, args->height);
ctx->skia_canvas->drawPath(path, *(ctx->skia_paint));
}
示例3: makePath
//.........这里部分代码省略.........
--fPathDepth;
validate(path);
}
break;
case kReverseAddPath:
if (fPathDepth < fPathDepthLimit) {
++fPathDepth;
SkPath src = makePath();
validate(src);
path.reverseAddPath(src);
--fPathDepth;
validate(path);
}
break;
case kMoveToPath: {
SkScalar x = makeScalar();
SkScalar y = makeScalar();
path.moveTo(x, y);
validate(path);
} break;
case kRMoveToPath: {
SkScalar x = makeScalar();
SkScalar y = makeScalar();
path.rMoveTo(x, y);
validate(path);
} break;
case kLineToPath: {
SkScalar x = makeScalar();
SkScalar y = makeScalar();
path.lineTo(x, y);
validate(path);
} break;
case kRLineToPath: {
SkScalar x = makeScalar();
SkScalar y = makeScalar();
path.rLineTo(x, y);
validate(path);
} break;
case kQuadToPath: {
SkPoint pt[2];
makePointArray(SK_ARRAY_COUNT(pt), pt);
path.quadTo(pt[0], pt[1]);
validate(path);
} break;
case kRQuadToPath: {
SkPoint pt[2];
makePointArray(SK_ARRAY_COUNT(pt), pt);
path.rQuadTo(pt[0].fX, pt[0].fY, pt[1].fX, pt[1].fY);
validate(path);
} break;
case kConicToPath: {
SkPoint pt[2];
makePointArray(SK_ARRAY_COUNT(pt), pt);
SkScalar weight = makeScalar();
path.conicTo(pt[0], pt[1], weight);
validate(path);
} break;
case kRConicToPath: {
SkPoint pt[2];
makePointArray(SK_ARRAY_COUNT(pt), pt);
SkScalar weight = makeScalar();
path.rConicTo(pt[0].fX, pt[0].fY, pt[1].fX, pt[1].fY, weight);
validate(path);
} break;
case kCubicToPath: {
SkPoint pt[3];
makePointArray(SK_ARRAY_COUNT(pt), pt);
path.cubicTo(pt[0], pt[1], pt[2]);
validate(path);
} break;
case kRCubicToPath: {
SkPoint pt[3];
makePointArray(SK_ARRAY_COUNT(pt), pt);
path.rCubicTo(pt[0].fX, pt[0].fY, pt[1].fX, pt[1].fY, pt[2].fX, pt[2].fY);
validate(path);
} break;
case kArcToPath: {
SkPoint pt[2];
makePointArray(SK_ARRAY_COUNT(pt), pt);
SkScalar radius = makeScalar();
path.arcTo(pt[0], pt[1], radius);
validate(path);
} break;
case kArcTo2Path: {
SkRect oval = makeRect();
SkScalar startAngle = makeAngle();
SkScalar sweepAngle = makeAngle();
bool forceMoveTo = makeBool();
path.arcTo(oval, startAngle, sweepAngle, forceMoveTo);
validate(path);
} break;
case kClosePath:
path.close();
validate(path);
break;
}
}
}
return path;
}