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) { void JankTracker::addFrame(const FrameInfo& frame) {
mData->totalFrameCount++; mData->totalFrameCount++;
// Fast-path for jank-free frames // Fast-path for jank-free frames
int64_t totalDuration = int64_t totalDuration = frame.duration(sFrameStart, FrameInfoIndex::FrameCompleted);
frame[FrameInfoIndex::FrameCompleted] - frame[sFrameStart];
uint32_t framebucket = frameCountIndexForFrameTime(totalDuration); uint32_t framebucket = frameCountIndexForFrameTime(totalDuration);
// Keep the fast path as fast as possible. // Keep the fast path as fast as possible.
if (CC_LIKELY(totalDuration < mFrameInterval)) { if (CC_LIKELY(totalDuration < mFrameInterval)) {