summaryrefslogtreecommitdiff
path: root/libs/hwui/JankTracker.cpp
diff options
context:
space:
mode:
authorGao Shuo <shuo.gao@intel.com>2019-05-27 14:14:57 +0800
committerGao Shuo <shuo.gao@intel.com>2019-05-27 14:14:57 +0800
commit7e05ff35fa4d82f92eb6bf6c325412fac9e9729c (patch)
tree57da38f9e14a934709c1a2c0d27cbb0868cec2ae /libs/hwui/JankTracker.cpp
parent7a5b9c2d0ace03626174705f72dca5f2019e4697 (diff)
Avoid fake high input latency while vsync drifting
Usually isTrippleBuffered should be true when mSwapDeadline bigger than IntendedVsync. However, vsync could be drifting on some platforms, which make isTrippleBuffered to be true and report a fake high input latency. So add a small threshold to avoid this case. Test: Manually Change-Id: Ib6ff1046cfb94f89f4985361b84ad2d34850f783 Signed-off-by: Gao Shuo <shuo.gao@intel.com> Signed-off-by: Wu Zhongmin <zhongmin.wu@intel.com> Signed-off-by: Zhu Tingting <tingting.zhu@intel.com>
Diffstat (limited to 'libs/hwui/JankTracker.cpp')
-rw-r--r--libs/hwui/JankTracker.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/libs/hwui/JankTracker.cpp b/libs/hwui/JankTracker.cpp
index 39ed9a0478b6..2016b5e914cd 100644
--- a/libs/hwui/JankTracker.cpp
+++ b/libs/hwui/JankTracker.cpp
@@ -138,7 +138,7 @@ void JankTracker::finishFrame(const FrameInfo& frame) {
(*mGlobalData)->reportJank();
}
- bool isTripleBuffered = mSwapDeadline > frame[FrameInfoIndex::IntendedVsync];
+ bool isTripleBuffered = (mSwapDeadline - frame[FrameInfoIndex::IntendedVsync]) > (mFrameInterval * 0.1);
mSwapDeadline = std::max(mSwapDeadline + mFrameInterval,
frame[FrameInfoIndex::IntendedVsync] + mFrameInterval);