From 2614bd225f84f7a23e6b30fc6b47bede153e5f4c Mon Sep 17 00:00:00 2001 From: John Reck Date: Thu, 19 Feb 2015 14:36:50 -0800 Subject: DO NOT MERGE Backport of limited jank-tracking metrics Bug: 19821830 Cherry-pick of ba6adf66d3c44c0aa2fd8a224862ff1901d64300 Cherry-pick of e70c5754d01f2ab0ff47ea3eabaa88aca5ed2a36 Change-Id: Id342fa0ab345f204bec58acf45ce72f6de950cfb --- libs/hwui/renderthread/RenderThread.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'libs/hwui/renderthread/RenderThread.cpp') diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp index 84826b7..7a8c3ce 100644 --- a/libs/hwui/renderthread/RenderThread.cpp +++ b/libs/hwui/renderthread/RenderThread.cpp @@ -143,7 +143,8 @@ RenderThread::RenderThread() : Thread(true), Singleton() , mFrameCallbackTaskPending(false) , mFrameCallbackTask(0) , mRenderState(NULL) - , mEglManager(NULL) { + , mEglManager(NULL) + , mJankTracker(NULL) { mFrameCallbackTask = new DispatchFrameCallbacks(this); mLooper = new Looper(false); run("RenderThread"); @@ -153,6 +154,11 @@ RenderThread::~RenderThread() { LOG_ALWAYS_FATAL("Can't destroy the render thread"); } +void RenderThread::setFrameInterval(nsecs_t frameInterval) { + mTimeLord.setFrameInterval(frameInterval); + mJankTracker->setFrameInterval(frameInterval); +} + void RenderThread::initializeDisplayEventReceiver() { LOG_ALWAYS_FATAL_IF(mDisplayEventReceiver, "Initializing a second DisplayEventReceiver?"); mDisplayEventReceiver = new DisplayEventReceiver(); @@ -169,6 +175,7 @@ void RenderThread::initThreadLocals() { initializeDisplayEventReceiver(); mEglManager = new EglManager(*this); mRenderState = new RenderState(*this); + mJankTracker = new JankTracker(mTimeLord.frameIntervalNanos()); } int RenderThread::displayEventReceiverCallback(int fd, int events, void* data) { -- cgit v1.1