diff options
| author | Doris Liu <tianliu@google.com> | 2016-01-07 13:49:26 -0800 |
|---|---|---|
| committer | Doris Liu <tianliu@google.com> | 2016-02-02 15:04:01 -0800 |
| commit | f276acd98457bcaabc9e79a17a736b3b484f005e (patch) | |
| tree | b9efee10194c520b09a4813f7b8074be9a2f99c8 /core/java/android/view/RenderNode.java | |
| parent | 650e3b70e4aa2fa9acf2f9c6ce211c4b46862c15 (diff) | |
VectorDrawable native rendering - Step 4 of MANY
This CL runs VectorDrawable animation on RenderThread. The changes in this CL
include:
- Convert all the animators in AnimatorSet for AVD into a set of RenderNodeAnimators.
- Hook up the new animators with RenderThread
- Add drawOp in RecordingCanvas for drawing VD so that during the animation
on RenderThread, all the property changes on VD can be reflected on the screen.
TODO:
- Implement reverse and reset for AVD.
Change-Id: I2df1d754f2db0ad098d9c15dde4bb2bdfafc2315
Diffstat (limited to 'core/java/android/view/RenderNode.java')
| -rw-r--r-- | core/java/android/view/RenderNode.java | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/java/android/view/RenderNode.java b/core/java/android/view/RenderNode.java index 88bffb5827aa..2aace0f30139 100644 --- a/core/java/android/view/RenderNode.java +++ b/core/java/android/view/RenderNode.java @@ -22,6 +22,7 @@ import android.graphics.Matrix; import android.graphics.Outline; import android.graphics.Paint; import android.graphics.Rect; +import android.graphics.drawable.AnimatedVectorDrawable; /** * <p>A display list records a series of graphics related operations and can replay @@ -771,6 +772,14 @@ public class RenderNode { mOwningView.mAttachInfo.mViewRootImpl.registerAnimatingRenderNode(this); } + public void addAnimator(AnimatedVectorDrawable.VectorDrawableAnimator animatorSet) { + if (mOwningView == null || mOwningView.mAttachInfo == null) { + throw new IllegalStateException("Cannot start this animator on a detached view!"); + } + nAddAnimator(mNativeRenderNode, animatorSet.getAnimatorNativePtr()); + mOwningView.mAttachInfo.mViewRootImpl.registerAnimatingRenderNode(this); + } + public void endAllAnimators() { nEndAllAnimators(mNativeRenderNode); } |
