FileDocCategorySizeDatePackage
BlackFrame.javaAPI DocAndroid 5.1 API7244Thu Mar 12 22:22:42 GMT 2015com.android.server.wm

BlackFrame

public class BlackFrame extends Object
Four black surfaces put together to make a black frame.

Fields Summary
final android.graphics.Rect
mOuterRect
final android.graphics.Rect
mInnerRect
final android.graphics.Matrix
mTmpMatrix
final float[]
mTmpFloats
final BlackSurface[]
mBlackSurfaces
final boolean
mForceDefaultOrientation
Constructors Summary
public BlackFrame(android.view.SurfaceSession session, android.graphics.Rect outer, android.graphics.Rect inner, int layer, int layerStack, boolean forceDefaultOrientation)

        boolean success = false;

        mForceDefaultOrientation = forceDefaultOrientation;

        mOuterRect = new Rect(outer);
        mInnerRect = new Rect(inner);
        try {
            if (outer.top < inner.top) {
                mBlackSurfaces[0] = new BlackSurface(session, layer,
                        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, layerStack);
            }
            if (outer.bottom > inner.bottom) {
                mBlackSurfaces[2] = new BlackSurface(session, layer,
                        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, layerStack);
            }
            success = true;
        } finally {
            if (!success) {
                kill();
            }
        }
    
Methods Summary
public voidclearMatrix()

        for (int i=0; i<mBlackSurfaces.length; i++) {
            if (mBlackSurfaces[i] != null) {
                mBlackSurfaces[i].clearMatrix();
            }
        }
    
public voidhide()

        if (mBlackSurfaces != null) {
            for (int i=0; i<mBlackSurfaces.length; i++) {
                if (mBlackSurfaces[i] != null) {
                    mBlackSurfaces[i].surface.hide();
                }
            }
        }
    
public voidkill()

        if (mBlackSurfaces != null) {
            for (int i=0; i<mBlackSurfaces.length; i++) {
                if (mBlackSurfaces[i] != null) {
                    if (WindowManagerService.SHOW_TRANSACTIONS ||
                            WindowManagerService.SHOW_SURFACE_ALLOC) Slog.i(
                                    WindowManagerService.TAG,
                                    "  BLACK " + mBlackSurfaces[i].surface + ": DESTROY");
                    mBlackSurfaces[i].surface.destroy();
                    mBlackSurfaces[i] = null;
                }
            }
        }
    
public voidprintTo(java.lang.String prefix, java.io.PrintWriter pw)


          
        pw.print(prefix); pw.print("Outer: "); mOuterRect.printShortString(pw);
                pw.print(" / Inner: "); mInnerRect.printShortString(pw);
                pw.println();
        for (int i=0; i<mBlackSurfaces.length; i++) {
            BlackSurface bs = mBlackSurfaces[i];
            pw.print(prefix); pw.print("#"); pw.print(i);
                    pw.print(": "); pw.print(bs.surface);
                    pw.print(" left="); pw.print(bs.left);
                    pw.print(" top="); pw.println(bs.top);
        }
    
public voidsetAlpha(float alpha)

        for (int i=0; i<mBlackSurfaces.length; i++) {
            if (mBlackSurfaces[i] != null) {
                mBlackSurfaces[i].setAlpha(alpha);
            }
        }
    
public voidsetMatrix(android.graphics.Matrix matrix)

        for (int i=0; i<mBlackSurfaces.length; i++) {
            if (mBlackSurfaces[i] != null) {
                mBlackSurfaces[i].setMatrix(matrix);
            }
        }