Updates to shared lib for Launcher
Test: builds Bug: 80292740 Change-Id: I7ce71c6271bd70d802c18001436b651bcc02c90c
This commit is contained in:
@@ -30,4 +30,8 @@ public class ChoreographerCompat {
|
||||
public static void postInputFrame(Choreographer choreographer, Runnable runnable) {
|
||||
choreographer.postCallback(CALLBACK_INPUT, runnable, null);
|
||||
}
|
||||
|
||||
public static Choreographer getSfInstance() {
|
||||
return Choreographer.getSfInstance();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -20,11 +20,10 @@ import android.graphics.Matrix;
|
||||
import android.graphics.Rect;
|
||||
import android.view.Surface;
|
||||
import android.view.SurfaceControl;
|
||||
import android.view.SurfaceControl.Transaction;
|
||||
import android.view.View;
|
||||
import android.view.ViewRootImpl;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
* Helper class to apply surface transactions in sync with RenderThread.
|
||||
*/
|
||||
@@ -56,16 +55,12 @@ public class SyncRtSurfaceTransactionApplier {
|
||||
if (mTargetSurface == null || !mTargetSurface.isValid()) {
|
||||
return;
|
||||
}
|
||||
SurfaceControl.Transaction t = new SurfaceControl.Transaction();
|
||||
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.setMatrix(surface, surfaceParams.matrix, mTmpFloat9);
|
||||
t.setWindowCrop(surface, surfaceParams.windowCrop);
|
||||
t.setAlpha(surface, surfaceParams.alpha);
|
||||
t.setLayer(surface, surfaceParams.layer);
|
||||
t.show(surface);
|
||||
applyParams(t, surfaceParams, mTmpFloat9);
|
||||
}
|
||||
t.setEarlyWakeup();
|
||||
t.apply();
|
||||
@@ -75,6 +70,18 @@ public class SyncRtSurfaceTransactionApplier {
|
||||
mTargetViewRootImpl.getView().invalidate();
|
||||
}
|
||||
|
||||
public static void applyParams(TransactionCompat t, SurfaceParams params) {
|
||||
applyParams(t.mTransaction, params, t.mTmpValues);
|
||||
}
|
||||
|
||||
private static void applyParams(Transaction t, SurfaceParams params, float[] tmpFloat9) {
|
||||
t.setMatrix(params.surface, params.matrix, tmpFloat9);
|
||||
t.setWindowCrop(params.surface, params.windowCrop);
|
||||
t.setAlpha(params.surface, params.alpha);
|
||||
t.setLayer(params.surface, params.layer);
|
||||
t.show(params.surface);
|
||||
}
|
||||
|
||||
public static class SurfaceParams {
|
||||
|
||||
/**
|
||||
|
||||
@@ -25,9 +25,9 @@ import android.view.SurfaceControl.Transaction;
|
||||
|
||||
public class TransactionCompat {
|
||||
|
||||
private final Transaction mTransaction;
|
||||
final Transaction mTransaction;
|
||||
|
||||
private final float[] mTmpValues = new float[9];
|
||||
final float[] mTmpValues = new float[9];
|
||||
|
||||
public TransactionCompat() {
|
||||
mTransaction = new Transaction();
|
||||
|
||||
Reference in New Issue
Block a user