Add RT-enabled reveal animator
Bug: 16161431
Also re-writes RevealAnimator to avoid using any listeners internally,
removing the logic around shadowing the update listeners.
Change-Id: I6ed8126398eed971a87f20bccb7584c9acafbb6c
diff --git a/libs/hwui/Animator.cpp b/libs/hwui/Animator.cpp
index d35dce9..24ed6cd 100644
--- a/libs/hwui/Animator.cpp
+++ b/libs/hwui/Animator.cpp
@@ -288,5 +288,23 @@
LOG_ALWAYS_FATAL("Unknown field %d", (int) mField);
}
+RevealAnimator::RevealAnimator(int centerX, int centerY, bool inverseClip,
+ float startValue, float finalValue)
+ : BaseRenderNodeAnimator(finalValue)
+ , mCenterX(centerX)
+ , mCenterY(centerY)
+ , mInverseClip(inverseClip) {
+ setStartValue(startValue);
+}
+
+float RevealAnimator::getValue(RenderNode* target) const {
+ return target->properties().getRevealClip().radius();
+}
+
+void RevealAnimator::setValue(RenderNode* target, float value) {
+ target->animatorProperties().mutableRevealClip().set(true, mInverseClip,
+ mCenterX, mCenterY, value);
+}
+
} /* namespace uirenderer */
} /* namespace android */