本文整理汇总了C++中SkApply::interpolate方法的典型用法代码示例。如果您正苦于以下问题:C++ SkApply::interpolate方法的具体用法?C++ SkApply::interpolate怎么用?C++ SkApply::interpolate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkApply
的用法示例。
在下文中一共展示了SkApply::interpolate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: next
virtual SkScalar next(SkPath* dst, SkScalar distance, SkPathMeasure& )
{
fMaker->setExtraPropertyCallBack(fDraw->fType, GetDistance, &distance);
SkDrawPath* drawPath = NULL;
if (fDraw->addPath->isPath()) {
drawPath = (SkDrawPath*) fDraw->addPath;
} else {
SkApply* apply = (SkApply*) fDraw->addPath;
apply->refresh(*fMaker);
apply->activate(*fMaker);
apply->interpolate(*fMaker, SkScalarMulRound(distance, 1000));
drawPath = (SkDrawPath*) apply->getScope();
}
SkMatrix m;
m.reset();
if (fDraw->addMatrix) {
SkDrawMatrix* matrix;
if (fDraw->addMatrix->getType() == SkType_Matrix)
matrix = (SkDrawMatrix*) fDraw->addMatrix;
else {
SkApply* apply = (SkApply*) fDraw->addMatrix;
apply->refresh(*fMaker);
apply->activate(*fMaker);
apply->interpolate(*fMaker, SkScalarMulRound(distance, 1000));
matrix = (SkDrawMatrix*) apply->getScope();
}
}
SkScalar result = 0;
SkAnimatorScript::EvaluateFloat(*fMaker, NULL, fDraw->spacing.c_str(), &result);
if (drawPath)
dst->addPath(drawPath->getPath(), m);
fMaker->clearExtraPropertyCallBack(fDraw->fType);
return result;
}
示例2: enableCreate
void SkApply::enableCreate(SkAnimateMaker& maker) {
SkString newID;
for (int step = 0; step <= steps; step++) {
fLastTime = step * SK_MSec1;
bool success = maker.computeID(scope, this, &newID);
if (success == false)
return;
if (maker.find(newID.c_str(), NULL))
continue;
SkApply* copy = (SkApply*) deepCopy(&maker); // work on copy of animator state
if (mode == kMode_create)
copy->mode = (Mode) -1;
SkDrawable* copyScope = copy->scope = (SkDrawable*) scope->deepCopy(&maker);
*fScopes.append() = copyScope;
if (copyScope->resolveIDs(maker, scope, this)) {
step = steps; // quit
goto next; // resolveIDs failed
}
if (newID.size() > 0)
maker.setID(copyScope, newID);
if (copy->resolveIDs(maker, this, this)) { // fix up all fields, including target
step = steps; // quit
goto next; // resolveIDs failed
}
copy->activate(maker);
copy->interpolate(maker, step * SK_MSec1);
maker.removeActive(copy->fActive);
next:
delete copy;
}
}
示例3: doDelayedEvent
void SkAnimateMaker::doDelayedEvent() {
fEnableTime = getAppTime();
for (int index = 0; index < fDelayed.count(); ) {
SkDisplayable* child = fDelayed[index];
SkASSERT(child->isApply());
SkApply* apply = (SkApply*) child;
apply->interpolate(*this, fEnableTime);
if (apply->hasDelayedAnimator())
index++;
else
fDelayed.remove(index);
}
}
示例4: next
virtual void next(const SkPoint& loc, int u, int v, SkPath* dst)
{
fLoc = loc;
fU = u;
fV = v;
SkDrawPath* drawPath;
fMaker->setExtraPropertyCallBack(fDraw->fType, Get2D, this);
if (fDraw->addPath->isPath()) {
drawPath = (SkDrawPath*) fDraw->addPath;
} else {
SkApply* apply = (SkApply*) fDraw->addPath;
apply->refresh(*fMaker);
apply->activate(*fMaker);
apply->interpolate(*fMaker, v);
drawPath = (SkDrawPath*) apply->getScope();
}
if (drawPath == NULL)
goto clearCallBack;
if (fDraw->matrix) {
SkDrawMatrix* matrix;
if (fDraw->matrix->getType() == SkType_Matrix)
matrix = (SkDrawMatrix*) fDraw->matrix;
else {
SkApply* apply = (SkApply*) fDraw->matrix;
apply->activate(*fMaker);
apply->interpolate(*fMaker, v);
matrix = (SkDrawMatrix*) apply->getScope();
}
if (matrix) {
dst->addPath(drawPath->getPath(), matrix->getMatrix());
goto clearCallBack;
}
}
dst->addPath(drawPath->getPath());
clearCallBack:
fMaker->clearExtraPropertyCallBack(fDraw->fType);
}