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

Commit 99e27f0b authored by Robert Carr's avatar Robert Carr
Browse files

Change setPositionAppliesWithResize to apply to all geometry.

To support seamless rotation, change setPositionAppliesWithResize
to also include the crop. As the transformation matrix is already
frozen during resize, this enables the window manager to set the
total geometry state before and after resize in a race free fashion.

Bug: 28823590
Change-Id: I3f8f0e162b7ef4e9403c1220c7e4191b3ef30526
parent f9d7e1a0
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -140,7 +140,7 @@ public:
            const sp<IBinder>& handle, uint64_t frameNumber);
    status_t    setOverrideScalingMode(const sp<IBinder>& id,
            int32_t overrideScalingMode);
    status_t    setPositionAppliesWithResize(const sp<IBinder>& id);
    status_t    setGeometryAppliesWithResize(const sp<IBinder>& id);

    status_t    destroySurface(const sp<IBinder>& id);

+4 −3
Original line number Diff line number Diff line
@@ -73,10 +73,11 @@ public:
    status_t    setCrop(const Rect& crop);
    status_t    setFinalCrop(const Rect& crop);

    // If the size changes in this transaction, position updates specified
    // If the size changes in this transaction, all geometry updates specified
    // in this transaction will not complete until a buffer of the new size
    // arrives.
    status_t    setPositionAppliesWithResize();
    // arrives. As some elements normally apply immediately, this enables
    // freezing the total geometry of a surface until a resize is completed.
    status_t    setGeometryAppliesWithResize();

    // Defers applying any changes made in this transaction until the Layer
    // identified by handle reaches the given frameNumber
+1 −1
Original line number Diff line number Diff line
@@ -55,7 +55,7 @@ struct layer_state_t {
        eDeferTransaction           = 0x00000200,
        eFinalCropChanged           = 0x00000400,
        eOverrideScalingModeChanged = 0x00000800,
        ePositionAppliesWithResize  = 0x00001000,
        eGeometryAppliesWithResize  = 0x00001000,
    };

    layer_state_t()
+5 −5
Original line number Diff line number Diff line
@@ -165,7 +165,7 @@ public:
            uint64_t frameNumber);
    status_t setOverrideScalingMode(const sp<SurfaceComposerClient>& client,
            const sp<IBinder>& id, int32_t overrideScalingMode);
    status_t setPositionAppliesWithResize(const sp<SurfaceComposerClient>& client,
    status_t setGeometryAppliesWithResize(const sp<SurfaceComposerClient>& client,
            const sp<IBinder>& id);

    void setDisplaySurface(const sp<IBinder>& token,
@@ -445,7 +445,7 @@ status_t Composer::setOverrideScalingMode(
    return NO_ERROR;
}

status_t Composer::setPositionAppliesWithResize(
status_t Composer::setGeometryAppliesWithResize(
        const sp<SurfaceComposerClient>& client,
        const sp<IBinder>& id) {
    Mutex::Autolock lock(mLock);
@@ -453,7 +453,7 @@ status_t Composer::setPositionAppliesWithResize(
    if (!s) {
        return BAD_INDEX;
    }
    s->what |= layer_state_t::ePositionAppliesWithResize;
    s->what |= layer_state_t::eGeometryAppliesWithResize;
    return NO_ERROR;
}

@@ -699,9 +699,9 @@ status_t SurfaceComposerClient::setOverrideScalingMode(
            this, id, overrideScalingMode);
}

status_t SurfaceComposerClient::setPositionAppliesWithResize(
status_t SurfaceComposerClient::setGeometryAppliesWithResize(
        const sp<IBinder>& id) {
    return getComposer().setPositionAppliesWithResize(this, id);
    return getComposer().setGeometryAppliesWithResize(this, id);
}

// ----------------------------------------------------------------------------
+2 −2
Original line number Diff line number Diff line
@@ -112,10 +112,10 @@ status_t SurfaceControl::setPosition(float x, float y) {
    if (err < 0) return err;
    return mClient->setPosition(mHandle, x, y);
}
status_t SurfaceControl::setPositionAppliesWithResize() {
status_t SurfaceControl::setGeometryAppliesWithResize() {
    status_t err = validate();
    if (err < 0) return err;
    return mClient->setPositionAppliesWithResize(mHandle);
    return mClient->setGeometryAppliesWithResize(mHandle);
}
status_t SurfaceControl::setSize(uint32_t w, uint32_t h) {
    status_t err = validate();
Loading