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

Commit 317a6280 authored by Mathias Agopian's avatar Mathias Agopian Committed by Jean-Baptiste Queru
Browse files

Surface::GPU and Surface::HARDWARE are now deprecated; they will be set automatically if needed.

this also ripples into the window manager API by making some constant there deprecated as well.
parent 81655243
Loading
Loading
Loading
Loading
+6 −6
Original line number Diff line number Diff line
@@ -145267,7 +145267,7 @@
 value="40"
 static="true"
 final="true"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</field>
@@ -145278,7 +145278,7 @@
 value="16"
 static="true"
 final="true"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</field>
@@ -145628,7 +145628,7 @@
 value="2"
 static="true"
 final="true"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</field>
@@ -145639,7 +145639,7 @@
 value="1"
 static="true"
 final="true"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</field>
@@ -155054,7 +155054,7 @@
 value="2"
 static="true"
 final="true"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</field>
@@ -155065,7 +155065,7 @@
 value="1"
 static="true"
 final="true"
 deprecated="not deprecated"
 deprecated="deprecated"
 visibility="public"
>
</field>
+1 −2
Original line number Diff line number Diff line
@@ -130,8 +130,7 @@ status_t BootAnimation::readyToRun() {

    // create the native surface
    sp<SurfaceControl> control = session()->createSurface(
            getpid(), 0, dinfo.w, dinfo.h, PIXEL_FORMAT_RGB_565,
            ISurfaceComposer::eGPU);
            getpid(), 0, dinfo.w, dinfo.h, PIXEL_FORMAT_RGB_565);
    session()->openTransaction();
    control->setLayer(0x40000000);
    session()->closeTransaction();
+8 −2
Original line number Diff line number Diff line
@@ -34,12 +34,18 @@ public class Surface implements Parcelable {
    /** Surface is created hidden */
    public static final int HIDDEN              = 0x00000004;

    /** The surface is to be used by hardware accelerators or DMA engines */
    /** The surface is to be used by hardware accelerators or DMA engines 
     * @deprecated this is ignored, this value is set automatically when needed.
     */
    @Deprecated
    public static final int HARDWARE            = 0x00000010;

    /** Implies "HARDWARE", the surface is to be used by the GPU
     * additionally the backbuffer is never preserved for these
     * surfaces. */
     * surfaces. 
     * @deprecated this is ignored, this value is set automatically when needed.
     */
    @Deprecated
    public static final int GPU                 = 0x00000028;

    /** The surface contains secure content, special measures will
+9 −9
Original line number Diff line number Diff line
@@ -38,8 +38,6 @@ public interface SurfaceHolder {
     * Surface type.
     * 
     * @see #SURFACE_TYPE_NORMAL
     * @see #SURFACE_TYPE_HARDWARE
     * @see #SURFACE_TYPE_GPU
     * @see #SURFACE_TYPE_PUSH_BUFFERS
     */
    
@@ -47,9 +45,15 @@ public interface SurfaceHolder {
     * 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. */
     * hardware accelerators. 
     * @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 */
    /** Surface type: creates a surface suited to be used with the GPU 
     * @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. */
@@ -139,11 +143,7 @@ public interface SurfaceHolder {
    public boolean isCreating();
    
    /**
     * Sets the surface's type. Surfaces intended to be used with OpenGL ES
     * should be of SURFACE_TYPE_GPU, surfaces accessed by DMA engines and
     * hardware accelerators should be of type SURFACE_TYPE_HARDWARE.
     * Failing to set the surface's type appropriately could result in 
     * degraded performance or failure. 
     * Sets the surface's type. 
     * 
     * @param type The surface's memory type.
     */
+6 −1
Original line number Diff line number Diff line
@@ -573,9 +573,14 @@ public class SurfaceView extends View {

        public void setType(int type) {
            switch (type) {
            case SURFACE_TYPE_NORMAL:
            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) {
Loading