Merge "Switch JankTracker to FrameInfo::duration()" into nyc-dev

This commit is contained in:
John Reck
2016-04-15 23:47:00 +00:00
committed by Android (Google) Code Review

View File

@@ -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)) {