diff options
author | John Reck <jreck@google.com> | 2014-09-05 22:38:41 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2014-09-05 22:38:42 +0000 |
commit | 4e849178ef35687d0ce679487d8cfb6c5521fe3b (patch) | |
tree | 8646cb6f9846524d90c7bb11f1d2d808ec55eb07 /libs | |
parent | d89c5ad3d38d15f9d33fc3e0a004ad9d85e9e3cc (diff) | |
parent | ec845a215e343cdb3b2e4c7b6aff7b24beb0236b (diff) | |
download | frameworks_base-4e849178ef35687d0ce679487d8cfb6c5521fe3b.zip frameworks_base-4e849178ef35687d0ce679487d8cfb6c5521fe3b.tar.gz frameworks_base-4e849178ef35687d0ce679487d8cfb6c5521fe3b.tar.bz2 |
Merge "Fix race condition" into lmp-dev
Diffstat (limited to 'libs')
-rw-r--r-- | libs/hwui/AnimationContext.cpp | 5 | ||||
-rw-r--r-- | libs/hwui/AnimationContext.h | 4 | ||||
-rw-r--r-- | libs/hwui/renderthread/CanvasContext.cpp | 2 |
3 files changed, 5 insertions, 6 deletions
diff --git a/libs/hwui/AnimationContext.cpp b/libs/hwui/AnimationContext.cpp index 716dcf5..a20bdae 100644 --- a/libs/hwui/AnimationContext.cpp +++ b/libs/hwui/AnimationContext.cpp @@ -17,7 +17,6 @@ #include "Animator.h" #include "RenderNode.h" -#include "TreeInfo.h" #include "renderthread/TimeLord.h" namespace android { @@ -34,7 +33,7 @@ AnimationContext::~AnimationContext() { } void AnimationContext::destroy() { - startFrame(); + startFrame(TreeInfo::MODE_RT_ONLY); while (mCurrentFrameAnimations.mNextHandle) { AnimationHandle* current = mCurrentFrameAnimations.mNextHandle; AnimatorManager& animators = current->mRenderNode->animators(); @@ -55,7 +54,7 @@ void AnimationContext::addAnimationHandle(AnimationHandle* handle) { handle->insertAfter(&mNextFrameAnimations); } -void AnimationContext::startFrame() { +void AnimationContext::startFrame(TreeInfo::TraversalMode mode) { LOG_ALWAYS_FATAL_IF(mCurrentFrameAnimations.mNextHandle, "Missed running animations last frame!"); AnimationHandle* head = mNextFrameAnimations.mNextHandle; diff --git a/libs/hwui/AnimationContext.h b/libs/hwui/AnimationContext.h index 9b3d5f4..909ed36 100644 --- a/libs/hwui/AnimationContext.h +++ b/libs/hwui/AnimationContext.h @@ -20,6 +20,7 @@ #include <utils/RefBase.h> #include <utils/StrongPointer.h> +#include "TreeInfo.h" #include "renderthread/TimeLord.h" #include "utils/Macros.h" @@ -30,7 +31,6 @@ class AnimationContext; class AnimationListener; class BaseRenderNodeAnimator; class RenderNode; -class TreeInfo; /* * AnimationHandle is several classes merged into one. @@ -90,7 +90,7 @@ public: // Marks the start of a frame, which will update the frame time and move all // next frame animations into the current frame - ANDROID_API virtual void startFrame(); + ANDROID_API virtual void startFrame(TreeInfo::TraversalMode mode); // Runs any animations still left in mCurrentFrameAnimations that were not run // as part of the standard RenderNode:prepareTree pass. diff --git a/libs/hwui/renderthread/CanvasContext.cpp b/libs/hwui/renderthread/CanvasContext.cpp index 4129a89..5e6796c 100644 --- a/libs/hwui/renderthread/CanvasContext.cpp +++ b/libs/hwui/renderthread/CanvasContext.cpp @@ -150,7 +150,7 @@ void CanvasContext::prepareTree(TreeInfo& info) { if (mPrefetechedLayers.size() && info.mode == TreeInfo::MODE_FULL) { info.canvasContext = this; } - mAnimationContext->startFrame(); + mAnimationContext->startFrame(info.mode); mRootRenderNode->prepareTree(info); mAnimationContext->runRemainingAnimations(info); |