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

Commit d040edba authored by Dianne Hackborn's avatar Dianne Hackborn
Browse files

Use floating point window positions.

Gets rid of gapps between windows during animations.

Change-Id: I17d2ef0af214008f0eabd7eb19268f145fe83b39
parent be566b48
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -8648,6 +8648,7 @@ package android.graphics {
    method public void setEmpty();
    method public boolean setIntersect(android.graphics.RectF, android.graphics.RectF);
    method public void sort();
    method public java.lang.String toShortString();
    method public void union(float, float, float, float);
    method public void union(android.graphics.RectF);
    method public void union(float, float);
@@ -10680,8 +10681,8 @@ package android.media {
    method public void setOnSeekCompleteListener(android.media.MediaPlayer.OnSeekCompleteListener);
    method public void setOnVideoSizeChangedListener(android.media.MediaPlayer.OnVideoSizeChangedListener);
    method public void setScreenOnWhilePlaying(boolean);
    method public void setTexture(android.graphics.SurfaceTexture);
    method public void setSurface(android.view.Surface);
    method public void setTexture(android.graphics.SurfaceTexture);
    method public void setVolume(float, float);
    method public void setWakeMode(android.content.Context, int);
    method public void start() throws java.lang.IllegalStateException;
+2 −1
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import android.content.Context;
import android.content.res.CompatibilityInfo;
import android.content.res.Configuration;
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.IBinder;
import android.os.LocalPowerManager;
import android.view.animation.Animation;
@@ -165,7 +166,7 @@ public interface WindowManagerPolicy {
         * 
         * @return Rect The rectangle holding the shown window frame.
         */
        public Rect getShownFrameLw();
        public RectF getShownFrameLw();

        /**
         * Retrieve the frame of the display that this window was last
+31 −0
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package android.graphics;

import java.io.PrintWriter;

import android.os.Parcel;
import android.os.Parcelable;
import android.util.FloatMath;
@@ -82,6 +84,35 @@ public class RectF implements Parcelable {
                      + right + ", " + bottom + ")";
    }

    /**
     * Return a string representation of the rectangle in a compact form.
     */
    public String toShortString() {
        return toShortString(new StringBuilder(32));
    }
    
    /**
     * Return a string representation of the rectangle in a compact form.
     * @hide
     */
    public String toShortString(StringBuilder sb) {
        sb.setLength(0);
        sb.append('['); sb.append(left); sb.append(',');
        sb.append(top); sb.append("]["); sb.append(right);
        sb.append(','); sb.append(bottom); sb.append(']');
        return sb.toString();
    }
    
    /**
     * Print short representation to given writer.
     * @hide
     */
    public void printShortString(PrintWriter pw) {
        pw.print('['); pw.print(left); pw.print(',');
        pw.print(top); pw.print("]["); pw.print(right);
        pw.print(','); pw.print(bottom); pw.print(']');
    }

    /**
     * Returns true if the rectangle is empty (left >= right or top >= bottom)
     */
+2 −1
Original line number Diff line number Diff line
@@ -38,6 +38,7 @@ import android.content.res.Resources;
import android.database.ContentObserver;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.graphics.RectF;
import android.os.Binder;
import android.os.Handler;
import android.os.IBinder;
@@ -2263,7 +2264,7 @@ public class PhoneWindowManager implements WindowManagerPolicy {
            // incorrectly think it does cover it when it doesn't.  We'll revisit
            // this later when we re-do the phone status bar.
            if (mStatusBar != null && mStatusBar.isVisibleLw()) {
                Rect rect = new Rect(mStatusBar.getShownFrameLw());
                RectF rect = new RectF(mStatusBar.getShownFrameLw());
                for (int i=mStatusBarPanels.size()-1; i>=0; i--) {
                    WindowState w = mStatusBarPanels.get(i);
                    if (w.isVisibleLw()) {
+2 −2
Original line number Diff line number Diff line
@@ -51,8 +51,8 @@ public class BlackFrame {
            mTmpMatrix.setTranslate(left, top);
            mTmpMatrix.postConcat(matrix);
            mTmpMatrix.getValues(mTmpFloats);
            surface.setPosition((int)mTmpFloats[Matrix.MTRANS_X],
                    (int)mTmpFloats[Matrix.MTRANS_Y]);
            surface.setPosition(mTmpFloats[Matrix.MTRANS_X],
                    mTmpFloats[Matrix.MTRANS_Y]);
            surface.setMatrix(
                    mTmpFloats[Matrix.MSCALE_X], mTmpFloats[Matrix.MSKEW_Y],
                    mTmpFloats[Matrix.MSKEW_X], mTmpFloats[Matrix.MSCALE_Y]);
Loading