本文整理汇总了C++中SkPath::dumpHex方法的典型用法代码示例。如果您正苦于以下问题:C++ SkPath::dumpHex方法的具体用法?C++ SkPath::dumpHex怎么用?C++ SkPath::dumpHex使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkPath
的用法示例。
在下文中一共展示了SkPath::dumpHex方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: onDrawContent
void onDrawContent(SkCanvas* canvas) override {
const float SCALE = 1;
canvas->translate(30, 40);
canvas->scale(SCALE, SCALE);
SkPoint p1 = SkPoint::Make(50, 50);
SkPoint p2 = SkPoint::Make(80, 50);
SkPath path;
switch (fPathType) {
case 0:
path = quadPath(p1, p2);
break;
case 1:
path = cubicPath(p1, p2);
break;
case 2:
path = rectPath(p1);
break;
case 3:
path = linSemicirclePath(p1, p2);
break;
default:
path = quadPath(p1, p2);
break;
}
if (fClosePath) {
path.close();
}
SkPaint p;
p.setColor(SK_ColorRED);
p.setAntiAlias(true);
p.setStyle(SkPaint::kStroke_Style);
p.setStrokeWidth(fStroke);
canvas->drawPath(path, p);
if (fDumpHex) {
std::cerr << "path dumpHex" << std::endl;
path.dumpHex();
}
SkPaint hairp;
hairp.setColor(SK_ColorBLACK);
hairp.setAntiAlias(true);
hairp.setStyle(SkPaint::kStroke_Style);
if (fDrawFillPath) {
SkPath fillpath;
p.getFillPath(path, &fillpath);
canvas->drawPath(fillpath, hairp);
if (fDumpHex) {
std::cerr << "fillpath dumpHex" << std::endl;
fillpath.dumpHex();
}
}
if (fDumpHex) {
std::cerr << std::endl;
fDumpHex = false;
}
// draw original path with green hairline
hairp.setColor(SK_ColorGREEN);
canvas->drawPath(path, hairp);
}