本文整理汇总了C++中SkAnimateBase::getValues方法的典型用法代码示例。如果您正苦于以下问题:C++ SkAnimateBase::getValues方法的具体用法?C++ SkAnimateBase::getValues怎么用?C++ SkAnimateBase::getValues使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkAnimateBase
的用法示例。
在下文中一共展示了SkAnimateBase::getValues方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: initState
void SkActive::initState(SkApply* apply, int offset) {
int count = fState.count();
for (int index = offset; index < count; index++) {
SkState& state = fState[index];
SkAnimateBase* animate = fAnimators[index];
#if 0 // def SK_DEBUG
if (animate->fHasEndEvent)
SkDebugf("%8x %8x active initState:\n", this, animate);
#endif
SkOperand* from = animate->getValues();
state.fStartTime = state.fBegin = apply->begin + animate->begin;
state.fMode = apply->mode;
state.fTransition = apply->transition;
#if 0
state.fPickup = (SkBool8) apply->pickup;
#endif
state.fRestore = (SkBool8) apply->restore;
state.fSave = apply->begin;
state.fStarted = false;
state.fSteps = apply->steps;
state.fTicks = 0;
state.fUnpostedEndEvent = (SkBool8) animate->fHasEndEvent;
calcDurations(index);
setInterpolator(index, from);
}
if (count == 0 && (apply->mode == SkApply::kMode_immediate || apply->mode == SkApply::kMode_create))
fMaxTime = apply->begin + apply->steps * SK_MSec1;
}
示例2: pickUp
void SkActive::pickUp(SkActive* existing) {
SkTDOperandArray existingValues;
for (int index = 0; index < fAnimators.count(); index++) {
SkAnimateBase* animate = fAnimators[index];
SkASSERT(animate->getValuesType() == SkType_Float);
int components = animate->components();
SkOperand* from = animate->getValues();
SkOperand* to = &from[animate->components()];
existingValues.setCount(components);
existing->fInterpolators[index]->timeToValues(
existing->fState[index].fTicks - existing->fState[index].fStartTime, existingValues.begin());
SkScalar originalSum = 0;
SkScalar workingSum = 0;
for (int cIndex = 0; cIndex < components; cIndex++) {
SkScalar delta = to[cIndex].fScalar - from[cIndex].fScalar;
originalSum += SkScalarMul(delta, delta);
delta = to[cIndex].fScalar - existingValues[cIndex].fScalar;
workingSum += SkScalarMul(delta, delta);
}
if (workingSum < originalSum) {
SkScalar originalDistance = SkScalarSqrt(originalSum);
SkScalar workingDistance = SkScalarSqrt(workingSum);
existing->fState[index].fDuration = (SkMSec) SkScalarMulDiv(fState[index].fDuration,
workingDistance, originalDistance);
}
fInterpolators[index]->reset(components, 2, SkType_Float);
fInterpolators[index]->setKeyFrame(0, 0, existingValues.begin(), animate->blend[0]);
fInterpolators[index]->setKeyFrame(1, fState[index].fDuration, to, animate->blend[0]);
}
}
示例3: resetInterpolators
void SkActive::resetInterpolators() {
int animators = fAnimators.count();
for (int index = 0; index < animators; index++) {
SkAnimateBase* animate = fAnimators[index];
SkOperand* values = animate->getValues();
setInterpolator(index, values);
}
}
示例4: fixInterpolator
void SkActive::fixInterpolator(SkBool save) {
int animators = fAnimators.count();
for (int index = 0; index < animators; index++) {
SkAnimateBase* animate = fAnimators[index];
if (save) { // saved slots increased
animate->refresh(fMaker);
SkOperand* values = animate->getValues();
setInterpolator(index, values);
saveInterpolatorValues(index);
} else
restoreInterpolatorValues(index);
}
}