path: root/libs
diff options
authorDoris Liu <>2016-07-25 17:19:24 -0700
committerDoris Liu <>2016-07-26 00:42:56 +0000
commit7c7052dd9bbfb2d98112975f7cbd2655212bf85b (patch)
tree627df0cb7d3aae32a4997e7ca7eae0192b450894 /libs
parenteaa6d6b2c940ca4f76698cbbc5031657066065dc (diff)
Run animation *after* property sync
VectorDrawable contains properties that can be mofidied from both UI thread and RenderThread. The two sets of properties are synced during prepareTree. Previously VD animations ran before prepareTree, as a result, during prepareTree the property sync overwrote some of the animatable properties. In other words, the first frame of the animation wasn't correct. An example is in battery saver mode when the animation only has one frame to animate (0-duration), the end result looked wrong. This CL moves the VD animation to after prepareTree to solve the problem mentioned above. Meanwhile, in order to signal which VD will be animated so as to have them properly damaged, all VDs with running animators are marked dirty. Bug: 30226711 Change-Id: I831dae9abb2908876c935b9be4c11dfd09452d5c
Diffstat (limited to 'libs')
1 files changed, 1 insertions, 0 deletions
diff --git a/libs/hwui/VectorDrawable.h b/libs/hwui/VectorDrawable.h
index e67dfdd..a0c3d9d 100644
--- a/libs/hwui/VectorDrawable.h
+++ b/libs/hwui/VectorDrawable.h
@@ -678,6 +678,7 @@ public:
TreeProperties* mutateProperties() { return &mProperties; }
// This should always be called from RT.
+ void markDirty() { mCache.dirty = true; }
bool isDirty() const { return mCache.dirty; }
bool getPropertyChangeWillBeConsumed() const { return mWillBeConsumed; }
void setPropertyChangeWillBeConsumed(bool willBeConsumed) { mWillBeConsumed = willBeConsumed; }