summaryrefslogtreecommitdiff
path: root/libs/hwui/JankTracker.cpp
diff options
context:
space:
mode:
author Aaron Whyte <awhyte@google.com> 2018-03-19 17:46:54 +0000
committer Aaron Whyte <awhyte@google.com> 2018-03-19 17:53:48 +0000
commita6d8fbf4ea634f5f605b2b7db3ca98975f8625b5 (patch)
tree8feddabd8b5461638c0cc7d0cfe99c62c9e76018 /libs/hwui/JankTracker.cpp
parent09979fbee7201b46158c2c033194529e4284ea13 (diff)
Revert "Break down jank between frame drops vs. triple buffered"
This reverts commit 09979fbee7201b46158c2c033194529e4284ea13. Reason for revert: Based on stacktraces and change history, I think this is causing a cluster of P crashes. https://b.corp.google.com/issues?q=(%22android%22%20%22:uirenderer::JankTracker::finishFrame%22) Bug: 75566601 Bug: 75811585 Bug: 75407175 Bug: 75736222 Bug: 75391447 Bug: 75659839 Change-Id: I59a8c2d8906d347210c77fb3628f5801bc299bfb
Diffstat (limited to 'libs/hwui/JankTracker.cpp')
-rw-r--r--libs/hwui/JankTracker.cpp32
1 files changed, 6 insertions, 26 deletions
diff --git a/libs/hwui/JankTracker.cpp b/libs/hwui/JankTracker.cpp
index 8110664ad44b..cf29e434a351 100644
--- a/libs/hwui/JankTracker.cpp
+++ b/libs/hwui/JankTracker.cpp
@@ -129,42 +129,22 @@ void JankTracker::finishFrame(const FrameInfo& frame) {
totalDuration -= forgiveAmount;
}
}
-
LOG_ALWAYS_FATAL_IF(totalDuration <= 0, "Impossible totalDuration %" PRId64, totalDuration);
mData->reportFrame(totalDuration);
(*mGlobalData)->reportFrame(totalDuration);
- // Only things like Surface.lockHardwareCanvas() are exempt from tracking
- if (CC_UNLIKELY(frame[FrameInfoIndex::Flags] & EXEMPT_FRAMES_FLAGS)) {
+ // Keep the fast path as fast as possible.
+ if (CC_LIKELY(totalDuration < mFrameInterval)) {
return;
}
- if (totalDuration > mFrameInterval) {
- mData->reportJank();
- (*mGlobalData)->reportJank();
- }
-
- bool isTripleBuffered = mSwapDeadline > frame[FrameInfoIndex::IntendedVsync];
-
- mSwapDeadline = std::max(mSwapDeadline + mFrameInterval,
- frame[FrameInfoIndex::IntendedVsync] + mFrameInterval);
-
- // If we hit the deadline, cool!
- if (frame[FrameInfoIndex::FrameCompleted] < mSwapDeadline) {
- if (isTripleBuffered) {
- mData->reportJankType(JankType::kHighInputLatency);
- (*mGlobalData)->reportJankType(JankType::kHighInputLatency);
- }
+ // Only things like Surface.lockHardwareCanvas() are exempt from tracking
+ if (frame[FrameInfoIndex::Flags] & EXEMPT_FRAMES_FLAGS) {
return;
}
- mData->reportJankType(JankType::kMissedDeadline);
- (*mGlobalData)->reportJankType(JankType::kMissedDeadline);
-
- // Janked, reset the swap deadline
- nsecs_t jitterNanos = frame[FrameInfoIndex::FrameCompleted] - frame[FrameInfoIndex::Vsync];
- nsecs_t lastFrameOffset = jitterNanos % mFrameInterval;
- mSwapDeadline = frame[FrameInfoIndex::FrameCompleted] - lastFrameOffset + mFrameInterval;
+ mData->reportJank();
+ (*mGlobalData)->reportJank();
for (int i = 0; i < NUM_BUCKETS; i++) {
int64_t delta = frame.duration(COMPARISONS[i].start, COMPARISONS[i].end);