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

Commit 37965d4d authored by Ady Abraham's avatar Ady Abraham
Browse files

ISurfaceComposer: rename isColorManagementUsed()

Rename isColorManagementUsed() to getColorManagement()
to follow the convention in ISurfaceComposer.

Test: adb shell /data/nativetest64/SurfaceFlinger_test/SurfaceFlinger_test --gtest_filter=LayerTransactionTest.SetColorTransformBasic
Change-Id: I63f75a98dbd230375f215a109a725672353eceef
parent 12c631b5
Loading
Loading
Loading
Loading
+14 −14
Original line number Diff line number Diff line
@@ -588,19 +588,16 @@ public:
        return error;
    }

    virtual bool isColorManagementUsed() const {
    virtual status_t getColorManagement(bool* outGetColorManagement) const {
        Parcel data, reply;
        data.writeInterfaceToken(ISurfaceComposer::getInterfaceDescriptor());
        remote()->transact(BnSurfaceComposer::IS_COLOR_MANAGEMET_USED, data, &reply);
        int32_t result = 0;
        status_t err = reply.readInt32(&result);
        if (err != NO_ERROR) {
            ALOGE("ISurfaceComposer::isColorManagementUsed: error "
                  "retrieving result: %s (%d)",
                  strerror(-err), -err);
            return false;
        remote()->transact(BnSurfaceComposer::GET_COLOR_MANAGEMENT, data, &reply);
        bool result;
        status_t err = reply.readBool(&result);
        if (err == NO_ERROR) {
            *outGetColorManagement = result;
        }
        return result != 0;
        return err;
    }
};

@@ -945,11 +942,14 @@ status_t BnSurfaceComposer::onTransact(
            }
            return NO_ERROR;
        }
        case IS_COLOR_MANAGEMET_USED: {
        case GET_COLOR_MANAGEMENT: {
            CHECK_INTERFACE(ISurfaceComposer, data, reply);
            int32_t result = isColorManagementUsed() ? 1 : 0;
            reply->writeInt32(result);
            return NO_ERROR;
            bool result;
            status_t error = getColorManagement(&result);
            if (error == NO_ERROR) {
                reply->writeBool(result);
            }
            return result;
        }
        default: {
            return BBinder::onTransact(code, data, reply, flags);
+2 −2
Original line number Diff line number Diff line
@@ -280,7 +280,7 @@ public:
     */
    virtual status_t getLayerDebugInfo(std::vector<LayerDebugInfo>* outLayers) const = 0;

    virtual bool isColorManagementUsed() const = 0;
    virtual status_t getColorManagement(bool* outGetColorManagement) const = 0;

    /* Gets the composition preference of the default data space and default pixel format,
     * as well as the wide color gamut data space and wide color gamut pixel format.
@@ -331,7 +331,7 @@ public:
        GET_LAYER_DEBUG_INFO,
        CREATE_SCOPED_CONNECTION,
        GET_COMPOSITION_PREFERENCE,
        IS_COLOR_MANAGEMET_USED,
        GET_COLOR_MANAGEMENT,
    };

    virtual status_t onTransact(uint32_t code, const Parcel& data,
+1 −1
Original line number Diff line number Diff line
@@ -635,7 +635,7 @@ public:
        return NO_ERROR;
    }

    virtual bool isColorManagementUsed() const { return false; }
    virtual status_t getColorManagement(bool* /*outGetColorManagement*/) const { return NO_ERROR; }

protected:
    IBinder* onAsBinder() override { return nullptr; }
+7 −3
Original line number Diff line number Diff line
@@ -518,8 +518,12 @@ sp<IBinder> SurfaceFlinger::getBuiltInDisplay(int32_t id) {
    return mDisplayTokens[id];
}

bool SurfaceFlinger::isColorManagementUsed() const {
    return useColorManagement;
status_t SurfaceFlinger::getColorManagement(bool* outGetColorManagement) const {
    if (!outGetColorManagement) {
        return BAD_VALUE;
    }
    *outGetColorManagement = useColorManagement;
    return NO_ERROR;
}

void SurfaceFlinger::bootFinished()
@@ -4757,7 +4761,7 @@ status_t SurfaceFlinger::CheckTransactCodeCredentials(uint32_t code) {
        case SET_TRANSACTION_STATE:
        // Creating a scoped connection is safe, as per discussion in ISurfaceComposer.h
        case CREATE_SCOPED_CONNECTION:
        case IS_COLOR_MANAGEMET_USED:
        case GET_COLOR_MANAGEMENT:
        case GET_COMPOSITION_PREFERENCE: {
            return OK;
        }
+1 −1
Original line number Diff line number Diff line
@@ -466,7 +466,7 @@ private:
    virtual status_t enableVSyncInjections(bool enable);
    virtual status_t injectVSync(nsecs_t when);
    virtual status_t getLayerDebugInfo(std::vector<LayerDebugInfo>* outLayers) const;
    virtual bool isColorManagementUsed() const;
    virtual status_t getColorManagement(bool* outGetColorManagement) const;
    status_t getCompositionPreference(ui::Dataspace* outDataspace, ui::PixelFormat* outPixelFormat,
                                      ui::Dataspace* outWideColorGamutDataspace,
                                      ui::PixelFormat* outWideColorGamutPixelFormat) const override;
Loading