Reduce jittering while dragging divider bar
Set vsync id to transactions moving divider bar surface, so those transactions won't be committed together and result to empty frame while dragging the divider bar. Bug: 230050092 Test: manual dump and verified with perfetto trace Change-Id: Id570e80a908a07113b8e4bd77f38c05e3eee1d0c
This commit is contained in:
@@ -76,6 +76,7 @@ import android.os.IBinder;
|
||||
import android.os.RemoteException;
|
||||
import android.util.Log;
|
||||
import android.util.Slog;
|
||||
import android.view.Choreographer;
|
||||
import android.view.IRemoteAnimationFinishedCallback;
|
||||
import android.view.IRemoteAnimationRunner;
|
||||
import android.view.RemoteAnimationAdapter;
|
||||
@@ -1124,6 +1125,7 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
||||
mDividerFadeInAnimator.cancel();
|
||||
return;
|
||||
}
|
||||
transaction.setFrameTimelineVsync(Choreographer.getInstance().getVsyncId());
|
||||
transaction.setAlpha(dividerLeash, (float) animation.getAnimatedValue());
|
||||
transaction.apply();
|
||||
});
|
||||
@@ -1216,17 +1218,23 @@ class StageCoordinator implements SplitLayout.SplitLayoutHandler,
|
||||
|
||||
@Override
|
||||
public void onLayoutPositionChanging(SplitLayout layout) {
|
||||
mSyncQueue.runInSync(t -> updateSurfaceBounds(layout, t, false /* applyResizingOffset */));
|
||||
final SurfaceControl.Transaction t = mTransactionPool.acquire();
|
||||
t.setFrameTimelineVsync(Choreographer.getInstance().getVsyncId());
|
||||
updateSurfaceBounds(layout, t, false /* applyResizingOffset */);
|
||||
t.apply();
|
||||
mTransactionPool.release(t);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onLayoutSizeChanging(SplitLayout layout) {
|
||||
mSyncQueue.runInSync(t -> {
|
||||
setResizingSplits(true /* resizing */);
|
||||
updateSurfaceBounds(layout, t, true /* applyResizingOffset */);
|
||||
mMainStage.onResizing(getMainStageBounds(), t);
|
||||
mSideStage.onResizing(getSideStageBounds(), t);
|
||||
});
|
||||
final SurfaceControl.Transaction t = mTransactionPool.acquire();
|
||||
t.setFrameTimelineVsync(Choreographer.getInstance().getVsyncId());
|
||||
setResizingSplits(true /* resizing */);
|
||||
updateSurfaceBounds(layout, t, true /* applyResizingOffset */);
|
||||
mMainStage.onResizing(getMainStageBounds(), t);
|
||||
mSideStage.onResizing(getSideStageBounds(), t);
|
||||
t.apply();
|
||||
mTransactionPool.release(t);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user