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

Commit 1031e06a authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Remove more deferTransactionUntilSurface calls"

parents ebd361c2 f2f84f5f
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -9566,7 +9566,10 @@ public final class ViewRootImpl implements ViewParent,
        return mRtBLASTSyncTransaction;
    }

    SurfaceControl getRenderSurfaceControl() {
    /**
     * @hide
     */
    public SurfaceControl getRenderSurfaceControl() {
        if (mUseBLASTAdapter) {
            return mBlastSurfaceControl;
        } else {
+2 −1
Original line number Diff line number Diff line
@@ -1257,7 +1257,8 @@ public final class Magnifier {
                            return;
                        }
                        // Show or move the window at the content draw frame.
                        mTransaction.deferTransactionUntilSurface(mSurfaceControl, mSurface, frame);
                        mTransaction.deferTransactionUntil(mSurfaceControl, mSurfaceControl,
                                frame);
                        if (updateWindowPosition) {
                            mTransaction.setPosition(mSurfaceControl, pendingX, pendingY);
                        }
+6 −4
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@ import android.os.Handler.Callback;
import android.os.Message;
import android.os.Trace;
import android.view.Surface;
import android.view.SurfaceControl;
import android.view.View;
import android.view.ViewRootImpl;

@@ -39,7 +40,7 @@ public class SyncRtSurfaceTransactionApplierCompat {

    private static final int MSG_UPDATE_SEQUENCE_NUMBER = 0;

    private final Surface mTargetSurface;
    private final SurfaceControl mBarrierSurfaceControl;
    private final ViewRootImpl mTargetViewRootImpl;
    private final Handler mApplyHandler;

@@ -52,7 +53,8 @@ public class SyncRtSurfaceTransactionApplierCompat {
     */
    public SyncRtSurfaceTransactionApplierCompat(View targetView) {
        mTargetViewRootImpl = targetView != null ? targetView.getViewRootImpl() : null;
        mTargetSurface = mTargetViewRootImpl != null ? mTargetViewRootImpl.mSurface : null;
        mBarrierSurfaceControl = mTargetViewRootImpl != null
            ? mTargetViewRootImpl.getRenderSurfaceControl() : null;

        mApplyHandler = new Handler(new Callback() {
            @Override
@@ -91,7 +93,7 @@ public class SyncRtSurfaceTransactionApplierCompat {
        mTargetViewRootImpl.registerRtFrameCallback(new HardwareRenderer.FrameDrawingCallback() {
            @Override
            public void onFrameDraw(long frame) {
                if (mTargetSurface == null || !mTargetSurface.isValid()) {
                if (mBarrierSurfaceControl == null || !mBarrierSurfaceControl.isValid()) {
                    Message.obtain(mApplyHandler, MSG_UPDATE_SEQUENCE_NUMBER, toApplySeqNo, 0)
                            .sendToTarget();
                    return;
@@ -102,7 +104,7 @@ public class SyncRtSurfaceTransactionApplierCompat {
                    SyncRtSurfaceTransactionApplierCompat.SurfaceParams surfaceParams =
                            params[i];
                    SurfaceControlCompat surface = surfaceParams.surface;
                    t.deferTransactionUntil(surface, mTargetSurface, frame);
                    t.deferTransactionUntil(surface, mBarrierSurfaceControl, frame);
                    applyParams(t, surfaceParams);
                }
                t.setEarlyWakeup();
+4 −3
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.graphics.Matrix;
import android.graphics.Rect;
import android.view.Surface;
import android.view.SurfaceControl.Transaction;
import android.view.SurfaceControl;

public class TransactionCompat {

@@ -87,8 +88,8 @@ public class TransactionCompat {
    }

    public TransactionCompat deferTransactionUntil(SurfaceControlCompat surfaceControl,
            Surface barrier, long frameNumber) {
        mTransaction.deferTransactionUntilSurface(surfaceControl.mSurfaceControl, barrier,
            SurfaceControl barrier, long frameNumber) {
        mTransaction.deferTransactionUntil(surfaceControl.mSurfaceControl, barrier,
                frameNumber);
        return this;
    }