surfaceflinger: refresh after latching any buffer
We should not skip refresh when a latched buffer happens to have an
empty dirty region. Also, we should signal a layer update when we
skip refresh.
Bug: 62752640
Test: manual
Change-Id: Ia603e7eeb37491c6ece7ea08d5d1e3b7ba93e6fa
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index d128a06..c10493b 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2457,7 +2457,7 @@
const Region dirty(layer->latchBuffer(visibleRegions, latchTime));
layer->useSurfaceDamage();
invalidateLayerStack(layer->getLayerStack(), dirty);
- if (!dirty.isEmpty()) {
+ if (layer->isBufferLatched()) {
newDataLatched = true;
}
}
@@ -2467,7 +2467,7 @@
// If we will need to wake up at some time in the future to deal with a
// queued frame that shouldn't be displayed during this vsync period, wake
// up during the next vsync period to check again.
- if (frameQueued && mLayersWithQueuedFrames.empty()) {
+ if (frameQueued && (mLayersWithQueuedFrames.empty() || !newDataLatched)) {
signalLayerUpdate();
}