本文整理汇总了C++中SkPath::getPoint方法的典型用法代码示例。如果您正苦于以下问题:C++ SkPath::getPoint方法的具体用法?C++ SkPath::getPoint怎么用?C++ SkPath::getPoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkPath
的用法示例。
在下文中一共展示了SkPath::getPoint方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: drawLineSkeleton
void FatBits::drawLineSkeleton(SkCanvas* max, const SkPoint pts[]) {
SkPaint paint;
this->setupSkeletonPaint(&paint);
SkPath path;
path.moveTo(pts[0]);
path.lineTo(pts[1]);
switch (fStyle) {
case kHair_Style:
if (fUseGPU) {
SkPaint p;
p.setStyle(SkPaint::kStroke_Style);
p.setStrokeWidth(SK_Scalar1 * fZoom);
SkPath dst;
p.getFillPath(path, &dst);
path.addPath(dst);
}
break;
case kStroke_Style: {
SkPaint p;
p.setStyle(SkPaint::kStroke_Style);
p.setStrokeWidth(SK_Scalar1 * fZoom);
SkPath dst;
p.getFillPath(path, &dst);
path = dst;
if (fUseGPU) {
path.moveTo(dst.getPoint(0));
path.lineTo(dst.getPoint(2));
}
} break;
}
max->drawPath(path, paint);
}
示例2: getOutlinePoint
static HB_Error getOutlinePoint(HB_Font hbFont, HB_Glyph glyph, int flags,
hb_uint32 index, HB_Fixed* xPos, HB_Fixed* yPos,
hb_uint32* resultingNumPoints) {
SkHarfBuzzFont* font = reinterpret_cast<SkHarfBuzzFont*>(hbFont->userData);
SkPaint paint;
font->setupPaint(&paint);
paint.setTextEncoding(SkPaint::kGlyphID_TextEncoding);
if (flags & HB_ShaperFlag_UseDesignMetrics) {
paint.setHinting(SkPaint::kNo_Hinting);
}
SkPath path;
uint16_t glyph16 = SkToU16(glyph);
paint.getTextPath(&glyph16, sizeof(glyph16), 0, 0, &path);
int numPoints = path.countPoints();
if (index >= numPoints) {
return HB_Err_Invalid_SubTable;
}
SkPoint pt = path.getPoint(index);
*xPos = SkScalarToHarfbuzzFixed(pt.fX);
*yPos = SkScalarToHarfbuzzFixed(pt.fY);
*resultingNumPoints = numPoints;
return HB_Err_Ok;
}