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

Commit b6a5575a authored by Rob Carr's avatar Rob Carr Committed by Android (Google) Code Review
Browse files

Merge "Replace deferTransactionUntilSurface with deferTransactionUntil"

parents 4cdb7614 cef9a28a
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2551,6 +2551,7 @@ public final class SurfaceControl implements Parcelable {
        /**
         * @hide
         */
        @Deprecated
        @UnsupportedAppUsage
        public Transaction deferTransactionUntilSurface(SurfaceControl sc, Surface barrierSurface,
                long frameNumber) {
+5 −4
Original line number Diff line number Diff line
@@ -414,7 +414,8 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
                            }
                            t.setAlpha(mSurfaceControl, alpha);
                            if (!useBLAST) {
                                t.deferTransactionUntilSurface(mSurfaceControl, parent, frame);
                                t.deferTransactionUntil(mSurfaceControl,
                                        viewRoot.getRenderSurfaceControl(), frame);
                            }
                        }
                        // It's possible that mSurfaceControl is released in the UI thread before
@@ -1122,7 +1123,7 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall
        if (frameNumber > 0 && !WindowManagerGlobal.USE_BLAST_ADAPTER) {
            final ViewRootImpl viewRoot = getViewRootImpl();

            t.deferTransactionUntilSurface(surface, viewRoot.mSurface,
            t.deferTransactionUntil(surface, viewRoot.getRenderSurfaceControl(),
                    frameNumber);
        }

@@ -1217,8 +1218,8 @@ public class SurfaceView extends View implements ViewRootImpl.SurfaceChangedCall

            if (frameNumber > 0 && viewRoot !=  null && !useBLAST) {
                if (viewRoot.mSurface.isValid()) {
                    mRtTransaction.deferTransactionUntilSurface(mSurfaceControl, viewRoot.mSurface,
                            frameNumber);
                    mRtTransaction.deferTransactionUntil(mSurfaceControl,
                            viewRoot.getRenderSurfaceControl(), frameNumber);
                }
            }
            t.hide(mSurfaceControl);
+4 −4
Original line number Diff line number Diff line
@@ -38,7 +38,7 @@ public class SyncRtSurfaceTransactionApplier {
    public static final int FLAG_CORNER_RADIUS = 1 << 4;
    public static final int FLAG_VISIBILITY = 1 << 5;

    private final Surface mTargetSurface;
    private SurfaceControl mTargetSc;
    private final ViewRootImpl mTargetViewRootImpl;
    private final float[] mTmpFloat9 = new float[9];

@@ -47,7 +47,6 @@ public class SyncRtSurfaceTransactionApplier {
     */
    public SyncRtSurfaceTransactionApplier(View targetView) {
        mTargetViewRootImpl = targetView != null ? targetView.getViewRootImpl() : null;
        mTargetSurface = mTargetViewRootImpl != null ? mTargetViewRootImpl.mSurface : null;
    }

    /**
@@ -60,15 +59,16 @@ public class SyncRtSurfaceTransactionApplier {
        if (mTargetViewRootImpl == null) {
            return;
        }
        mTargetSc = mTargetViewRootImpl.getRenderSurfaceControl();
        mTargetViewRootImpl.registerRtFrameCallback(frame -> {
            if (mTargetSurface == null || !mTargetSurface.isValid()) {
            if (mTargetSc == null || !mTargetSc.isValid()) {
                return;
            }
            Transaction t = new Transaction();
            for (int i = params.length - 1; i >= 0; i--) {
                SurfaceParams surfaceParams = params[i];
                SurfaceControl surface = surfaceParams.surface;
                t.deferTransactionUntilSurface(surface, mTargetSurface, frame);
                t.deferTransactionUntil(surface, mTargetSc, frame);
                applyParams(t, surfaceParams, mTmpFloat9);
            }
            t.setEarlyWakeup();
+10 −2
Original line number Diff line number Diff line
@@ -1733,8 +1733,8 @@ public final class ViewRootImpl implements ViewParent,
    private void updateBoundsLayer() {
        if (mBoundsLayer != null) {
            setBoundsLayerCrop();
            mTransaction.deferTransactionUntilSurface(mBoundsLayer,
                    mSurface, mSurface.getNextFrameNumber())
            mTransaction.deferTransactionUntil(mBoundsLayer,
                    getRenderSurfaceControl(), mSurface.getNextFrameNumber())
                    .apply();
        }
    }
@@ -9539,4 +9539,12 @@ public final class ViewRootImpl implements ViewParent,
    SurfaceControl.Transaction getBLASTSyncTransaction() {
        return mRtBLASTSyncTransaction;
    }

    SurfaceControl getRenderSurfaceControl() {
        if (WindowManagerGlobal.USE_BLAST_ADAPTER) {
            return mBlastSurfaceControl;
        } else {
            return mSurfaceControl;
        }
    }
}