diff options
author | Zhiyin Luo (罗植尹) <zhiyin.luo@mediatek.com> | 2020-01-11 17:14:05 +0800 |
---|---|---|
committer | Hung-ying Tyan <tyanh@google.com> | 2020-07-27 05:46:14 +0000 |
commit | fc869035b6883bd9cfa6a83c5191405aebb426a6 (patch) | |
tree | 259982b3029f21ba8316c6eb0322a3e56964b067 /libs/hwui/JankTracker.cpp | |
parent | 95846eed9d84ec7fe51fd3272d56d8cc9c63e902 (diff) |
fix uninitialization issue in JankTracker
We should initialize mSwapDeadline in JankTracker, or it can be a very
large randomized value and then makes jank tracker not collect concrete
jank type of frames appropriately as expected.
Bug: 161656795
Test: run cts -m CtsIncidentHostTestCases -t
com.android.server.cts.GraphicsStatsValidationTest#testJankyDrawFrame
Change-Id: I057a50a74502918619204f9164f6a954f8e9c5de
Merged-In: I057a50a74502918619204f9164f6a954f8e9c5de
(cherry picked from commit 7a0d224756195ce81875db0b481a77b87f860dd3)
Diffstat (limited to 'libs/hwui/JankTracker.cpp')
-rw-r--r-- | libs/hwui/JankTracker.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libs/hwui/JankTracker.cpp b/libs/hwui/JankTracker.cpp index d25fc4b0b03e..b2c39c90071a 100644 --- a/libs/hwui/JankTracker.cpp +++ b/libs/hwui/JankTracker.cpp @@ -139,6 +139,9 @@ void JankTracker::finishFrame(const FrameInfo& frame) { (*mGlobalData)->reportJank(); } + if (mSwapDeadline < 0) { + mSwapDeadline = frame[FrameInfoIndex::IntendedVsync] + mFrameInterval; + } bool isTripleBuffered = (mSwapDeadline - frame[FrameInfoIndex::IntendedVsync]) > (mFrameInterval * 0.1); mSwapDeadline = std::max(mSwapDeadline + mFrameInterval, |