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

Commit 2eb755d0 authored by Jorim Jaggi's avatar Jorim Jaggi Committed by android-build-merger
Browse files

Merge "Merge "Updates to shared lib for Launcher" into pi-dev am: f4833c4f" into pi-dev-plus-aosp

am: 8ea57c65

Change-Id: I603155988400aee7bef56131580a5529fee335d9
parents 41c27965 8ea57c65
Loading
Loading
Loading
Loading
+4 −0
Original line number Original line Diff line number Diff line
@@ -30,4 +30,8 @@ public class ChoreographerCompat {
    public static void postInputFrame(Choreographer choreographer, Runnable runnable) {
    public static void postInputFrame(Choreographer choreographer, Runnable runnable) {
        choreographer.postCallback(CALLBACK_INPUT, runnable, null);
        choreographer.postCallback(CALLBACK_INPUT, runnable, null);
    }
    }

    public static Choreographer getSfInstance() {
        return Choreographer.getSfInstance();
    }
}
}
+15 −8
Original line number Original line Diff line number Diff line
@@ -20,11 +20,10 @@ import android.graphics.Matrix;
import android.graphics.Rect;
import android.graphics.Rect;
import android.view.Surface;
import android.view.Surface;
import android.view.SurfaceControl;
import android.view.SurfaceControl;
import android.view.SurfaceControl.Transaction;
import android.view.View;
import android.view.View;
import android.view.ViewRootImpl;
import android.view.ViewRootImpl;


import java.util.ArrayList;

/**
/**
 * Helper class to apply surface transactions in sync with RenderThread.
 * Helper class to apply surface transactions in sync with RenderThread.
 */
 */
@@ -56,16 +55,12 @@ public class SyncRtSurfaceTransactionApplier {
                if (mTargetSurface == null || !mTargetSurface.isValid()) {
                if (mTargetSurface == null || !mTargetSurface.isValid()) {
                    return;
                    return;
                }
                }
                SurfaceControl.Transaction t = new SurfaceControl.Transaction();
                Transaction t = new Transaction();
                for (int i = params.length - 1; i >= 0; i--) {
                for (int i = params.length - 1; i >= 0; i--) {
                    SurfaceParams surfaceParams = params[i];
                    SurfaceParams surfaceParams = params[i];
                    SurfaceControl surface = surfaceParams.surface;
                    SurfaceControl surface = surfaceParams.surface;
                    t.deferTransactionUntilSurface(surface, mTargetSurface, frame);
                    t.deferTransactionUntilSurface(surface, mTargetSurface, frame);
                    t.setMatrix(surface, surfaceParams.matrix, mTmpFloat9);
                    applyParams(t, surfaceParams, mTmpFloat9);
                    t.setWindowCrop(surface, surfaceParams.windowCrop);
                    t.setAlpha(surface, surfaceParams.alpha);
                    t.setLayer(surface, surfaceParams.layer);
                    t.show(surface);
                }
                }
                t.setEarlyWakeup();
                t.setEarlyWakeup();
                t.apply();
                t.apply();
@@ -75,6 +70,18 @@ public class SyncRtSurfaceTransactionApplier {
        mTargetViewRootImpl.getView().invalidate();
        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 {
    public static class SurfaceParams {


        /**
        /**
+2 −2
Original line number Original line Diff line number Diff line
@@ -25,9 +25,9 @@ import android.view.SurfaceControl.Transaction;


public class TransactionCompat {
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() {
    public TransactionCompat() {
        mTransaction = new Transaction();
        mTransaction = new Transaction();