Skip to content

Commit a55c369

Browse files
pixelflingerAndroid (Google) Code Review
authored andcommitted
Merge "Fix various flickering / artifacts"
2 parents 17b0317 + ff57415 commit a55c369

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

services/surfaceflinger/SurfaceFlinger.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,20 @@ void SurfaceFlinger::handleWorkList()
817817
mHwWorkListDirty = false;
818818
HWComposer& hwc(graphicPlane(0).displayHardware().getHwComposer());
819819
if (hwc.initCheck() == NO_ERROR) {
820+
821+
const DisplayHardware& hw(graphicPlane(0).displayHardware());
822+
uint32_t flags = hw.getFlags();
823+
if ((flags & DisplayHardware::SWAP_RECTANGLE) ||
824+
(flags & DisplayHardware::BUFFER_PRESERVED))
825+
{
826+
// we need to redraw everything (the whole screen)
827+
// NOTE: we could be more subtle here and redraw only
828+
// the area which will end-up in an overlay. But since this
829+
// shouldn't happen often, we invalidate everything.
830+
mDirtyRegion.set(hw.bounds());
831+
mInvalidRegion = mDirtyRegion;
832+
}
833+
820834
const Vector< sp<LayerBase> >& currentLayers(mVisibleLayersSortedByZ);
821835
const size_t count = currentLayers.size();
822836
hwc.createWorkList(count);

0 commit comments

Comments
 (0)