summaryrefslogtreecommitdiff
path: root/libs/hwui/PropertyValuesHolder.cpp
diff options
context:
space:
mode:
author Doris Liu <tianliu@google.com> 2016-03-02 15:16:28 -0800
committer Doris Liu <tianliu@google.com> 2016-04-04 14:40:17 -0700
commit1d8e194661085f9a18ab1b3cd12f9e19d3a86be5 (patch)
treeb48053c21a27e6a8500b45f4cc8bf4a2b0c6676f /libs/hwui/PropertyValuesHolder.cpp
parent3942978af2314801379e807a3a913841c1f1481c (diff)
Make AVD thread safe
This CL introduces staging properties to VectorDrawable, which holds properties coming from UI thread. When staging properties are changed, they are marked dirty, and the staging properties then get pushed to RenderThread at sync point. In cases where no staging property has been changed, at sync point we sync the render thread properties back to staging properties to reflect the latest render thread animation value change. Also, update Vector Drawable bitmap only when it's dirty Bug: 27343970 Bug: 27385912 Bug: 27263667 Bug: 27927674 Bug: 27774383 Change-Id: Ia864f5400a53a08dbfb284fae581fb1aac4fff87
Diffstat (limited to 'libs/hwui/PropertyValuesHolder.cpp')
-rw-r--r--libs/hwui/PropertyValuesHolder.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/libs/hwui/PropertyValuesHolder.cpp b/libs/hwui/PropertyValuesHolder.cpp
index 8f837f6048d6..0932d653fd5e 100644
--- a/libs/hwui/PropertyValuesHolder.cpp
+++ b/libs/hwui/PropertyValuesHolder.cpp
@@ -53,7 +53,7 @@ void GroupPropertyValuesHolder::setFraction(float fraction) {
} else {
animatedValue = mStartValue * (1 - fraction) + mEndValue * fraction;
}
- mGroup->setPropertyValue(mPropertyId, animatedValue);
+ mGroup->mutateProperties()->setPropertyValue(mPropertyId, animatedValue);
}
inline U8CPU lerp(U8CPU fromValue, U8CPU toValue, float fraction) {
@@ -72,7 +72,7 @@ SkColor FullPathColorPropertyValuesHolder::interpolateColors(SkColor fromColor,
void FullPathColorPropertyValuesHolder::setFraction(float fraction) {
SkColor animatedValue = interpolateColors(mStartValue, mEndValue, fraction);
- mFullPath->setColorPropertyValue(mPropertyId, animatedValue);
+ mFullPath->mutateProperties()->setColorPropertyValue(mPropertyId, animatedValue);
}
void FullPathPropertyValuesHolder::setFraction(float fraction) {
@@ -82,17 +82,17 @@ void FullPathPropertyValuesHolder::setFraction(float fraction) {
} else {
animatedValue = mStartValue * (1 - fraction) + mEndValue * fraction;
}
- mFullPath->setPropertyValue(mPropertyId, animatedValue);
+ mFullPath->mutateProperties()->setPropertyValue(mPropertyId, animatedValue);
}
void PathDataPropertyValuesHolder::setFraction(float fraction) {
VectorDrawableUtils::interpolatePaths(&mPathData, mStartValue, mEndValue, fraction);
- mPath->setPathData(mPathData);
+ mPath->mutateProperties()->setData(mPathData);
}
void RootAlphaPropertyValuesHolder::setFraction(float fraction) {
float animatedValue = mStartValue * (1 - fraction) + mEndValue * fraction;
- mTree->setRootAlpha(animatedValue);
+ mTree->mutateProperties()->setRootAlpha(animatedValue);
}
} // namepace uirenderer