diff options
| author | 2020-07-24 19:50:31 +0000 | |
|---|---|---|
| committer | 2020-07-24 19:50:31 +0000 | |
| commit | d7dc83263b648bbe6ad2582d5e7d7a44d704c19b (patch) | |
| tree | 76db86aba853882d18d1b663d7785b2d17b11924 | |
| parent | 500500ef73cb37cd80e09802d47c9ee1bbd0bb44 (diff) | |
| parent | 7a0d224756195ce81875db0b481a77b87f860dd3 (diff) | |
Merge "fix uninitialization issue in JankTracker"
| -rw-r--r-- | libs/hwui/JankTracker.cpp | 3 | ||||
| -rw-r--r-- | libs/hwui/JankTracker.h | 2 |
2 files changed, 4 insertions, 1 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, diff --git a/libs/hwui/JankTracker.h b/libs/hwui/JankTracker.h index 4460266276f9..b3fbbfe98669 100644 --- a/libs/hwui/JankTracker.h +++ b/libs/hwui/JankTracker.h @@ -75,7 +75,7 @@ private: std::array<int64_t, NUM_BUCKETS> mThresholds; int64_t mFrameInterval; - nsecs_t mSwapDeadline; + nsecs_t mSwapDeadline = -1; // The amount of time we will erase from the total duration to account // for SF vsync offsets with HWC2 blocking dequeueBuffers. // (Vsync + mDequeueBlockTolerance) is the point at which we expect |