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

Commit 1df8d38a authored by Leon Scroggins's avatar Leon Scroggins Committed by Android (Google) Code Review
Browse files

Merge "Query the new DisplayCapability for DISPLAY_DECORATION"

parents fcd1e578 e5cff63e
Loading
Loading
Loading
Loading
+41 −0
Original line number Diff line number Diff line
@@ -1134,6 +1134,34 @@ public:
        return NO_ERROR;
    }

    status_t getDisplayDecorationSupport(const sp<IBinder>& displayToken,
                                         bool* outSupport) const override {
        Parcel data, reply;
        status_t error = data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        if (error != NO_ERROR) {
            ALOGE("getDisplayDecorationSupport: failed to write interface token: %d", error);
            return error;
        }
        error = data.writeStrongBinder(displayToken);
        if (error != NO_ERROR) {
            ALOGE("getDisplayDecorationSupport: failed to write display token: %d", error);
            return error;
        }
        error = remote()->transact(BnSurfaceComposer::GET_DISPLAY_DECORATION_SUPPORT, data, &reply);
        if (error != NO_ERROR) {
            ALOGE("getDisplayDecorationSupport: failed to transact: %d", error);
            return error;
        }
        bool support;
        error = reply.readBool(&support);
        if (error != NO_ERROR) {
            ALOGE("getDisplayDecorationSupport: failed to read support: %d", error);
            return error;
        }
        *outSupport = support;
        return NO_ERROR;
    }

    status_t setFrameRate(const sp<IGraphicBufferProducer>& surface, float frameRate,
                          int8_t compatibility, int8_t changeFrameRateStrategy) override {
        Parcel data, reply;
@@ -2016,6 +2044,19 @@ status_t BnSurfaceComposer::onTransact(
            return setGlobalShadowSettings(ambientColor, spotColor, lightPosY, lightPosZ,
                                           lightRadius);
        }
        case GET_DISPLAY_DECORATION_SUPPORT: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IBinder> displayToken;
            status_t error = data.readNullableStrongBinder(&displayToken);
            if (error != NO_ERROR) {
                ALOGE("getDisplayDecorationSupport: failed to read display token: %d", error);
                return error;
            }
            bool support = false;
            error = getDisplayDecorationSupport(displayToken, &support);
            reply->writeBool(support);
            return error;
        }
        case SET_FRAME_RATE: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            sp<IBinder> binder;
+6 −0
Original line number Diff line number Diff line
@@ -2216,6 +2216,12 @@ status_t SurfaceComposerClient::setGlobalShadowSettings(const half4& ambientColo
                                                                          lightRadius);
}

bool SurfaceComposerClient::getDisplayDecorationSupport(const sp<IBinder>& displayToken) {
    bool support = false;
    ComposerService::getComposerService()->getDisplayDecorationSupport(displayToken, &support);
    return support;
}

int SurfaceComposerClient::getGPUContextPriority() {
    return ComposerService::getComposerService()->getGPUContextPriority();
}
+17 −0
Original line number Diff line number Diff line
@@ -507,6 +507,22 @@ public:
                                             float lightPosY, float lightPosZ,
                                             float lightRadius) = 0;

    /*
     * Gets whether a display supports DISPLAY_DECORATION layers.
     *
     * displayToken
     *      The token of the display.
     * outSupport
     *      An output parameter for whether the display supports
     *      DISPLAY_DECORATION layers.
     *
     * Returns NO_ERROR upon success. Otherwise,
     *      NAME_NOT_FOUND if the display is invalid, or
     *      BAD_VALUE      if the output parameter is invalid.
     */
    virtual status_t getDisplayDecorationSupport(const sp<IBinder>& displayToken,
                                                 bool* outSupport) const = 0;

    /*
     * Sets the intended frame rate for a surface. See ANativeWindow_setFrameRate() for more info.
     */
@@ -628,6 +644,7 @@ public:
        ADD_WINDOW_INFOS_LISTENER,
        REMOVE_WINDOW_INFOS_LISTENER,
        GET_PRIMARY_PHYSICAL_DISPLAY_ID,
        GET_DISPLAY_DECORATION_SUPPORT,
        // Always append new enum to the end.
    };

+10 −0
Original line number Diff line number Diff line
@@ -272,6 +272,16 @@ public:
    static status_t setGlobalShadowSettings(const half4& ambientColor, const half4& spotColor,
                                            float lightPosY, float lightPosZ, float lightRadius);

    /*
     * Returns whether a display supports DISPLAY_DECORATION layers.
     *
     * displayToken
     *      The token of the display.
     *
     * Returns whether a display supports DISPLAY_DECORATION layers.
     */
    static bool getDisplayDecorationSupport(const sp<IBinder>& displayToken);

    // ------------------------------------------------------------------------
    // surface creation / destruction

+5 −0
Original line number Diff line number Diff line
@@ -882,6 +882,11 @@ public:
        return NO_ERROR;
    }

    status_t getDisplayDecorationSupport(const sp<IBinder>& /*displayToken*/,
                                         bool* /*outSupport*/) const override {
        return NO_ERROR;
    }

    status_t setFrameRate(const sp<IGraphicBufferProducer>& /*surface*/, float /*frameRate*/,
                          int8_t /*compatibility*/, int8_t /*changeFrameRateStrategy*/) override {
        return NO_ERROR;
Loading