Search in sources :

Example 1 with Transaction

use of android.view.SurfaceControl.Transaction in project android_packages_apps_Trebuchet by LineageOS.

the class SurfaceTransactionApplier method scheduleApply.

/**
 * Schedules applying surface parameters on the next frame.
 *
 * @param params The surface parameters to apply. DO NOT MODIFY the list after passing into
 *               this method to avoid synchronization issues.
 */
public void scheduleApply(final SurfaceParams... params) {
    View view = mTargetViewRootImpl.getView();
    if (view == null) {
        return;
    }
    mLastSequenceNumber++;
    final int toApplySeqNo = mLastSequenceNumber;
    setCanRelease(false);
    mTargetViewRootImpl.registerRtFrameCallback(frame -> {
        if (mBarrierSurfaceControl == null || !mBarrierSurfaceControl.isValid()) {
            Message.obtain(mApplyHandler, MSG_UPDATE_SEQUENCE_NUMBER, toApplySeqNo, 0).sendToTarget();
            return;
        }
        Transaction t = new Transaction();
        for (int i = params.length - 1; i >= 0; i--) {
            SurfaceParams surfaceParams = params[i];
            if (surfaceParams.surface.isValid()) {
                deferTransactionUntil(t, surfaceParams.surface, mBarrierSurfaceControl, frame);
                surfaceParams.applyTo(t);
            }
        }
        t.apply();
        Message.obtain(mApplyHandler, MSG_UPDATE_SEQUENCE_NUMBER, toApplySeqNo, 0).sendToTarget();
    });
    // Make sure a frame gets scheduled.
    view.invalidate();
}
Also used : Transaction(android.view.SurfaceControl.Transaction) View(android.view.View) SurfaceParams(com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat.SurfaceParams)

Example 2 with Transaction

use of android.view.SurfaceControl.Transaction in project android_packages_apps_Launcher3 by ArrowOS.

the class SurfaceTransactionApplier method scheduleApply.

/**
 * Schedules applying surface parameters on the next frame.
 *
 * @param params The surface parameters to apply. DO NOT MODIFY the list after passing into
 *               this method to avoid synchronization issues.
 */
public void scheduleApply(final SurfaceParams... params) {
    View view = mTargetViewRootImpl.getView();
    if (view == null) {
        return;
    }
    mLastSequenceNumber++;
    final int toApplySeqNo = mLastSequenceNumber;
    setCanRelease(false);
    mTargetViewRootImpl.registerRtFrameCallback(frame -> {
        if (mBarrierSurfaceControl == null || !mBarrierSurfaceControl.isValid()) {
            Message.obtain(mApplyHandler, MSG_UPDATE_SEQUENCE_NUMBER, toApplySeqNo, 0).sendToTarget();
            return;
        }
        Transaction t = new Transaction();
        for (int i = params.length - 1; i >= 0; i--) {
            SurfaceParams surfaceParams = params[i];
            if (surfaceParams.surface.isValid()) {
                surfaceParams.applyTo(t);
            }
        }
        mTargetViewRootImpl.mergeWithNextTransaction(t, frame);
        Message.obtain(mApplyHandler, MSG_UPDATE_SEQUENCE_NUMBER, toApplySeqNo, 0).sendToTarget();
    });
    // Make sure a frame gets scheduled.
    view.invalidate();
}
Also used : Transaction(android.view.SurfaceControl.Transaction) View(android.view.View) SurfaceParams(com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat.SurfaceParams)

Example 3 with Transaction

use of android.view.SurfaceControl.Transaction in project android_packages_apps_404Launcher by P-404.

the class SurfaceTransactionApplier method scheduleApply.

/**
 * Schedules applying surface parameters on the next frame.
 *
 * @param params The surface parameters to apply. DO NOT MODIFY the list after passing into
 *               this method to avoid synchronization issues.
 */
