From a5dda645da738da7b4ae15e28fa7d93d3b04b94f Mon Sep 17 00:00:00 2001 From: John Reck Date: Thu, 22 May 2014 15:43:54 -0700 Subject: Bag of scheduling tweaks Bug: 15118640 * Prevent over-stuffing the queue by dropping frames * Prevent double-drawing in one pulse by RT by deferring vsync registration until post-draw so that it catches the next vsync pulse instead of the current one * Bias vsync race condition towards the UI thread * Fix queueDelay to actually work Change-Id: Ibf584258bd93ebcbba058bd976dc8b307f1c6155 --- libs/hwui/TreeInfo.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libs/hwui/TreeInfo.h') diff --git a/libs/hwui/TreeInfo.h b/libs/hwui/TreeInfo.h index d4a23b878390..8355f83ea37c 100644 --- a/libs/hwui/TreeInfo.h +++ b/libs/hwui/TreeInfo.h @@ -52,6 +52,7 @@ struct TreeInfo { : hasFunctors(false) , hasAnimations(false) , requiresUiRedraw(false) + , canDrawThisFrame(true) {} bool hasFunctors; // This is only updated if evaluateAnimations is true @@ -60,6 +61,13 @@ struct TreeInfo { // animate itself, such as if hasFunctors is true // This is only set if hasAnimations is true bool requiresUiRedraw; + // This is set to true if draw() can be called this frame + // false means that we must delay until the next vsync pulse as frame + // production is outrunning consumption + // NOTE that if this is false CanvasContext will set either requiresUiRedraw + // *OR* will post itself for the next vsync automatically, use this + // only to avoid calling draw() + bool canDrawThisFrame; } out; // TODO: Damage calculations -- cgit v1.2.3-59-g8ed1b