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

Commit d2112306 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

remove support for PUSH_BUFFER surfaces and overlays

the same functionality is now supported through
the h/w composer HAL, and YUV support in the GPU.

Change-Id: I8146605449954b8e8fd7f78810b7d873c2d8f5bf
parent ff3c4707
Loading
Loading
Loading
Loading
+10 −10
Original line number Diff line number Diff line
@@ -204706,7 +204706,7 @@
 value="512"
 static="true"
 final="true"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</field>
@@ -204997,7 +204997,7 @@
 synchronized="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
<parameter name="type" type="int">
@@ -205045,7 +205045,7 @@
 value="0"
 static="true"
 final="true"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</field>
@@ -205056,7 +205056,7 @@
 value="3"
 static="true"
 final="true"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</field>
@@ -216101,7 +216101,7 @@
 value="0"
 static="true"
 final="true"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</field>
@@ -216112,7 +216112,7 @@
 value="3"
 static="true"
 final="true"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</field>
@@ -216642,7 +216642,7 @@
 volatile="false"
 static="false"
 final="false"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</field>
@@ -234575,7 +234575,7 @@
>
<parameter name="year" type="int">
</parameter>
<parameter name="month" type="int">
<parameter name="monthOfYear" type="int">
</parameter>
<parameter name="dayOfMonth" type="int">
</parameter>
@@ -234594,7 +234594,7 @@
>
<parameter name="year" type="int">
</parameter>
<parameter name="monthOfYear" type="int">
<parameter name="month" type="int">
</parameter>
<parameter name="dayOfMonth" type="int">
</parameter>
@@ -250950,7 +250950,7 @@
 deprecated="not deprecated"
 visibility="public"
