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

Commit 6715d1ef authored by Craig Mautner's avatar Craig Mautner Committed by Android (Google) Code Review
Browse files

Merge "Clean up displayId and layerStack usage." into jb-mr1-dev

parents 03f482c3 b47bbc3d
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@ import android.os.Message;
import android.os.RemoteException;
import android.os.ServiceManager;
import android.util.Log;
import android.util.SparseArray;
import android.view.CompatibilityInfoHolder;
import android.view.Display;
import android.view.DisplayInfo;
+4 −4
Original line number Diff line number Diff line
@@ -389,7 +389,7 @@ public class Surface implements Parcelable {
     * release this object's reference. @hide */
    public native void destroy();

    private native Canvas lockCanvasNative(Rect dirty);   
    private native Canvas lockCanvasNative(Rect dirty) throws OutOfResourcesException;

    /**
     * set the orientation of the given display.
@@ -497,10 +497,10 @@ public class Surface implements Parcelable {
    }
    
    private native void init(SurfaceSession s,
            int pid, String name, int displayId, int w, int h, int format, int flags)
            int pid, String name, int layerStack, int w, int h, int format, int flags)
            throws OutOfResourcesException;

    private native void init(Parcel source);
    private native void init(Parcel source) throws OutOfResourcesException;

    private native void initFromSurfaceTexture(SurfaceTexture surfaceTexture);

+8 −9
Original line number Diff line number Diff line
@@ -22,7 +22,6 @@ import android.graphics.Matrix;
import android.graphics.PixelFormat;
import android.graphics.Rect;
import android.util.Slog;
import android.view.Display;
import android.view.Surface;
import android.view.SurfaceSession;

@@ -36,7 +35,7 @@ public class BlackFrame {
        final int layer;
        final Surface surface;

        BlackSurface(SurfaceSession session, int layer, int l, int t, int r, int b)
        BlackSurface(SurfaceSession session, int layer, int l, int t, int r, int b, int layerStack)
                throws Surface.OutOfResourcesException {
            left = l;
            top = t;
@@ -45,10 +44,10 @@ public class BlackFrame {
            int h = b-t;
            if (WindowManagerService.DEBUG_SURFACE_TRACE) {
                surface = new WindowStateAnimator.SurfaceTrace(session, 0, "BlackSurface("
                        + l + ", " + t + ")", Display.DEFAULT_DISPLAY,
                        + l + ", " + t + ")", layerStack,
                        w, h, PixelFormat.OPAQUE, Surface.FX_SURFACE_DIM);
            } else {
                surface = new Surface(session, 0, "BlackSurface", Display.DEFAULT_DISPLAY,
                surface = new Surface(session, 0, "BlackSurface", layerStack,
                        w, h, PixelFormat.OPAQUE, Surface.FX_SURFACE_DIM);
            }
            surface.setAlpha(1);
@@ -104,7 +103,7 @@ public class BlackFrame {
    }

    public BlackFrame(SurfaceSession session, Rect outer, Rect inner,
            int layer) throws Surface.OutOfResourcesException {
            int layer, final int layerStack) throws Surface.OutOfResourcesException {
        boolean success = false;

        mOuterRect = new Rect(outer);
@@ -112,19 +111,19 @@ public class BlackFrame {
        try {
            if (outer.top < inner.top) {
                mBlackSurfaces[0] = new BlackSurface(session, layer,
                        outer.left, outer.top, inner.right, inner.top);
                        outer.left, outer.top, inner.right, inner.top, layerStack);
            }
            if (outer.left < inner.left) {
                mBlackSurfaces[1] = new BlackSurface(session, layer,
                        outer.left, inner.top, inner.left, outer.bottom);
                        outer.left, inner.top, inner.left, outer.bottom, layerStack);
            }
            if (outer.bottom > inner.bottom) {
                mBlackSurfaces[2] = new BlackSurface(session, layer,
                        inner.left, inner.bottom, outer.right, outer.bottom);
                        inner.left, inner.bottom, outer.right, outer.bottom, layerStack);
            }
            if (outer.right > inner.right) {
                mBlackSurfaces[3] = new BlackSurface(session, layer,
                        inner.right, outer.top, outer.right, inner.bottom);
                        inner.right, outer.top, outer.right, inner.bottom, layerStack);
            }
            success = true;
        } finally {
+3 −3
Original line number Diff line number Diff line
@@ -39,18 +39,18 @@ class DimAnimator {
    
    int mLastDimWidth, mLastDimHeight;

    DimAnimator (SurfaceSession session, final int displayId) {
    DimAnimator (SurfaceSession session, final int layerStack) {
        if (mDimSurface == null) {
            try {
                if (WindowManagerService.DEBUG_SURFACE_TRACE) {
                    mDimSurface = new WindowStateAnimator.SurfaceTrace(session, 0,
                        "DimAnimator",
                        displayId, 16, 16, PixelFormat.OPAQUE,
                        layerStack, 16, 16, PixelFormat.OPAQUE,
                        Surface.FX_SURFACE_DIM);
                } else {
                    mDimSurface = new Surface(session, 0,
                        "DimAnimator",
                        displayId, 16, 16, PixelFormat.OPAQUE,
                        layerStack, 16, 16, PixelFormat.OPAQUE,
                        Surface.FX_SURFACE_DIM);
                }
                if (WindowManagerService.SHOW_TRANSACTIONS ||
+3 −3
Original line number Diff line number Diff line
@@ -30,18 +30,18 @@ class DimSurface {
    int mLayer = -1;
    int mLastDimWidth, mLastDimHeight;

    DimSurface(SurfaceSession session, final int displayId) {
    DimSurface(SurfaceSession session, final int layerStack) {
        if (mDimSurface == null) {
            try {
                if (WindowManagerService.DEBUG_SURFACE_TRACE) {
                    mDimSurface = new WindowStateAnimator.SurfaceTrace(session, 0,
                        "DimSurface",
                        displayId, 16, 16, PixelFormat.OPAQUE,
                        layerStack, 16, 16, PixelFormat.OPAQUE,
                        Surface.FX_SURFACE_DIM);
                } else {
                    mDimSurface = new Surface(session, 0,
                        "DimSurface",
                        displayId, 16, 16, PixelFormat.OPAQUE,
                        layerStack, 16, 16, PixelFormat.OPAQUE,
                        Surface.FX_SURFACE_DIM);
                }
                if (WindowManagerService.SHOW_TRANSACTIONS ||
Loading