diff options
Diffstat (limited to 'services/surfaceflinger/Layer.cpp')
-rw-r--r-- | services/surfaceflinger/Layer.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/services/surfaceflinger/Layer.cpp b/services/surfaceflinger/Layer.cpp index 829b91676b..b12e3fb626 100644 --- a/services/surfaceflinger/Layer.cpp +++ b/services/surfaceflinger/Layer.cpp @@ -1050,7 +1050,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); @@ -1062,7 +1062,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 |