Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9e066cbf authored by John Reck's avatar John Reck
Browse files

Fix dirtyMask in AnimateFunctor

Bug: 27313379
Change-Id: I0c0cffe7e1940914f0143714643ede539b86216f
parent 342006e9
Loading
Loading
Loading
Loading
+7 −7
Original line number Original line Diff line number Diff line
@@ -95,11 +95,11 @@ void AnimatorManager::onAnimatorTargetChanged(BaseRenderNodeAnimator* animator)


class AnimateFunctor {
class AnimateFunctor {
public:
public:
    AnimateFunctor(TreeInfo& info, AnimationContext& context)
    AnimateFunctor(TreeInfo& info, AnimationContext& context, uint32_t* outDirtyMask)
            : dirtyMask(0), mInfo(info), mContext(context) {}
            : mInfo(info), mContext(context), mDirtyMask(outDirtyMask) {}


    bool operator() (sp<BaseRenderNodeAnimator>& animator) {
    bool operator() (sp<BaseRenderNodeAnimator>& animator) {
        dirtyMask |= animator->dirtyMask();
        *mDirtyMask |= animator->dirtyMask();
        bool remove = animator->animate(mContext);
        bool remove = animator->animate(mContext);
        if (remove) {
        if (remove) {
            animator->detach();
            animator->detach();
@@ -114,11 +114,10 @@ public:
        return remove;
        return remove;
    }
    }


    uint32_t dirtyMask;

private:
private:
    TreeInfo& mInfo;
    TreeInfo& mInfo;
    AnimationContext& mContext;
    AnimationContext& mContext;
    uint32_t* mDirtyMask;
};
};


uint32_t AnimatorManager::animate(TreeInfo& info) {
uint32_t AnimatorManager::animate(TreeInfo& info) {
@@ -143,12 +142,13 @@ void AnimatorManager::animateNoDamage(TreeInfo& info) {
}
}


uint32_t AnimatorManager::animateCommon(TreeInfo& info) {
uint32_t AnimatorManager::animateCommon(TreeInfo& info) {
    AnimateFunctor functor(info, mAnimationHandle->context());
    uint32_t dirtyMask;
    AnimateFunctor functor(info, mAnimationHandle->context(), &dirtyMask);
    auto newEnd = std::remove_if(mAnimators.begin(), mAnimators.end(), functor);
    auto newEnd = std::remove_if(mAnimators.begin(), mAnimators.end(), functor);
    mAnimators.erase(newEnd, mAnimators.end());
    mAnimators.erase(newEnd, mAnimators.end());
    mAnimationHandle->notifyAnimationsRan();
    mAnimationHandle->notifyAnimationsRan();
    mParent.mProperties.updateMatrix();
    mParent.mProperties.updateMatrix();
    return functor.dirtyMask;
    return dirtyMask;
}
}


static void endStagingAnimator(sp<BaseRenderNodeAnimator>& animator) {
static void endStagingAnimator(sp<BaseRenderNodeAnimator>& animator) {