Put VD animators on paused list when RT stops drawing
am: c82e879e56
Change-Id: I9f0202c8e69e681014253842b2a2de75d372616b
This commit is contained in:
@@ -242,6 +242,16 @@ public:
|
|||||||
mPausedVDAnimators.clear();
|
mPausedVDAnimators.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Move all the animators to the paused list, and send a delayed message to notify the finished
|
||||||
|
// listener.
|
||||||
|
void pauseAnimators() {
|
||||||
|
mPausedVDAnimators.insert(mRunningVDAnimators.begin(), mRunningVDAnimators.end());
|
||||||
|
for (auto& anim : mRunningVDAnimators) {
|
||||||
|
detachVectorDrawableAnimator(anim.get());
|
||||||
|
}
|
||||||
|
mRunningVDAnimators.clear();
|
||||||
|
}
|
||||||
|
|
||||||
void doAttachAnimatingNodes(AnimationContext* context) {
|
void doAttachAnimatingNodes(AnimationContext* context) {
|
||||||
for (size_t i = 0; i < mPendingAnimatingRenderNodes.size(); i++) {
|
for (size_t i = 0; i < mPendingAnimatingRenderNodes.size(); i++) {
|
||||||
RenderNode* node = mPendingAnimatingRenderNodes[i].get();
|
RenderNode* node = mPendingAnimatingRenderNodes[i].get();
|
||||||
@@ -415,8 +425,8 @@ public:
|
|||||||
postOnFinishedEvents();
|
postOnFinishedEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void detachAnimators() override {
|
virtual void pauseAnimators() override {
|
||||||
mRootNode->detachAnimators();
|
mRootNode->pauseAnimators();
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual void callOnFinished(BaseRenderNodeAnimator* animator, AnimationListener* listener) {
|
virtual void callOnFinished(BaseRenderNodeAnimator* animator, AnimationListener* listener) {
|
||||||
@@ -426,7 +436,7 @@ public:
|
|||||||
|
|
||||||
virtual void destroy() {
|
virtual void destroy() {
|
||||||
AnimationContext::destroy();
|
AnimationContext::destroy();
|
||||||
detachAnimators();
|
mRootNode->detachAnimators();
|
||||||
postOnFinishedEvents();
|
postOnFinishedEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ public:
|
|||||||
|
|
||||||
ANDROID_API virtual void destroy();
|
ANDROID_API virtual void destroy();
|
||||||
|
|
||||||
ANDROID_API virtual void detachAnimators() {}
|
ANDROID_API virtual void pauseAnimators() {}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class AnimationHandle;
|
friend class AnimationHandle;
|
||||||
|
|||||||
@@ -326,7 +326,7 @@ void CanvasContext::prepareTree(TreeInfo& info, int64_t* uiFrameInfo,
|
|||||||
|
|
||||||
void CanvasContext::stopDrawing() {
|
void CanvasContext::stopDrawing() {
|
||||||
mRenderThread.removeFrameCallback(this);
|
mRenderThread.removeFrameCallback(this);
|
||||||
mAnimationContext->detachAnimators();
|
mAnimationContext->pauseAnimators();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CanvasContext::notifyFramePending() {
|
void CanvasContext::notifyFramePending() {
|
||||||
|
|||||||
Reference in New Issue
Block a user