diff options
author | 2017-11-03 10:12:19 -0700 | |
---|---|---|
committer | 2017-11-03 10:57:44 -0700 | |
commit | 1bcacfdcab0eaa0cee92bd7f5a1b5e271dd68e52 (patch) | |
tree | 4a1366cf2d1cf50b5ec4ed1a8cf0f437053cd0d7 /libs/hwui/JankTracker.cpp | |
parent | 30ec71c0fe194a551d2e4abaff2159e0730488e0 (diff) |
Format the world (or just HWUI)
Test: No code changes, just ran through clang-format
Change-Id: Id23aa4ec7eebc0446fe3a30260f33e7fd455bb8c
Diffstat (limited to 'libs/hwui/JankTracker.cpp')
-rw-r--r-- | libs/hwui/JankTracker.cpp | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/libs/hwui/JankTracker.cpp b/libs/hwui/JankTracker.cpp index 9d1182819444..5b676931a620 100644 --- a/libs/hwui/JankTracker.cpp +++ b/libs/hwui/JankTracker.cpp @@ -106,25 +106,23 @@ void JankTracker::setFrameInterval(nsecs_t frameInterval) { mThresholds[kSlowUI] = static_cast<int64_t>(.5 * frameInterval); mThresholds[kSlowSync] = static_cast<int64_t>(.2 * frameInterval); mThresholds[kSlowRT] = static_cast<int64_t>(.75 * frameInterval); - } void JankTracker::finishFrame(const FrameInfo& frame) { // Fast-path for jank-free frames int64_t totalDuration = frame.duration(sFrameStart, FrameInfoIndex::FrameCompleted); - if (mDequeueTimeForgiveness - && frame[FrameInfoIndex::DequeueBufferDuration] > 500_us) { - nsecs_t expectedDequeueDuration = - mDequeueTimeForgiveness + frame[FrameInfoIndex::Vsync] - - frame[FrameInfoIndex::IssueDrawCommandsStart]; + if (mDequeueTimeForgiveness && frame[FrameInfoIndex::DequeueBufferDuration] > 500_us) { + nsecs_t expectedDequeueDuration = mDequeueTimeForgiveness + frame[FrameInfoIndex::Vsync] - + frame[FrameInfoIndex::IssueDrawCommandsStart]; if (expectedDequeueDuration > 0) { // Forgive only up to the expected amount, but not more than // the actual time spent blocked. - nsecs_t forgiveAmount = std::min(expectedDequeueDuration, - frame[FrameInfoIndex::DequeueBufferDuration]); + nsecs_t forgiveAmount = + std::min(expectedDequeueDuration, frame[FrameInfoIndex::DequeueBufferDuration]); LOG_ALWAYS_FATAL_IF(forgiveAmount >= totalDuration, - "Impossible dequeue duration! dequeue duration reported %" PRId64 - ", total duration %" PRId64, forgiveAmount, totalDuration); + "Impossible dequeue duration! dequeue duration reported %" PRId64 + ", total duration %" PRId64, + forgiveAmount, totalDuration); totalDuration -= forgiveAmount; } } @@ -148,13 +146,14 @@ void JankTracker::finishFrame(const FrameInfo& frame) { for (int i = 0; i < NUM_BUCKETS; i++) { int64_t delta = frame.duration(COMPARISONS[i].start, COMPARISONS[i].end); if (delta >= mThresholds[i] && delta < IGNORE_EXCEEDING) { - mData->reportJankType((JankType) i); - (*mGlobalData)->reportJankType((JankType) i); + mData->reportJankType((JankType)i); + (*mGlobalData)->reportJankType((JankType)i); } } } -void JankTracker::dumpData(int fd, const ProfileDataDescription* description, const ProfileData* data) { +void JankTracker::dumpData(int fd, const ProfileDataDescription* description, + const ProfileData* data) { if (description) { switch (description->type) { case JankTrackerType::Generic: @@ -199,9 +198,8 @@ void JankTracker::reset() { mFrames.clear(); mData->reset(); (*mGlobalData)->reset(); - sFrameStart = Properties::filterOutTestOverhead - ? FrameInfoIndex::HandleInputStart - : FrameInfoIndex::IntendedVsync; + sFrameStart = Properties::filterOutTestOverhead ? FrameInfoIndex::HandleInputStart + : FrameInfoIndex::IntendedVsync; } } /* namespace uirenderer */ |