summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/surfaceflinger/SurfaceFlinger.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 0f6c581e14..2703db8e93 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2861,10 +2861,12 @@ void SurfaceFlinger::setTransactionState(
}
}
- // If a synchronous transaction is explicitly requested without any changes,
- // force a transaction anyway. This can be used as a flush mechanism for
- // previous async transactions.
- if (transactionFlags == 0 && (flags & eSynchronous)) {
+ // If a synchronous transaction is explicitly requested without any changes, force a transaction
+ // anyway. This can be used as a flush mechanism for previous async transactions.
+ // Empty animation transaction can be used to simulate back-pressure, so also force a
+ // transaction for empty animation transactions.
+ if (transactionFlags == 0 &&
+ ((flags & eSynchronous) || (flags & eAnimation))) {
transactionFlags = eTransactionNeeded;
}
@@ -4392,7 +4394,7 @@ status_t SurfaceFlinger::captureScreenImplLocked(const sp<const DisplayDevice>&
bool secureLayerIsVisible = false;
for (const auto& layer : mDrawingState.layersSortedByZ) {
const Layer::State& state(layer->getDrawingState());
- if (layer->belongsToDisplay(hw->getLayerStack(), false) ||
+ if (!layer->belongsToDisplay(hw->getLayerStack(), false) ||
(state.z < minLayerZ || state.z > maxLayerZ)) {
continue;
}