Skip sending HWUI hints when frame does not draw
Sending HWUI ADPF CPU hints when the frame is not drawn can undercount
the actual workload duration and lead to inadequate boosting. This
patch prevents this by not sending hints when the frame is not drawn.
Bug: b/239677101
Test: manual
Change-Id: Ia308f59740c83977df02dff6d9f9289f2b8d439e
diff --git a/libs/hwui/renderthread/CanvasContext.h b/libs/hwui/renderthread/CanvasContext.h
index 748ab96..db96cfb 100644
--- a/libs/hwui/renderthread/CanvasContext.h
+++ b/libs/hwui/renderthread/CanvasContext.h
@@ -138,7 +138,7 @@
bool makeCurrent();
void prepareTree(TreeInfo& info, int64_t* uiFrameInfo, int64_t syncQueued, RenderNode* target);
// Returns the DequeueBufferDuration.
- nsecs_t draw();
+ std::optional<nsecs_t> draw();
void destroy();
// IFrameCallback, Choreographer-driven frame callback entry point