From 49dec430e8a38943c5e934c1e31b724bf53c47c4 Mon Sep 17 00:00:00 2001 From: John Reck Date: Thu, 23 Jul 2015 15:33:12 -0700 Subject: Move updateMatrix() call to animateCommon Bug: 22667315 HWUI internally always assumes that RenderNode->properties() has a fully-baked matrix. However, RenderThread animations violate this and will perform an update of that matrix after they run. This was missing in the fallback scenario where an animation was running on a View that is detached from the tree. If a RenderThread animation is started on an attached view, it becomes detached, and is then re-attached it will crash in the staging properties push. The fix for this is to move the call to updateMatrix from animate() to animateCommon() so that the animateNoDamage() path will similarly perform the necessary matrix update. Change-Id: I4c899a6f68659342a6515f1d7f20d3c4af65caf0 --- libs/hwui/AnimatorManager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libs/hwui/AnimatorManager.cpp b/libs/hwui/AnimatorManager.cpp index 966959a..0dababd 100644 --- a/libs/hwui/AnimatorManager.cpp +++ b/libs/hwui/AnimatorManager.cpp @@ -117,7 +117,6 @@ uint32_t AnimatorManager::animate(TreeInfo& info) { uint32_t dirty = animateCommon(info); - mParent.mProperties.updateMatrix(); info.damageAccumulator->pushTransform(&mParent); mParent.damageSelf(info); @@ -136,6 +135,7 @@ uint32_t AnimatorManager::animateCommon(TreeInfo& info) { newEnd = std::remove_if(mAnimators.begin(), mAnimators.end(), functor); mAnimators.erase(newEnd, mAnimators.end()); mAnimationHandle->notifyAnimationsRan(); + mParent.mProperties.updateMatrix(); return functor.dirtyMask; } -- cgit v1.1