Call release buffer if the buffer is overwritten in the client
Clients can overwrite the buffer in a transaction before it's applied. When this happens, the buffer is then replaced, but the client doesn't get a callback that the buffer was released. This could cause the client to run out of buffers since the dropped ones become lost. This can happen in two situations: 1. Merging two transactions where each has a buffer for the same SurfaceControl 2. Transaction.setBuffer is called multiple times before an apply In both cases, call the release callback so the client can properly handle the dropped buffers. It's also possible that the merging occurs in a different process than the one that set the buffer. Because of that, we need to ensure we call the correct releaseBufferListener that's associated with the one that set the buffer. The transformHint is removed from the releaseCallback since it's already provided in the transaction callback. It was originally added in the release callback to give it to BBQ early so it can know the new transform hint before rendering a new frame. However, the transform hint is now provided by VRI to BBQ so it no longer needs to be sent back via release callback. Test: ReleaseBufferCallbackTest Change-Id: I9df0c713bf841f53e1a3d092f33179573a680dc4 Bug: 200285149
Loading
Please register or sign in to comment