diff options
author | John Reck <jreck@google.com> | 2019-03-15 16:36:01 -0700 |
---|---|---|
committer | John Reck <jreck@google.com> | 2019-03-15 16:49:25 -0700 |
commit | 3c0f563786e23ea97f46e5f6d74023d27d3f764b (patch) | |
tree | b668fab7f2ba5a12b27e465de1e6aaef377e70f5 /libs/hwui/renderthread/RenderThread.cpp | |
parent | 59a599c1d34e0d70171672b6fa6bc52b81be3508 (diff) |
Fix profile gpu bars to use display fps
Also adds a 'good' bar at 80% threshold
and a 'bad' bar at 150% threshold (where triple
buffering would start to get iffy)
Fixes: 127371028
Test: eyeball'd it
Change-Id: I109cd293f87f8cb9c8f1e66d49fb8fb2188b0bec
Diffstat (limited to 'libs/hwui/renderthread/RenderThread.cpp')
-rw-r--r-- | libs/hwui/renderthread/RenderThread.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/libs/hwui/renderthread/RenderThread.cpp b/libs/hwui/renderthread/RenderThread.cpp index 08edd20c0a0d..c784d64f820c 100644 --- a/libs/hwui/renderthread/RenderThread.cpp +++ b/libs/hwui/renderthread/RenderThread.cpp @@ -52,9 +52,6 @@ namespace renderthread { // using just a few large reads. static const size_t EVENT_BUFFER_SIZE = 100; -// Slight delay to give the UI time to push us a new frame before we replay -static const nsecs_t DISPATCH_FRAME_CALLBACKS_DELAY = milliseconds_to_nanoseconds(4); - static bool gHasRenderThreadInstance = false; static JVMAttachHook gOnStartHook = nullptr; @@ -171,6 +168,7 @@ void RenderThread::initThreadLocals() { mDisplayInfo = DeviceInfo::get()->displayInfo(); nsecs_t frameIntervalNanos = static_cast<nsecs_t>(1000000000 / mDisplayInfo.fps); mTimeLord.setFrameInterval(frameIntervalNanos); + mDispatchFrameDelay = static_cast<nsecs_t>(frameIntervalNanos * .25f); initializeDisplayEventReceiver(); mEglManager = new EglManager(); mRenderState = new RenderState(*this); @@ -311,7 +309,7 @@ void RenderThread::drainDisplayEventQueue() { if (mTimeLord.vsyncReceived(vsyncEvent) && !mFrameCallbackTaskPending) { ATRACE_NAME("queue mFrameCallbackTask"); mFrameCallbackTaskPending = true; - nsecs_t runAt = (vsyncEvent + DISPATCH_FRAME_CALLBACKS_DELAY); + nsecs_t runAt = (vsyncEvent + mDispatchFrameDelay); queue().postAt(runAt, [this]() { dispatchFrameCallbacks(); }); } } |