本文整理汇总了C++中SkAnimateMaker::helperAdd方法的典型用法代码示例。如果您正苦于以下问题:C++ SkAnimateMaker::helperAdd方法的具体用法?C++ SkAnimateMaker::helperAdd怎么用?C++ SkAnimateMaker::helperAdd使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkAnimateMaker
的用法示例。
在下文中一共展示了SkAnimateMaker::helperAdd方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: enable
bool SkAdd::enable(SkAnimateMaker& maker ) {
SkDisplayTypes type = getType();
SkDisplayList& displayList = maker.fDisplayList;
SkTDDrawableArray* parentList = displayList.getDrawList();
if (type == SkType_Add) {
if (use == NULL) // not set in apply yet
return true;
}
bool skipAddToParent = true;
SkASSERT(type != SkType_Replace || where);
SkTDDrawableArray* grandList SK_INIT_TO_AVOID_WARNING;
SkGroup* parentGroup = NULL;
SkGroup* thisGroup = NULL;
int index = where ? displayList.findGroup(where, &parentList, &parentGroup,
&thisGroup, &grandList) : 0;
if (index < 0)
return true;
int max = parentList->count();
if (where == NULL && type == SkType_Move)
index = max;
if (offset != SK_MaxS32) {
index += offset;
if (index > max) {
maker.setErrorCode(SkDisplayXMLParserError::kIndexOutOfRange);
return true; // caller should not add
}
}
if (offset < 0 && where == NULL)
index += max + 1;
switch (type) {
case SkType_Add:
if (offset == SK_MaxS32 && where == NULL) {
if (use->isDrawable()) {
skipAddToParent = mode == kMode_immediate;
if (skipAddToParent) {
if (where == NULL) {
SkTDDrawableArray* useParentList;
index = displayList.findGroup(this, &useParentList, &parentGroup,
&thisGroup, &grandList);
if (index >= 0) {
parentGroup->markCopySize(index);
parentGroup->markCopySet(index);
useParentList->begin()[index] = use;
break;
}
}
*parentList->append() = use;
}
}
break;
} else {
if (thisGroup)
thisGroup->markCopySize(index);
*parentList->insert(index) = use;
if (thisGroup)
thisGroup->markCopySet(index);
if (use->isApply())
((SkApply*) use)->setEmbedded();
}
break;
case SkType_Move: {
int priorLocation = parentList->find(use);
if (priorLocation < 0)
break;
*parentList->insert(index) = use;
if (index < priorLocation)
priorLocation++;
parentList->remove(priorLocation);
} break;
case SkType_Remove: {
SkDisplayable* old = (*parentList)[index];
if (((SkRemove*)(this))->fDelete) {
delete old;
goto noHelperNeeded;
}
for (int inner = 0; inner < maker.fChildren.count(); inner++) {
SkDisplayable* child = maker.fChildren[inner];
if (child == old || child->contains(old))
goto noHelperNeeded;
}
if (maker.fHelpers.find(old) < 0)
maker.helperAdd(old);
noHelperNeeded:
parentList->remove(index);
} break;
case SkType_Replace:
if (thisGroup) {
thisGroup->markCopySize(index);
if (thisGroup->markedForDelete(index)) {
SkDisplayable* old = (*parentList)[index];
if (maker.fHelpers.find(old) < 0)
maker.helperAdd(old);
}
}
(*parentList)[index] = use;
if (thisGroup)
thisGroup->markCopySet(index);
break;
default:
SkASSERT(0);
//.........这里部分代码省略.........