Add call to disable RT Animations
HWUI already supports disabling RT animations, but there was no correct
way to call it from the application. Adding a call to enable or disable
RT animations on the RenderThread so RT animations can be disabled
during a blast sync.
Test: Builds
Bug: 200284684
Change-Id: Ia1ae3498c38b84b4975f08d37bc764f0c690ed9f
diff --git a/libs/hwui/renderthread/RenderProxy.cpp b/libs/hwui/renderthread/RenderProxy.cpp
index 026699c..b88da13 100644
--- a/libs/hwui/renderthread/RenderProxy.cpp
+++ b/libs/hwui/renderthread/RenderProxy.cpp
@@ -424,6 +424,15 @@
thread.queue().post([&thread]() { thread.preload(); });
}
+void RenderProxy::setRtAnimationsEnabled(bool enabled) {
+ if (RenderThread::hasInstance()) {
+ RenderThread::getInstance().queue().post(
+ [enabled]() { Properties::enableRTAnimations = enabled; });
+ } else {
+ Properties::enableRTAnimations = enabled;
+ }
+}
+
} /* namespace renderthread */
} /* namespace uirenderer */
} /* namespace android */