diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp index 444544221..1abb6c375 100644 --- a/libs/gui/Surface.cpp +++ b/libs/gui/Surface.cpp @@ -1033,9 +1033,13 @@ status_t Surface::lock( if (canCopyBack) { Mutex::Autolock lock(mMutex); Region oldDirtyRegion; - for(int i = 0 ; i < NUM_BUFFER_SLOTS; i++ ) { - if(i != backBufferSlot && !mSlots[i].dirtyRegion.isEmpty()) - oldDirtyRegion.orSelf(mSlots[i].dirtyRegion); + 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())