本文整理汇总了C++中SkOpContour::debugValidate方法的典型用法代码示例。如果您正苦于以下问题:C++ SkOpContour::debugValidate方法的具体用法?C++ SkOpContour::debugValidate怎么用?C++ SkOpContour::debugValidate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkOpContour
的用法示例。
在下文中一共展示了SkOpContour::debugValidate方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: walk
//.........这里部分代码省略.........
if (can_add_curve(v1, curve1) && can_add_curve(v2, curve2)) {
fContourBuilder.addCurve(v1, curve1, pair[0].fW);
fContourBuilder.addCurve(v2, curve2, pair[1].fW);
break;
}
}
}
fContourBuilder.addConic(pointsPtr, weight);
} break;
case SkPath::kCubic_Verb:
{
// Split complex cubics (such as self-intersecting curves or
// ones with difficult curvature) in two before proceeding.
// This can be required for intersection to succeed.
SkScalar splitT[3];
int breaks = SkDCubic::ComplexBreak(pointsPtr, splitT);
if (!breaks) {
fContourBuilder.addCubic(pointsPtr);
break;
}
SkASSERT(breaks <= (int) SK_ARRAY_COUNT(splitT));
struct Splitsville {
double fT[2];
SkPoint fPts[4];
SkPoint fReduced[4];
SkPath::Verb fVerb;
bool fCanAdd;
} splits[4];
SkASSERT(SK_ARRAY_COUNT(splits) == SK_ARRAY_COUNT(splitT) + 1);
SkTQSort(splitT, &splitT[breaks - 1]);
for (int index = 0; index <= breaks; ++index) {
Splitsville* split = &splits[index];
split->fT[0] = index ? splitT[index - 1] : 0;
split->fT[1] = index < breaks ? splitT[index] : 1;
SkDCubic part = SkDCubic::SubDivide(pointsPtr, split->fT[0], split->fT[1]);
if (!part.toFloatPoints(split->fPts)) {
return false;
}
split->fVerb = SkReduceOrder::Cubic(split->fPts, split->fReduced);
SkPoint* curve = SkPath::kCubic_Verb == verb
? split->fPts : split->fReduced;
split->fCanAdd = can_add_curve(split->fVerb, curve);
}
for (int index = 0; index <= breaks; ++index) {
Splitsville* split = &splits[index];
if (!split->fCanAdd) {
continue;
}
int prior = index;
while (prior > 0 && !splits[prior - 1].fCanAdd) {
--prior;
}
if (prior < index) {
split->fT[0] = splits[prior].fT[0];
split->fPts[0] = splits[prior].fPts[0];
}
int next = index;
int breakLimit = SkTMin(breaks, (int) SK_ARRAY_COUNT(splits) - 1);
while (next < breakLimit && !splits[next + 1].fCanAdd) {
++next;
}
if (next > index) {
split->fT[1] = splits[next].fT[1];
split->fPts[3] = splits[next].fPts[3];
}
if (prior < index || next > index) {
split->fVerb = SkReduceOrder::Cubic(split->fPts, split->fReduced);
}
SkPoint* curve = SkPath::kCubic_Verb == split->fVerb
? split->fPts : split->fReduced;
if (!can_add_curve(split->fVerb, curve)) {
return false;
}
fContourBuilder.addCurve(split->fVerb, curve);
}
}
break;
case SkPath::kClose_Verb:
SkASSERT(contour);
if (!close()) {
return false;
}
contour = nullptr;
continue;
default:
SkDEBUGFAIL("bad verb");
return false;
}
SkASSERT(contour);
if (contour->count()) {
contour->debugValidate();
}
pointsPtr += SkPathOpsVerbToPoints(verb);
}
fContourBuilder.flush();
if (contour && contour->count() &&!fAllowOpenContours && !close()) {
return false;
}
return true;
}