From be3fba05e823f740f65b2679929347dc3dd282ad Mon Sep 17 00:00:00 2001 From: John Reck Date: Mon, 6 Jul 2015 13:49:58 -0700 Subject: Adjust for pipeline stalls Bug: 20853441 Calculating duration that crosses the UI-RT sync point will now subtract out the time spent waiting in queue under the assumption that this time will be accounted for in the previous frame's metrics Change-Id: Ia8213f4410638840613f5ae439e98dfb77532a6a --- libs/hwui/FrameInfoVisualizer.h | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'libs/hwui/FrameInfoVisualizer.h') diff --git a/libs/hwui/FrameInfoVisualizer.h b/libs/hwui/FrameInfoVisualizer.h index f1dc95419868..cf877c4d8827 100644 --- a/libs/hwui/FrameInfoVisualizer.h +++ b/libs/hwui/FrameInfoVisualizer.h @@ -59,10 +59,8 @@ private: void drawGraph(OpenGLRenderer* canvas); void drawThreshold(OpenGLRenderer* canvas); - inline float duration(size_t index, FrameInfoIndex start, FrameInfoIndex end) { - nsecs_t ns_start = mFrameSource[index][start]; - nsecs_t ns_end = mFrameSource[index][end]; - float duration = ((ns_end - ns_start) * 0.000001f); + inline float durationMS(size_t index, FrameInfoIndex start, FrameInfoIndex end) { + float duration = mFrameSource[index].duration(start, end) * 0.000001f; // Clamp to large to avoid spiking off the top of the screen duration = duration > 50.0f ? 50.0f : duration; return duration > 0.0f ? duration : 0.0f; -- cgit v1.2.3-59-g8ed1b