Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d73cd35 authored by Vishnu Nair's avatar Vishnu Nair Committed by Android (Google) Code Review
Browse files

Merge "Update BBQ apply token before updating destination frame" into main

parents a8e18bc7 46347820
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -2424,9 +2424,10 @@ public abstract class WallpaperService extends Service {

            Surface ret = null;
            if (mBlastBufferQueue == null) {
                mBlastBufferQueue = new BLASTBufferQueue("Wallpaper", mBbqSurfaceControl,
                        width, height, format);
                mBlastBufferQueue = new BLASTBufferQueue("Wallpaper",
                        true /* updateDestinationFrame */);
                mBlastBufferQueue.setApplyToken(mBbqApplyToken);
                mBlastBufferQueue.update(mBbqSurfaceControl, width, height, format);
                // We only return the Surface the first time, as otherwise
                // it hasn't changed and there is no need to update.
                ret = mBlastBufferQueue.createSurface();
+5 −4
Original line number Diff line number Diff line
@@ -2759,14 +2759,15 @@ public final class ViewRootImpl implements ViewParent,
        if (mBlastBufferQueue != null) {
            mBlastBufferQueue.destroy();
        }
        mBlastBufferQueue = new BLASTBufferQueue(mTag, mSurfaceControl,
                mSurfaceSize.x, mSurfaceSize.y, mWindowAttributes.format);
        mBlastBufferQueue.setTransactionHangCallback(sTransactionHangCallback);
        mBlastBufferQueue.setWaitForBufferReleaseCallback(mChoreographer::onWaitForBufferRelease);
        mBlastBufferQueue = new BLASTBufferQueue(mTag, true /* updateDestinationFrame */);
        // If we create and destroy BBQ without recreating the SurfaceControl, we can end up
        // queuing buffers on multiple apply tokens causing out of order buffer submissions. We
        // fix this by setting the same apply token on all BBQs created by this VRI.
        mBlastBufferQueue.setApplyToken(mBbqApplyToken);
        mBlastBufferQueue.update(mSurfaceControl,  mSurfaceSize.x, mSurfaceSize.y,
                mWindowAttributes.format);
        mBlastBufferQueue.setTransactionHangCallback(sTransactionHangCallback);
        mBlastBufferQueue.setWaitForBufferReleaseCallback(mChoreographer::onWaitForBufferRelease);
        Surface blastSurface;
        if (addSchandleToVriSurface()) {
            blastSurface = mBlastBufferQueue.createSurfaceWithHandle();