>
<parameter name="t" type="T">
<parameter name="arg0" type="T">
</parameter>
</method>
</interface>
+3 −0
Original line number Diff line number Diff line
@@ -84,7 +84,10 @@ public class Surface implements Parcelable {
     * of the surface must be pushed by an external entity. This is type
     * of surface can be used for efficient camera preview or movie
     * play back.
     *
     * @deprecated not support by the system anymore
     */
    @Deprecated
    public static final int PUSH_BUFFERS        = 0x00000200;
    /**
     * Indicates that the surface must be considered opaque, even if its
+15 −29
Original line number Diff line number Diff line
@@ -18,10 +18,6 @@ package android.view;

import android.graphics.Canvas;
import android.graphics.Rect;
import static android.view.WindowManager.LayoutParams.MEMORY_TYPE_NORMAL;
import static android.view.WindowManager.LayoutParams.MEMORY_TYPE_HARDWARE;
import static android.view.WindowManager.LayoutParams.MEMORY_TYPE_GPU;
import static android.view.WindowManager.LayoutParams.MEMORY_TYPE_PUSH_BUFFERS;

/**
 * Abstract interface to someone holding a display surface.  Allows you to
@@ -34,30 +30,19 @@ import static android.view.WindowManager.LayoutParams.MEMORY_TYPE_PUSH_BUFFERS;
 * {@link #lockCanvas} and {@link Callback#surfaceCreated Callback.surfaceCreated}.
 */
public interface SurfaceHolder {
    /**
     * Surface type.
     * 
     * @see #SURFACE_TYPE_NORMAL
     * @see #SURFACE_TYPE_PUSH_BUFFERS
     */

    /** Surface type: creates a regular surface, usually in main, non
     * contiguous, cached/buffered RAM. */
    public static final int SURFACE_TYPE_NORMAL = MEMORY_TYPE_NORMAL;
    /** Surface type: creates a suited to be used with DMA engines and
     * hardware accelerators. 
     * @deprecated this is ignored, this value is set automatically when needed.
     */
    /** @deprecated this is ignored, this value is set automatically when needed. */
    @Deprecated
    public static final int SURFACE_TYPE_HARDWARE = MEMORY_TYPE_HARDWARE;
    /** Surface type: creates a surface suited to be used with the GPU 
     * @deprecated this is ignored, this value is set automatically when needed.
     */
    public static final int SURFACE_TYPE_NORMAL = 0;
    /** @deprecated this is ignored, this value is set automatically when needed. */
    @Deprecated
    public static final int SURFACE_TYPE_HARDWARE = 1;
    /** @deprecated this is ignored, this value is set automatically when needed. */
    @Deprecated
    public static final int SURFACE_TYPE_GPU = 2;
    /** @deprecated this is ignored, this value is set automatically when needed. */
    @Deprecated
    public static final int SURFACE_TYPE_GPU = MEMORY_TYPE_GPU;
    /** Surface type: creates a "push" surface, that is a surface that 
     * doesn't owns its buffers. With such a surface lockCanvas will fail. */
    public static final int SURFACE_TYPE_PUSH_BUFFERS = MEMORY_TYPE_PUSH_BUFFERS;
    public static final int SURFACE_TYPE_PUSH_BUFFERS = 3;

    /**
     * Exception that is thrown from {@link #lockCanvas} when called on a Surface
@@ -162,8 +147,9 @@ public interface SurfaceHolder {
    /**
     * Sets the surface's type.
     *  
     * @param type The surface's memory type.
     * @deprecated this is ignored, this value is set automatically when needed.
     */
    @Deprecated
    public void setType(int type);

    /**
+7 −29
Original line number Diff line number Diff line
@@ -145,7 +145,6 @@ public class SurfaceView extends View {
     * compatibility with applications assuming this format.
     */
    int mRequestedFormat = PixelFormat.RGB_565;
    int mRequestedType = -1;

    boolean mHaveFrame = false;
    boolean mDestroyReportNeeded = false;
@@ -158,7 +157,6 @@ public class SurfaceView extends View {
    int mWidth = -1;
    int mHeight = -1;
    int mFormat = -1;
    int mType = -1;
    final Rect mSurfaceFrame = new Rect();
    int mLastSurfaceWidth = -1, mLastSurfaceHeight = -1;
    boolean mUpdateWindowNeeded;
@@ -428,9 +426,9 @@ public class SurfaceView extends View {
        final boolean sizeChanged = mWidth != myWidth || mHeight != myHeight;
        final boolean visibleChanged = mVisible != mRequestedVisible
                || mNewSurfaceNeeded;
        final boolean typeChanged = mType != mRequestedType;

        if (force || creating || formatChanged || sizeChanged || visibleChanged
            || typeChanged || mLeft != mLocation[0] || mTop != mLocation[1]
            || mLeft != mLocation[0] || mTop != mLocation[1]
            || mUpdateWindowNeeded || mReportDrawNeeded || redrawNeeded) {

            if (localLOGV) Log.i(TAG, "Changes: creating=" + creating
@@ -446,7 +444,6 @@ public class SurfaceView extends View {
                mWidth = myWidth;
                mHeight = myHeight;
                mFormat = mRequestedFormat;
                mType = mRequestedType;

                // Scaling/Translate window's layout here because mLayout is not used elsewhere.
                
@@ -471,8 +468,6 @@ public class SurfaceView extends View {
                    mLayout.flags |= WindowManager.LayoutParams.FLAG_COMPATIBLE_WINDOW;
                }

                mLayout.memoryType = mRequestedType;

                if (mWindow == null) {
                    mWindow = new MyWindow(this);
                    mLayout.type = mWindowType;
@@ -716,24 +711,11 @@ public class SurfaceView extends View {
            }
        }

        public void setType(int type) {
            switch (type) {
            case SURFACE_TYPE_HARDWARE:
            case SURFACE_TYPE_GPU:
                // these are deprecated, treat as "NORMAL"
                type = SURFACE_TYPE_NORMAL;
                break;
            }
            switch (type) {
            case SURFACE_TYPE_NORMAL:
            case SURFACE_TYPE_PUSH_BUFFERS:
                mRequestedType = type;
                if (mWindow != null) {
                    updateWindow(false, false);
                }
                break;
            }
        }
        /**
         * @deprecated setType is now ignored.
         */
        @Deprecated
        public void setType(int type) { }

        public void setKeepScreenOn(boolean screenOn) {
            Message msg = mHandler.obtainMessage(KEEP_SCREEN_ON_MSG);
@@ -750,10 +732,6 @@ public class SurfaceView extends View {
        }

        private final Canvas internalLockCanvas(Rect dirty) {
            if (mType == SURFACE_TYPE_PUSH_BUFFERS) {
                throw new BadSurfaceTypeException(
                        "Surface type is SURFACE_TYPE_PUSH_BUFFERS");
            }
            mSurfaceLock.lock();

            if (localLOGV) Log.i(TAG, "Locking canvas... stopped="
+8 −23
Original line number Diff line number Diff line
@@ -388,31 +388,22 @@ public interface WindowManager extends ViewManager {
        public static final int LAST_SYSTEM_WINDOW      = 2999;
        
        /**
         * Specifies what type of memory buffers should be used by this window.
         * Default is normal.
         * 
         * @see #MEMORY_TYPE_NORMAL
         * @see #MEMORY_TYPE_PUSH_BUFFERS
         * @deprecated this is ignored
         */
        @Deprecated
        public int memoryType;

        /** Memory type: The window's surface is allocated in main memory. */
        /** @deprecated this is ignored, this value is set automatically when needed. */
        @Deprecated
        public static final int MEMORY_TYPE_NORMAL = 0;
        /** Memory type: The window's surface is configured to be accessible
         * by DMA engines and hardware accelerators.
         * @deprecated this is ignored, this value is set automatically when needed.
         */
        /** @deprecated this is ignored, this value is set automatically when needed. */
        @Deprecated
        public static final int MEMORY_TYPE_HARDWARE = 1;
        /** Memory type: The window's surface is configured to be accessible
         * by graphics accelerators. 
         * @deprecated this is ignored, this value is set automatically when needed.
         */
        /** @deprecated this is ignored, this value is set automatically when needed. */
        @Deprecated
        public static final int MEMORY_TYPE_GPU = 2;
        /** Memory type: The window's surface doesn't own its buffers and
         * therefore cannot be locked. Instead the buffers are pushed to
         * it through native binder calls. */
        /** @deprecated this is ignored, this value is set automatically when needed. */
        @Deprecated
        public static final int MEMORY_TYPE_PUSH_BUFFERS = 3;

        /**
@@ -994,7 +985,6 @@ public interface WindowManager extends ViewManager {
            out.writeInt(x);
            out.writeInt(y);
            out.writeInt(type);
            out.writeInt(memoryType);
            out.writeInt(flags);
            out.writeInt(softInputMode);
            out.writeInt(gravity);
@@ -1030,7 +1020,6 @@ public interface WindowManager extends ViewManager {
            x = in.readInt();
            y = in.readInt();
            type = in.readInt();
            memoryType = in.readInt();
            flags = in.readInt();
            softInputMode = in.readInt();
            gravity = in.readInt();
@@ -1106,10 +1095,6 @@ public interface WindowManager extends ViewManager {
                type = o.type;
                changes |= TYPE_CHANGED;
            }
            if (memoryType != o.memoryType) {
                memoryType = o.memoryType;
                changes |= MEMORY_TYPE_CHANGED;
            }
            if (flags != o.flags) {
                flags = o.flags;
                changes |= FLAGS_CHANGED;
Loading