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

Commit 6b3f6c50 authored by Robert Carr's avatar Robert Carr
Browse files

SurfaceFlinger: Expose construction of container layers.

WindowManager will imminently use them as Buffer-less Surfaces for catching
input. They can also be used for the existing hierarchy layers that the WM
adds to solely act as containers.

Bug: 111440400
Test: None
Change-Id: Ic7d9234d7fd8be74b77dfbc3daa6ca0e52f25768
parent d314f169
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -43,6 +43,7 @@ public:
        eFXSurfaceBufferQueue = 0x00000000,
        eFXSurfaceColor = 0x00020000,
        eFXSurfaceBufferState = 0x00040000,
        eFXSurfaceContainer = 0x00080000,
        eFXSurfaceMask = 0x000F0000,
    };

+15 −0
Original line number Diff line number Diff line
@@ -3717,6 +3717,11 @@ status_t SurfaceFlinger::createLayer(
                    uniqueName, w, h, flags,
                    handle, &layer);
            break;
        case ISurfaceComposerClient::eFXSurfaceContainer:
            result = createContainerLayer(client,
                    uniqueName, w, h, flags,
                    handle, &layer);
            break;
        default:
            result = BAD_VALUE;
            break;
@@ -3820,6 +3825,16 @@ status_t SurfaceFlinger::createColorLayer(const sp<Client>& client,
    return NO_ERROR;
}

status_t SurfaceFlinger::createContainerLayer(const sp<Client>& client,
        const String8& name, uint32_t w, uint32_t h, uint32_t flags,
        sp<IBinder>* handle, sp<Layer>* outLayer)
{
    *outLayer = new ContainerLayer(this, client, name, w, h, flags);
    *handle = (*outLayer)->getHandle();
    return NO_ERROR;
}


status_t SurfaceFlinger::onLayerRemoved(const sp<Client>& client, const sp<IBinder>& handle)
{
    // called by a client when it wants to remove a Layer
+4 −0
Original line number Diff line number Diff line
@@ -548,6 +548,10 @@ private:
            uint32_t w, uint32_t h, uint32_t flags, sp<IBinder>* outHandle,
            sp<Layer>* outLayer);

    status_t createContainerLayer(const sp<Client>& client, const String8& name,
            uint32_t w, uint32_t h, uint32_t flags, sp<IBinder>* outHandle,
            sp<Layer>* outLayer);

    String8 getUniqueLayerName(const String8& name);

    // called in response to the window-manager calling