diff options
author | 2014-05-01 21:27:37 -0700 | |
---|---|---|
committer | 2014-05-02 13:43:46 -0700 | |
commit | 52244fff29042926e21fa897ef5ab11148e35299 (patch) | |
tree | 2cc7b2f6dd47fe7863c6bc2b6a806e275c149ba9 /libs/hwui/RenderNode.cpp | |
parent | abc975f539b4ea06c05b11ec56b0abe7c6fd95aa (diff) |
Add CanvasProperty for drawCircle
Change-Id: Icbcc030f5033d2094e567d7c519b9d672f2aac1c
Diffstat (limited to 'libs/hwui/RenderNode.cpp')
-rw-r--r-- | libs/hwui/RenderNode.cpp | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/libs/hwui/RenderNode.cpp b/libs/hwui/RenderNode.cpp index 7a9c18132aa6..2c29985d2937 100644 --- a/libs/hwui/RenderNode.cpp +++ b/libs/hwui/RenderNode.cpp @@ -109,7 +109,7 @@ void RenderNode::prepareTreeImpl(TreeInfo& info) { prepareSubTree(info, mDisplayListData); } -static bool is_finished(const sp<RenderPropertyAnimator>& animator) { +static bool is_finished(const sp<BaseRenderNodeAnimator>& animator) { return animator->isFinished(); } @@ -120,7 +120,7 @@ void RenderNode::pushStagingChanges(TreeInfo& info) { } if (mNeedsAnimatorsSync) { mAnimators.resize(mStagingAnimators.size()); - std::vector< sp<RenderPropertyAnimator> >::iterator it; + std::vector< sp<BaseRenderNodeAnimator> >::iterator it; // hint: this means copy_if_not() it = std::remove_copy_if(mStagingAnimators.begin(), mStagingAnimators.end(), mAnimators.begin(), is_finished); @@ -141,26 +141,22 @@ void RenderNode::pushStagingChanges(TreeInfo& info) { class AnimateFunctor { public: - AnimateFunctor(RenderProperties* target, TreeInfo& info) + AnimateFunctor(RenderNode* target, TreeInfo& info) : mTarget(target), mInfo(info) {} - bool operator() (sp<RenderPropertyAnimator>& animator) { - bool finished = animator->animate(mTarget, mInfo); - if (finished && mInfo.animationListener) { - mInfo.animationListener->onAnimationFinished(animator); - } - return finished; + bool operator() (sp<BaseRenderNodeAnimator>& animator) { + return animator->animate(mTarget, mInfo); } private: - RenderProperties* mTarget; + RenderNode* mTarget; TreeInfo& mInfo; }; void RenderNode::evaluateAnimations(TreeInfo& info) { if (!mAnimators.size()) return; - AnimateFunctor functor(&mProperties, info); - std::vector< sp<RenderPropertyAnimator> >::iterator newEnd; + AnimateFunctor functor(this, info); + std::vector< sp<BaseRenderNodeAnimator> >::iterator newEnd; newEnd = std::remove_if(mAnimators.begin(), mAnimators.end(), functor); mAnimators.erase(newEnd, mAnimators.end()); mProperties.updateMatrix(); |