diff options
author | Baldev Sahu <bsahu@codeaurora.org> | 2015-01-23 14:00:34 +0530 |
---|---|---|
committer | Linux Build Service Account <lnxbuild@localhost> | 2015-10-06 03:22:27 -0600 |
commit | a1288c979df92ab7b1a8cae7e0710cda3451c8df (patch) | |
tree | 2ba73482591a9aaf9c665973488c4d4199d72046 | |
parent | 8760f1673ea9c2aca0181827808cbd6981a5a2ee (diff) | |
download | frameworks_native-a1288c979df92ab7b1a8cae7e0710cda3451c8df.zip frameworks_native-a1288c979df92ab7b1a8cae7e0710cda3451c8df.tar.gz frameworks_native-a1288c979df92ab7b1a8cae7e0710cda3451c8df.tar.bz2 |
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
-rw-r--r-- | libs/gui/Surface.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/libs/gui/Surface.cpp b/libs/gui/Surface.cpp index 4445442..1abb6c3 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()) |