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

Commit 87a96ea9 authored by Mathias Agopian's avatar Mathias Agopian
Browse files

Fix an issue where Surface::lock() would never update the output region

this bug was introduced recently. in some situations Surface::lock()
is not able to preserve the content of the back buffer and needs
to tell the caller to redraw everything.

Bug: 5186460
Change-Id: I14e03939ddfc1b7ad2a8b99ad79435314c60e78e
parent a4583646
Loading
Loading
Loading
Loading
+8 −3
Original line number Original line Diff line number Diff line
@@ -351,13 +351,13 @@ int Surface::query(int what, int* value) const {


// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------


status_t Surface::lock(SurfaceInfo* other, Region* dirtyIn) {
status_t Surface::lock(SurfaceInfo* other, Region* inOutDirtyRegion) {
    ANativeWindow_Buffer outBuffer;
    ANativeWindow_Buffer outBuffer;


    ARect temp;
    ARect temp;
    ARect* inOutDirtyBounds = NULL;
    ARect* inOutDirtyBounds = NULL;
    if (dirtyIn) {
    if (inOutDirtyRegion) {
        temp = dirtyIn->getBounds();
        temp = inOutDirtyRegion->getBounds();
        inOutDirtyBounds = &temp;
        inOutDirtyBounds = &temp;
    }
    }


@@ -371,6 +371,11 @@ status_t Surface::lock(SurfaceInfo* other, Region* dirtyIn) {
        other->format = uint32_t(outBuffer.format);
        other->format = uint32_t(outBuffer.format);
        other->bits = outBuffer.bits;
        other->bits = outBuffer.bits;
    }
    }

    if (inOutDirtyRegion) {
        inOutDirtyRegion->set( static_cast<Rect const&>(temp) );
    }

    return err;
    return err;
}
}