| Index: src/animator/SkDisplayApply.cpp
|
| diff --git a/src/animator/SkDisplayApply.cpp b/src/animator/SkDisplayApply.cpp
|
| index 88f73eccab5b44ca40a31678543d629ae7a26cf4..0d5f09d342f6447e90777d4d05c73c06a6cc32c1 100644
|
| --- a/src/animator/SkDisplayApply.cpp
|
| +++ b/src/animator/SkDisplayApply.cpp
|
| @@ -56,7 +56,7 @@ const SkMemberInfo SkApply::fInfo[] = {
|
| DEFINE_GET_MEMBER(SkApply);
|
|
|
| SkApply::SkApply() : begin(0), dontDraw(false), interval((SkMSec) -1), mode((Mode) -1), /*pickup(false), */
|
| - restore(false), scope(NULL), steps(-1), transition((Transition) -1), fActive(NULL), /*fCurrentScope(NULL),*/
|
| + restore(false), scope(nullptr), steps(-1), transition((Transition) -1), fActive(nullptr), /*fCurrentScope(nullptr),*/
|
| fLastTime(0), fAppended(false), fContainsScope(false), fDeleteScope(false), fEmbedded(false),
|
| fEnabled(false), fEnabling(false) {
|
| }
|
| @@ -71,7 +71,7 @@ SkApply::~SkApply() {
|
| }
|
|
|
| void SkApply::activate(SkAnimateMaker& maker) {
|
| - if (fActive != NULL) {
|
| + if (fActive != nullptr) {
|
| if (fActive->fDrawIndex == 0 && fActive->fDrawMax == 0)
|
| return; // if only one use, nothing more to do
|
| if (restore == false)
|
| @@ -92,7 +92,7 @@ void SkApply::activate(SkAnimateMaker& maker) {
|
| }
|
|
|
| void SkApply::append(SkApply* apply) {
|
| - if (fActive == NULL)
|
| + if (fActive == nullptr)
|
| return;
|
| int oldCount = fActive->fAnimators.count();
|
| fActive->append(apply);
|
| @@ -110,7 +110,7 @@ void SkApply::applyValues(int animatorIndex, SkOperand* values, int count,
|
| SkAnimateBase* animator = fActive->fAnimators[animatorIndex];
|
| const SkMemberInfo * info = animator->fFieldInfo;
|
| SkASSERT(animator);
|
| - SkASSERT(info != NULL);
|
| + SkASSERT(info != nullptr);
|
| SkDisplayTypes type = (SkDisplayTypes) info->fType;
|
| SkDisplayable* target = getTarget(animator);
|
| if (animator->hasExecute() || type == SkType_MemberFunction || type == SkType_MemberProperty) {
|
| @@ -123,7 +123,7 @@ void SkApply::applyValues(int animatorIndex, SkOperand* values, int count,
|
| temp.fOperand = values[index];
|
| *typedValues.append() = temp;
|
| }
|
| - executor->executeFunction(target, info->functionIndex(), typedValues, info->getType(), NULL);
|
| + executor->executeFunction(target, info->functionIndex(), typedValues, info->getType(), nullptr);
|
| } else {
|
| SkScriptValue scriptValue;
|
| scriptValue.fOperand = values[0];
|
| @@ -162,7 +162,7 @@ bool SkApply::contains(SkDisplayable* child) {
|
|
|
| SkDisplayable* SkApply::deepCopy(SkAnimateMaker* maker) {
|
| SkADrawable* saveScope = scope;
|
| - scope = NULL;
|
| + scope = nullptr;
|
| SkApply* result = (SkApply*) INHERITED::deepCopy(maker);
|
| result->scope = scope = saveScope;
|
| SkAnimateBase** end = fAnimators.end();
|
| @@ -184,7 +184,7 @@ void SkApply::disable() {
|
| }
|
|
|
| bool SkApply::draw(SkAnimateMaker& maker) {
|
| - if (scope ==NULL)
|
| + if (scope ==nullptr)
|
| return false;
|
| if (scope->isApply() || scope->isDrawable() == false)
|
| return false;
|
| @@ -262,7 +262,7 @@ void SkApply::dump(SkAnimateMaker* maker) {
|
|
|
| bool SkApply::enable(SkAnimateMaker& maker) {
|
| fEnabled = true;
|
| - bool initialized = fActive != NULL;
|
| + bool initialized = fActive != nullptr;
|
| if (dynamicScope.size() > 0)
|
| enableDynamic(maker);
|
| if (maker.fError.hasError())
|
| @@ -284,14 +284,14 @@ bool SkApply::enable(SkAnimateMaker& maker) {
|
| }
|
| return true;
|
| }*/
|
| - if ((mode == kMode_immediate || mode == kMode_create) && scope == NULL)
|
| + if ((mode == kMode_immediate || mode == kMode_create) && scope == nullptr)
|
| 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) {
|
| + if (mode == kMode_create && scope != nullptr) {
|
| enableCreate(maker);
|
| return true;
|
| }
|
| @@ -311,7 +311,7 @@ bool SkApply::enable(SkAnimateMaker& maker) {
|
| 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) {
|
| + if (scope == nullptr || scope->isApply() || scope->getType() == SkType_Movie || scope->isDrawable() == false) {
|
| activate(maker); // for non-drawables like post, prime them here
|
| if (initialized) {
|
| append(this);
|
| @@ -319,7 +319,7 @@ bool SkApply::enable(SkAnimateMaker& maker) {
|
| fEnabling = true;
|
| interpolate(maker, maker.fEnableTime);
|
| fEnabling = false;
|
| - if (scope != NULL && dontDraw == false)
|
| + if (scope != nullptr && dontDraw == false)
|
| scope->enable(maker);
|
| return true;
|
| } else if (initialized && restore == false)
|
| @@ -365,10 +365,10 @@ append:
|
| SkASSERT(old < parentList->count());
|
| if ((*parentList)[old]->isApply()) {
|
| SkApply* apply = (SkApply*) (*parentList)[old];
|
| - if (apply != this && apply->fActive == NULL)
|
| + if (apply != this && apply->fActive == nullptr)
|
| apply->activate(maker);
|
| apply->append(this);
|
| - parentGroup = NULL;
|
| + parentGroup = nullptr;
|
| } else {
|
| if (parentGroup)
|
| parentGroup->markCopySize(old);
|
| @@ -377,7 +377,7 @@ append:
|
| int oldApply = displayList.findGroup(this, &parentList, &pGroup, &thisGroup, &grandList);
|
| if (oldApply >= 0) {
|
| (*parentList)[oldApply] = (SkADrawable*) SkDisplayType::CreateInstance(&maker, SkType_Apply);
|
| - parentGroup = NULL;
|
| + parentGroup = nullptr;
|
| fDeleteScope = true;
|
| }
|
| *newApplyLocation = this;
|
| @@ -397,7 +397,7 @@ void SkApply::enableCreate(SkAnimateMaker& maker) {
|
| bool success = maker.computeID(scope, this, &newID);
|
| if (success == false)
|
| return;
|
| - if (maker.find(newID.c_str(), NULL))
|
| + if (maker.find(newID.c_str(), nullptr))
|
| continue;
|
| SkApply* copy = (SkApply*) deepCopy(&maker); // work on copy of animator state
|
| if (mode == kMode_create)
|
| @@ -429,11 +429,11 @@ void SkApply::enableDynamic(SkAnimateMaker& maker) {
|
| &newScope);
|
| if (success && scope != newScope) {
|
| SkTDDrawableArray* pList, * gList;
|
| - SkGroup* pGroup = NULL, * found = NULL;
|
| + SkGroup* pGroup = nullptr, * found = nullptr;
|
| int old = maker.fDisplayList.findGroup(scope, &pList, &pGroup, &found, &gList);
|
| if (pList && old >= 0 && (*pList)[old]->isApply() && (*pList)[old] != this) {
|
| if (fAppended == false) {
|
| - if (found != NULL) {
|
| + if (found != nullptr) {
|
| SkDisplayable* oldChild = (*pList)[old];
|
| if (oldChild->isApply() && found->copySet(old)) {
|
| found->markCopyClear(old);
|
| @@ -449,7 +449,7 @@ void SkApply::enableDynamic(SkAnimateMaker& maker) {
|
| }
|
| maker.removeActive(fActive);
|
| delete fActive;
|
| - fActive = NULL;
|
| + fActive = nullptr;
|
| }
|
|
|
| void SkApply::endSave(int index) {
|
| @@ -528,11 +528,11 @@ bool SkApply::hasEnable() const {
|
| }
|
|
|
| bool SkApply::inactivate(SkAnimateMaker& maker) {
|
| - if (fActive == NULL)
|
| + if (fActive == nullptr)
|
| return false;
|
| maker.removeActive(fActive);
|
| delete fActive;
|
| - fActive = NULL;
|
| + fActive = nullptr;
|
| return true;
|
| }
|
|
|
| @@ -541,14 +541,14 @@ SkMSec lastTime = (SkMSec) -1;
|
| #endif
|
|
|
| bool SkApply::interpolate(SkAnimateMaker& maker, SkMSec rawTime) {
|
| - if (fActive == NULL)
|
| + if (fActive == nullptr)
|
| return false;
|
| bool result = false;
|
| #if defined SK_DEBUG && defined SK_DEBUG_ANIMATION_TIMING
|
| SkMSec time = maker.getAppTime();
|
| if (lastTime == (SkMSec) -1)
|
| lastTime = rawTime - 1;
|
| - if (fActive != NULL &&
|
| + if (fActive != nullptr &&
|
| strcmp(id, "a3") == 0 && rawTime > lastTime) {
|
| lastTime += 1000;
|
| SkString debugOut;
|
| @@ -629,7 +629,7 @@ bool SkApply::interpolate(SkAnimateMaker& maker, SkMSec rawTime) {
|
| fLastTime = animate->dur;
|
| SkTypedArray formulaValues;
|
| formulaValues.setCount(count);
|
| - SkDEBUGCODE(bool success = ) animate->fFieldInfo->setValue(maker, &formulaValues, 0, 0, NULL,
|
| + SkDEBUGCODE(bool success = ) animate->fFieldInfo->setValue(maker, &formulaValues, 0, 0, nullptr,
|
| animate->getValuesType(), animate->formula);
|
| SkASSERT(success);
|
| if (restore)
|
| @@ -645,7 +645,7 @@ bool SkApply::interpolate(SkAnimateMaker& maker, SkMSec rawTime) {
|
| }
|
|
|
| void SkApply::initialize() {
|
| - if (scope == NULL)
|
| + if (scope == nullptr)
|
| return;
|
| if (scope->isApply() || scope->isDrawable() == false)
|
| return;
|
| @@ -665,12 +665,12 @@ void SkApply::onEndElement(SkAnimateMaker& maker)
|
| }
|
| if (mode == kMode_create)
|
| return;
|
| - if (scope != NULL && steps >= 0 && scope->isApply() == false && scope->isDrawable())
|
| + if (scope != nullptr && steps >= 0 && scope->isApply() == false && scope->isDrawable())
|
| scope->setSteps(steps);
|
| for (SkAnimateBase** animPtr = fAnimators.begin(); animPtr < fAnimators.end(); animPtr++) {
|
| SkAnimateBase* anim = *animPtr;
|
| //for reusing apply statements with dynamic scope
|
| - if (anim->fTarget == NULL || anim->fTargetIsScope) {
|
| + if (anim->fTarget == nullptr || anim->fTargetIsScope) {
|
| anim->fTargetIsScope = true;
|
| if (scope)
|
| anim->fTarget = scope;
|
| @@ -678,7 +678,7 @@ void SkApply::onEndElement(SkAnimateMaker& maker)
|
| anim->setTarget(maker);
|
| anim->onEndElement(maker); // allows animate->fFieldInfo to be set
|
| }
|
| - if (scope != NULL && steps >= 0 && anim->fTarget != scope && anim->fTarget->isDrawable())
|
| + if (scope != nullptr && steps >= 0 && anim->fTarget != scope && anim->fTarget->isDrawable())
|
| anim->fTarget->setSteps(steps);
|
| }
|
| }
|
| @@ -748,7 +748,7 @@ void SkApply::save(int index) {
|
| // !!! this all may be unneeded, at least in the dynamic case ??
|
| int activeIndex = fActive->fDrawIndex + index;
|
| SkTDOperandArray last;
|
| - if (fActive->fSaveRestore[activeIndex] == NULL) {
|
| + if (fActive->fSaveRestore[activeIndex] == nullptr) {
|
| fActive->fSaveRestore[activeIndex] = new SkOperand[count];
|
| useLast = false;
|
| } else {
|
|
|