From 501ff9acfe9dd656c1fb6d82ec0533c3244fd88b Mon Sep 17 00:00:00 2001 From: John Reck Date: Fri, 17 Jun 2016 12:57:12 -0700 Subject: Avoid re-calculating vsync mid-frame Fixes: 29072773 By using computeFrameTime AnimationContext would potentially end up modifying the latest vsync if a very-slow frame was received from the UI thread. This could potentially desync animations that were RT & UI thread 'synchronized', but more significantly it would confuse the swap chain which tries to only draw one frame per vsync causing unneccessary frame drops. Change-Id: Ibd2ec3157ce32fee1eec8d56837c45a35e622895 --- libs/hwui/AnimationContext.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libs/hwui/AnimationContext.cpp') diff --git a/libs/hwui/AnimationContext.cpp b/libs/hwui/AnimationContext.cpp index 097be08faaad..5759ccd85464 100644 --- a/libs/hwui/AnimationContext.cpp +++ b/libs/hwui/AnimationContext.cpp @@ -63,7 +63,7 @@ void AnimationContext::startFrame(TreeInfo::TraversalMode mode) { mCurrentFrameAnimations.mNextHandle = head; head->mPreviousHandle = &mCurrentFrameAnimations; } - mFrameTimeMs = mClock.computeFrameTimeMs(); + mFrameTimeMs = ns2ms(mClock.latestVsync()); } void AnimationContext::runRemainingAnimations(TreeInfo& info) { -- cgit v1.2.3-59-g8ed1b