libgui: Copyback all region except dirty region for newly allocated buffer
Inside Surface::lock if new buffer is allocated and DirtyRegion does not cover complete buffer bounds then copyback may not cover all remaining area as it copyback only area covered by dirty regions from other buffers. This will lead to left out black area which may cause flicker. Change-Id: I4a3f7a56fc5fbaf4af926584919577d8d34bed57
This commit is contained in:
parent
8760f1673e
commit
a1288c979d
@ -1033,9 +1033,13 @@ status_t Surface::lock(
|
|||||||
if (canCopyBack) {
|
if (canCopyBack) {
|
||||||
Mutex::Autolock lock(mMutex);
|
Mutex::Autolock lock(mMutex);
|
||||||
Region oldDirtyRegion;
|
Region oldDirtyRegion;
|
||||||
for(int i = 0 ; i < NUM_BUFFER_SLOTS; i++ ) {
|
if(mSlots[backBufferSlot].dirtyRegion.isEmpty()) {
|
||||||
if(i != backBufferSlot && !mSlots[i].dirtyRegion.isEmpty())
|
oldDirtyRegion.set(bounds);
|
||||||
oldDirtyRegion.orSelf(mSlots[i].dirtyRegion);
|
} 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));
|
const Region copyback(oldDirtyRegion.subtract(newDirtyRegion));
|
||||||
if (!copyback.isEmpty())
|
if (!copyback.isEmpty())
|
||||||
|
Loading…
Reference in New Issue
Block a user