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

Commit f4833c4f authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android (Google) Code Review
Browse files

Merge "Updates to shared lib for Launcher" into pi-dev

parents aceee95f cd56073b
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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();
    }
}
+15 −8
Original line number Diff line number Diff line
@@ -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 {

        /**
+2 −2
Original line number Diff line number Diff line
@@ -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();