summaryrefslogtreecommitdiff
path: root/libs/hwui/renderthread/DrawFrameTask.cpp
diff options
context:
space:
mode:
authorChris Craik <ccraik@google.com>2016-08-31 17:32:46 -0700
committerChris Craik <ccraik@google.com>2016-08-31 17:32:47 -0700
commit06e2e9cf4c3fe1eaac3271c9a346d5cc7fe5c3a8 (patch)
treed6eb5230e13665a9bba1fc7b0b5c48f01292c5c5 /libs/hwui/renderthread/DrawFrameTask.cpp
parentc6c45d225cba9ecc4521de61c3af49cc038d685a (diff)
Wait on frame work fences when frames are dropped
bug:30895941 Prevents a race where frame work could interleave between frames, causing SurfaceView position updates to be delivered out of order. Change-Id: I01e4cc557b69dcf33e877a0e16c0d115ec95e4cc
Diffstat (limited to 'libs/hwui/renderthread/DrawFrameTask.cpp')
-rw-r--r--libs/hwui/renderthread/DrawFrameTask.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/libs/hwui/renderthread/DrawFrameTask.cpp b/libs/hwui/renderthread/DrawFrameTask.cpp
index c9c07b3df292..e3b6dc6fd9fe 100644
--- a/libs/hwui/renderthread/DrawFrameTask.cpp
+++ b/libs/hwui/renderthread/DrawFrameTask.cpp
@@ -104,6 +104,9 @@ void DrawFrameTask::run() {
if (CC_LIKELY(canDrawThisFrame)) {
context->draw();
+ } else {
+ // wait on fences so tasks don't overlap next frame
+ context->waitOnFences();
}
if (!canUnblockUiThread) {