From 126720aa65fd90105bdf54c04f327f146763c5cf Mon Sep 17 00:00:00 2001 From: John Reck Date: Fri, 15 Apr 2016 15:16:38 -0700 Subject: [PATCH] Switch JankTracker to FrameInfo::duration() Fixes: 27533462 FrameInfo::duration() will remove time spent waiting in the queue from the duration. This is desired because that time is otherwise accounted for by the previous frame, so we don't want to double count it. This shows up mostly in TestSceneRunner & shadowgrid2 due to a combination of slow frame times and continous rendering. Change-Id: I27c42d5c24d266de4ada8ea00ec9164d518754f8 --- libs/hwui/JankTracker.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libs/hwui/JankTracker.cpp b/libs/hwui/JankTracker.cpp index 9d4ecccef4abd..ebe9c4240221c 100644 --- a/libs/hwui/JankTracker.cpp +++ b/libs/hwui/JankTracker.cpp @@ -212,8 +212,7 @@ void JankTracker::setFrameInterval(nsecs_t frameInterval) { void JankTracker::addFrame(const FrameInfo& frame) { mData->totalFrameCount++; // Fast-path for jank-free frames - int64_t totalDuration = - frame[FrameInfoIndex::FrameCompleted] - frame[sFrameStart]; + int64_t totalDuration = frame.duration(sFrameStart, FrameInfoIndex::FrameCompleted); uint32_t framebucket = frameCountIndexForFrameTime(totalDuration); // Keep the fast path as fast as possible. if (CC_LIKELY(totalDuration < mFrameInterval)) {