本文整理汇总了C++中SkApply::append方法的典型用法代码示例。如果您正苦于以下问题:C++ SkApply::append方法的具体用法?C++ SkApply::append怎么用?C++ SkApply::append使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkApply
的用法示例。
在下文中一共展示了SkApply::append方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: enable
bool SkApply::enable(SkAnimateMaker& maker) {
fEnabled = true;
bool initialized = fActive != NULL;
if (dynamicScope.size() > 0)
enableDynamic(maker);
if (maker.fError.hasError())
return false;
int animators = fAnimators.count();
int index;
for (index = 0; index < animators; index++) {
SkAnimateBase* animator = fAnimators[index];
animator->fStart = maker.fEnableTime;
animator->fResetPending = animator->fReset;
}
if (scope && scope->isApply())
((SkApply*) scope)->setEmbedded();
/* if (mode == kMode_once) {
if (scope) {
activate(maker);
interpolate(maker, maker.fEnableTime);
inactivate(maker);
}
return true;
}*/
if ((mode == kMode_immediate || mode == kMode_create) && scope == NULL)
return false; // !!! error?
bool enableMe = scope && (scope->hasEnable() || scope->isApply() || scope->isDrawable() == false);
if (mode == kMode_immediate && enableMe || mode == kMode_create)
activate(maker); // for non-drawables like post, prime them here
if (mode == kMode_immediate && enableMe)
fActive->enable();
if (mode == kMode_create && scope != NULL) {
enableCreate(maker);
return true;
}
if (mode == kMode_immediate) {
return scope->isApply() || scope->isDrawable() == false;
}
refresh(maker);
SkDisplayList& displayList = maker.fDisplayList;
SkDrawable* drawable;
#if defined SK_DEBUG && defined SK_DEBUG_ANIMATION_TIMING
SkString debugOut;
SkMSec time = maker.getAppTime();
debugOut.appendS32(time - maker.fDebugTimeBase);
debugOut.append(" apply enable id=");
debugOut.append(_id);
debugOut.append("; start=");
debugOut.appendS32(maker.fEnableTime - maker.fDebugTimeBase);
SkDebugf("%s\n", debugOut.c_str());
#endif
if (scope == NULL || scope->isApply() || scope->getType() == SkType_Movie || scope->isDrawable() == false) {
activate(maker); // for non-drawables like post, prime them here
if (initialized) {
append(this);
}
fEnabling = true;
interpolate(maker, maker.fEnableTime);
fEnabling = false;
if (scope != NULL && dontDraw == false)
scope->enable(maker);
return true;
} else if (initialized && restore == false)
append(this);
#if 0
bool wasActive = inactivate(maker); // start fresh
if (wasActive) {
activate(maker);
interpolate(maker, maker.fEnableTime);
return true;
}
#endif
// start here;
// now that one apply might embed another, only the parent apply should replace the scope
// or get appended to the display list
// similarly, an apply added by an add immediate has already been located in the display list
// and should not get moved or added again here
if (fEmbedded) {
return false; // already added to display list by embedder
}
drawable = (SkDrawable*) scope;
SkTDDrawableArray* parentList;
SkTDDrawableArray* grandList;
SkGroup* parentGroup;
SkGroup* thisGroup;
int old = displayList.findGroup(drawable, &parentList, &parentGroup, &thisGroup, &grandList);
if (old < 0)
goto append;
else if (fContainsScope) {
if ((*parentList)[old] != this || restore == true) {
append:
if (parentGroup)
parentGroup->markCopySize(old);
if (parentList->count() < 10000) {
fAppended = true;
*parentList->append() = this;
} else
maker.setErrorCode(SkDisplayXMLParserError::kDisplayTreeTooDeep);
old = -1;
} else
//.........这里部分代码省略.........