本文整理汇总了C++中SkDrawable::draw方法的典型用法代码示例。如果您正苦于以下问题:C++ SkDrawable::draw方法的具体用法?C++ SkDrawable::draw怎么用?C++ SkDrawable::draw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SkDrawable
的用法示例。
在下文中一共展示了SkDrawable::draw方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: draw
bool SkGroup::draw(SkAnimateMaker& maker) {
bool conditionTrue = ifCondition(maker, this, condition);
bool result = false;
for (SkDrawable** ptr = fChildren.begin(); ptr < fChildren.end(); ptr++) {
SkDrawable* drawable = *ptr;
if (drawable->isDrawable() == false)
continue;
if (conditionTrue == false) {
if (drawable->isApply())
((SkApply*) drawable)->disable();
continue;
}
maker.validate();
result |= drawable->draw(maker);
maker.validate();
}
return result;
}
示例2: immediate
bool SkActive::immediate(bool enable) {
SkMSec time = 0;
bool result = false;
SkDrawable* drawable = fApply.scope;
SkMSec final = fMaxTime;
do {
bool applied = fAnimators.count() == 0;
fApply.fLastTime = time;
fApply.refresh(fMaker);
for (int index = 0; index < fAnimators.count(); index++) {
SkAnimateBase* animate = fAnimators[index];
SkState& state = fState[index];
if (state.fMode != SkApply::kMode_immediate)
continue;
if (state.fBegin > time)
continue;
if (time > state.fBegin + state.fDuration)
continue;
applied = true;
SkOperandInterpolator& interpolator = *fInterpolators[index];
int count = animate->components();
if (animate->formula.size() > 0) {
SkTDOperandArray values;
values.setCount(count);
bool success = animate->fFieldInfo->setValue(fMaker, &values, 0, 0, NULL,
animate->getValuesType(), animate->formula);
SkASSERT(success);
fApply.applyValues(index, values.begin(), count, animate->getValuesType(), time);
} else {
SkAutoSTMalloc<16, SkOperand> values(count);
interpolator.timeToValues(time, values.get());
fApply.applyValues(index, values.get(), count, animate->getValuesType(), time);
}
}
if (enable)
drawable->enable(fMaker);
else if (applied)
result |= drawable->draw(fMaker);
time += SK_MSec1;
} while (time <= final);
return result;
}
示例3: draw
bool SkDisplayList::draw(SkAnimateMaker& maker, SkMSec inTime) {
validate();
fInTime = inTime;
bool result = false;
fInvalBounds.setEmpty();
if (fDrawList.count()) {
for (SkActive** activePtr = fActiveList.begin(); activePtr < fActiveList.end(); activePtr++) {
SkActive* active = *activePtr;
active->reset();
}
for (int index = 0; index < fDrawList.count(); index++) {
SkDrawable* draw = fDrawList[index];
draw->initialize(); // allow matrices to reset themselves
SkASSERT(draw->isDrawable());
validate();
result |= draw->draw(maker);
}
}
validate();
return result;
}