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

Commit b708cbe2 authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Lower FSP on window animation too

Test: manual test with setprop debug.hwui.fps_divisor 4
Bug: 66945974
Change-Id: I4b637ed30003a9eae008b093f9e3d8b2a2f09319
parent 229d2cdb
Loading
Loading
Loading
Loading
+3 −0
Original line number Original line Diff line number Diff line
@@ -235,6 +235,8 @@ public final class Choreographer {
        for (int i = 0; i <= CALLBACK_LAST; i++) {
        for (int i = 0; i <= CALLBACK_LAST; i++) {
            mCallbackQueues[i] = new CallbackQueue();
            mCallbackQueues[i] = new CallbackQueue();
        }
        }
        // b/68769804: For low FPS experiments.
        setFPSDivisor(SystemProperties.getInt(ThreadedRenderer.DEBUG_FPS_DIVISOR, 1));
    }
    }


    private static float getRefreshRate() {
    private static float getRefreshRate() {
@@ -605,6 +607,7 @@ public final class Choreographer {
    void setFPSDivisor(int divisor) {
    void setFPSDivisor(int divisor) {
        if (divisor <= 0) divisor = 1;
        if (divisor <= 0) divisor = 1;
        mFPSDivisor = divisor;
        mFPSDivisor = divisor;
        ThreadedRenderer.setFPSDivisor(divisor);
    }
    }


    void doFrame(long frameTimeNanos, int frame) {
    void doFrame(long frameTimeNanos, int frame) {
+1 −5
Original line number Original line Diff line number Diff line
@@ -969,8 +969,6 @@ public final class ThreadedRenderer {
            mInitialized = true;
            mInitialized = true;
            mAppContext = context.getApplicationContext();
            mAppContext = context.getApplicationContext();


            // b/68769804: For low FPS experiments.
            setFPSDivisor(SystemProperties.getInt(DEBUG_FPS_DIVISOR, 1));
            initSched(renderProxy);
            initSched(renderProxy);
            initGraphicsStats();
            initGraphicsStats();
        }
        }
@@ -1025,9 +1023,7 @@ public final class ThreadedRenderer {


    /** b/68769804: For low FPS experiments. */
    /** b/68769804: For low FPS experiments. */
    public static void setFPSDivisor(int divisor) {
    public static void setFPSDivisor(int divisor) {
        if (divisor <= 0) divisor = 1;
        nHackySetRTAnimationsEnabled(divisor <= 1);
        Choreographer.getInstance().setFPSDivisor(divisor);
        nHackySetRTAnimationsEnabled(divisor == 1);
    }
    }


    /** Not actually public - internal use only. This doc to make lint happy */
    /** Not actually public - internal use only. This doc to make lint happy */