本文整理汇总了C++中SkOpAngle::setID方法的典型用法代码示例。如果您正苦于以下问题:C++ SkOpAngle::setID方法的具体用法?C++ SkOpAngle::setID怎么用?C++ SkOpAngle::setID使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkOpAngle
的用法示例。
在下文中一共展示了SkOpAngle::setID方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: testOne
static void testOne(skiatest::Reporter* reporter, const SortSetTests& test) {
SkTDArray<SkOpAngle> angles;
bool unsortable = false;
bool unorderable = false;
SkTArray<SkOpSegment> segs;
for (size_t idx = 0; idx < test.count; ++idx) {
int ts[2];
const SortSet* set = test.set;
SkOpSegment& seg = segs.push_back();
setup(set, idx, &seg, ts, test.startPt);
SkOpAngle* angle = angles.append();
angle->set(&seg, ts[0], ts[1]);
#if DEBUG_ANGLE
angle->setID(idx);
#endif
if (angle->unsortable()) {
#if DEBUG_ANGLE
SkDebugf("%s test[%s]: angle[%d] unsortable\n", __FUNCTION__, test.name, idx);
#endif
unsortable = true;
}
if (angle->unorderable()) {
#if DEBUG_ANGLE
SkDebugf("%s test[%s]: angle[%d] unorderable\n", __FUNCTION__, test.name, idx);
#endif
unorderable = true;
}
reporter->bumpTestCount();
}
if (unsortable || unorderable) {
return;
}
#if DEBUG_ANGLE
SkDebugf("%s test[%s]\n", __FUNCTION__, test.name);
#endif
for (size_t idxL = 0; idxL < test.count; ++idxL) {
const SkOpAngle& first = angles[idxL];
for (size_t idxG = 0; idxG < test.count; ++idxG) {
if (idxL == idxG) {
continue;
}
const SkOpAngle& second = angles[idxG];
bool compare = first < second;
if (idxL < idxG) {
if (!compare) {
SkDebugf("%s test[%s]: first[%d] > second[%d]\n", __FUNCTION__,
test.name, idxL, idxG);
compare = first < second;
}
REPORTER_ASSERT(reporter, compare);
} else {
SkASSERT(idxL > idxG);
if (compare) {
SkDebugf("%s test[%s]: first[%d] < second[%d]\n", __FUNCTION__,
test.name, idxL, idxG);
compare = first < second;
}
REPORTER_ASSERT(reporter, !compare);
}
compare = second < first;
if (idxL < idxG) {
if (compare) {
SkDebugf("%s test[%s]: second[%d] < first[%d]\n", __FUNCTION__,
test.name, idxL, idxG);
compare = second < first;
}
REPORTER_ASSERT(reporter, !compare);
} else {
SkASSERT(idxL > idxG);
if (!compare) {
SkDebugf("%s test[%s]: second[%d] > first[%d]\n", __FUNCTION__,
test.name, idxL, idxG);
compare = second < first;
}
REPORTER_ASSERT(reporter, compare);
}
}
}
}