Merge "Fix dirtyMask in AnimateFunctor" into nyc-dev
am: def048e596
* commit 'def048e596d7531996dd26321cb38641a8e5ad4e':
Fix dirtyMask in AnimateFunctor
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user