summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Ady Abraham <adyabr@google.com> 2021-03-10 16:05:16 -0800
committer Ady Abraham <adyabr@google.com> 2021-03-15 18:10:28 +0000
commitd1b485397f4cd538e6ec29cb449f90051a84eaec (patch)
treef575e879b18ecad1b12a131e72aba6c460124f64
parent9e49451732117c5a9fde142b4cb571f50eb79662 (diff)
SurfaceFlinger: run refresh directly after invalidate
Run the refresh immediately after invalidate as there is no point going thru the message queue again, and to ensure that we actually refresh the screen instead of handling other messages that were queued us already n the MessageQueue. Bug: 182214053 Test: SF unit tests Test: Launch an app and observe syatraces Change-Id: Iff647415d46c4b155b20b60b9e7cc07253339100
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 727386c859..4931bc1544 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -1879,7 +1879,12 @@ void SurfaceFlinger::onMessageInvalidate(int64_t vsyncId, nsecs_t expectedVSyncT
// underestimated.
mFrameStartTime = frameStart;
}
- signalRefresh();
+
+ // Run the refresh immediately after invalidate as there is no point going thru the message
+ // queue again, and to ensure that we actually refresh the screen instead of handling
+ // other messages that were queued us already in the MessageQueue.
+ mRefreshPending = true;
+ onMessageRefresh();
}
}