public void scheduleApply(final SurfaceParams... params) {
    View view = mTargetViewRootImpl.getView();
    if (view == null) {
        return;
    }
    mLastSequenceNumber++;
    final int toApplySeqNo = mLastSequenceNumber;
    setCanRelease(false);
    mTargetViewRootImpl.registerRtFrameCallback(frame -> {
        if (mBarrierSurfaceControl == null || !mBarrierSurfaceControl.isValid()) {
            Message.obtain(mApplyHandler, MSG_UPDATE_SEQUENCE_NUMBER, toApplySeqNo, 0).sendToTarget();
            return;
        }
        Transaction t = new Transaction();
        for (int i = params.length - 1; i >= 0; i--) {
            SurfaceParams surfaceParams = params[i];
            if (surfaceParams.surface.isValid()) {
                surfaceParams.applyTo(t);
            }
        }
        mTargetViewRootImpl.mergeWithNextTransaction(t, frame);
        Message.obtain(mApplyHandler, MSG_UPDATE_SEQUENCE_NUMBER, toApplySeqNo, 0).sendToTarget();
    });
    // Make sure a frame gets scheduled.
    view.invalidate();
}
Also used : Transaction(android.view.SurfaceControl.Transaction) View(android.view.View) SurfaceParams(com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat.SurfaceParams)

Example 4 with Transaction

use of android.view.SurfaceControl.Transaction in project android_packages_apps_Launcher3 by crdroidandroid.

the class SurfaceTransactionApplier method scheduleApply.

/**
 * Schedules applying surface parameters on the next frame.
 *
 * @param params The surface parameters to apply. DO NOT MODIFY the list after passing into
 *               this method to avoid synchronization issues.
 */
public void scheduleApply(final SurfaceParams... params) {
    View view = mTargetViewRootImpl.getView();
    if (view == null) {
        return;
    }
    mLastSequenceNumber++;
    final int toApplySeqNo = mLastSequenceNumber;
    setCanRelease(false);
    mTargetViewRootImpl.registerRtFrameCallback(frame -> {
        if (mBarrierSurfaceControl == null || !mBarrierSurfaceControl.isValid()) {
            Message.obtain(mApplyHandler, MSG_UPDATE_SEQUENCE_NUMBER, toApplySeqNo, 0).sendToTarget();
            return;
        }
        Transaction t = new Transaction();
        for (int i = params.length - 1; i >= 0; i--) {
            SurfaceParams surfaceParams = params[i];
            if (surfaceParams.surface.isValid()) {
                surfaceParams.applyTo(t);
            }
        }
        mTargetViewRootImpl.mergeWithNextTransaction(t, frame);
        Message.obtain(mApplyHandler, MSG_UPDATE_SEQUENCE_NUMBER, toApplySeqNo, 0).sendToTarget();
    });
    // Make sure a frame gets scheduled.
    view.invalidate();
}
Also used : Transaction(android.view.SurfaceControl.Transaction) View(android.view.View) SurfaceParams(com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat.SurfaceParams)

Example 5 with Transaction

use of android.view.SurfaceControl.Transaction in project android_packages_apps_Launcher3 by ProtonAOSP.

the class SurfaceTransactionApplier method scheduleApply.

/**
 * Schedules applying surface parameters on the next frame.
 *
 * @param params The surface parameters to apply. DO NOT MODIFY the list after passing into
 *               this method to avoid synchronization issues.
 */
public void scheduleApply(final SurfaceParams... params) {
    View view = mTargetViewRootImpl.getView();
    if (view == null) {
        return;
    }
    mLastSequenceNumber++;
    final int toApplySeqNo = mLastSequenceNumber;
    setCanRelease(false);
    mTargetViewRootImpl.registerRtFrameCallback(frame -> {
        if (mBarrierSurfaceControl == null || !mBarrierSurfaceControl.isValid()) {
            Message.obtain(mApplyHandler, MSG_UPDATE_SEQUENCE_NUMBER, toApplySeqNo, 0).sendToTarget();
            return;
        }
        Transaction t = new Transaction();
        for (int i = params.length - 1; i >= 0; i--) {
            SurfaceParams surfaceParams = params[i];
            if (surfaceParams.surface.isValid()) {
                surfaceParams.applyTo(t);
            }
        }
        mTargetViewRootImpl.mergeWithNextTransaction(t, frame);
        Message.obtain(mApplyHandler, MSG_UPDATE_SEQUENCE_NUMBER, toApplySeqNo, 0).sendToTarget();
    });
    // Make sure a frame gets scheduled.
    view.invalidate();
}
Also used : Transaction(android.view.SurfaceControl.Transaction) View(android.view.View) SurfaceParams(com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat.SurfaceParams)

Aggregations

Transaction (android.view.SurfaceControl.Transaction)6 View (android.view.View)6 SurfaceParams (com.android.systemui.shared.system.SyncRtSurfaceTransactionApplierCompat.SurfaceParams)6