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

Commit bdeb67fd authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "libgui: Copyback all region except dirty region for newly allocated buffer"

parents 92fa6436 7b99776b
Loading
Loading
Loading
Loading
+7 −3
Original line number Diff line number Diff line
@@ -877,10 +877,14 @@ status_t Surface::lock(
        if (canCopyBack) {
            Mutex::Autolock lock(mMutex);
            Region oldDirtyRegion;
            if(mSlots[backBufferSlot].dirtyRegion.isEmpty()) {
                oldDirtyRegion.set(bounds);
            } else {
                for(int i = 0 ; i < NUM_BUFFER_SLOTS; i++ ) {
                    if(i != backBufferSlot && !mSlots[i].dirtyRegion.isEmpty())
                        oldDirtyRegion.orSelf(mSlots[i].dirtyRegion);
                }
            }
            const Region copyback(oldDirtyRegion.subtract(newDirtyRegion));
            if (!copyback.isEmpty())
                copyBlt(backBuffer, frontBuffer, copyback);