summaryrefslogtreecommitdiff
path: root/services/surfaceflinger/Layer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
-rw-r--r--services/surfaceflinger/Layer.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp
index b45f2bcd92..cf215adba2 100644
--- a/services/surfaceflinger/Layer.cpp
+++ b/services/surfaceflinger/Layer.cpp
@@ -880,7 +880,7 @@ uint32_t Layer::doTransaction(uint32_t flags) {
}
// Allow BufferStateLayer to release any unlatched buffers in drawing state.
- bufferMayChange(c.buffer);
+ bufferMayChange(c.buffer->getBuffer());
// Commit the transaction
commitTransaction(c);
@@ -891,7 +891,11 @@ uint32_t Layer::doTransaction(uint32_t flags) {
void Layer::commitTransaction(State& stateToCommit) {
if (auto& bufferSurfaceFrame = mDrawingState.bufferSurfaceFrameTX;
- mDrawingState.buffer != stateToCommit.buffer && bufferSurfaceFrame != nullptr &&
+ ((mDrawingState.buffer && stateToCommit.buffer &&
+ mDrawingState.buffer->getBuffer() != stateToCommit.buffer->getBuffer()) ||
+ (mDrawingState.buffer && !stateToCommit.buffer) ||
+ (!mDrawingState.buffer && stateToCommit.buffer)) &&
+ bufferSurfaceFrame != nullptr &&
bufferSurfaceFrame->getPresentState() != PresentState::Presented) {
// If the previous buffer was committed but not latched (refreshPending - happens during
// back to back invalidates), it gets silently dropped here. Mark the corresponding