From cd8994f492cfc789d7609d3e199099528f73ba78 Mon Sep 17 00:00:00 2001 From: Jiang Tian Date: Fri, 3 Dec 2021 18:18:16 +0800 Subject: [PATCH] Fix full draw power usage increase issue Full draw will be happened on HWUI under 90/120Hz device,there are more draw commands under renderFrameImpl than in the 60Hz fps device, frame.bufferAge() > (int)mSwapHistory.size() resulting in an increase in power usage. So need to increase (int)mSwapHistory.size() to 8, set mSwapHistory add to 7. Bug: 209371516 Test: Manual Change-Id: Ic6f21e7b9dc5e7c8f36d03c57b01fa7210cff86f --- libs/hwui/renderthread/CanvasContext.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libs/hwui/renderthread/CanvasContext.h b/libs/hwui/renderthread/CanvasContext.h index 0caf76a26539..951ee216ce35 100644 --- a/libs/hwui/renderthread/CanvasContext.h +++ b/libs/hwui/renderthread/CanvasContext.h @@ -279,8 +279,8 @@ private: nsecs_t queueDuration; }; - // Need at least 4 because we do quad buffer. Add a 5th for good measure. - RingBuffer mSwapHistory; + // Need at least 4 because we do quad buffer. Add a few more for good measure. + RingBuffer mSwapHistory; // Frame numbers start at 1, 0 means uninitialized uint64_t mFrameNumber = 0; int64_t mDamageId = 0;