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

Commit b81abc6a authored by Chavi Weingarten's avatar Chavi Weingarten
Browse files

Call mergeWithNextTransaction in registerCallbacksForSync

In some cases, syncNextTransaction is called but not to sync a buffer
and only to get called back when draw is complete. In that scenario, the
pendingTransaction should be merged with the draw and not the SSG.
Change the code to always mergeWithNextTransaction since that will
handle both cases when buffer is synced and not.

Test: Wallpaper picker cropping
Fixes: 303006907
Change-Id: I752ba2ce314a24962e8c55d34b233b1e4961c6ef
parent a891bc20
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -11613,7 +11613,14 @@ public final class ViewRootImpl implements ViewParent,
            Log.d(mTag, "registerCallbacksForSync syncBuffer=" + syncBuffer);
        }

        surfaceSyncGroup.addTransaction(mPendingTransaction);
        final Transaction t;
        if (mHasPendingTransactions) {
            t = new Transaction();
            t.merge(mPendingTransaction);
        } else {
            t = null;
        }

        mAttachInfo.mThreadedRenderer.registerRtFrameCallback(new FrameDrawingCallback() {
            @Override
            public void onFrameDraw(long frame) {
@@ -11626,6 +11633,9 @@ public final class ViewRootImpl implements ViewParent,
                            "Received frameDrawingCallback syncResult=" + syncResult + " frameNum="
                                    + frame + ".");
                }
                if (t != null) {
                    mergeWithNextTransaction(t, frame);
                }

                // If the syncResults are SYNC_LOST_SURFACE_REWARD_IF_FOUND or
                // SYNC_CONTEXT_IS_STOPPED it means nothing will draw. There's no need to set up