diff options
author | Mathias Agopian <mathias@google.com> | 2011-09-01 18:52:12 -0700 |
---|---|---|
committer | Mathias Agopian <mathias@google.com> | 2011-09-01 18:56:54 -0700 |
commit | ff57415bdb4590478f294f7b45805f80d2aac441 (patch) | |
tree | 7be8b438e079f1917c866b38ad440a121305f4d5 /services/surfaceflinger | |
parent | 2523a6016a9a3d5626e041aa742e982870aecd5d (diff) | |
download | frameworks_base-ff57415bdb4590478f294f7b45805f80d2aac441.zip frameworks_base-ff57415bdb4590478f294f7b45805f80d2aac441.tar.gz frameworks_base-ff57415bdb4590478f294f7b45805f80d2aac441.tar.bz2 |
Fix various flickering / artifacts
these were due to the "preserve backbuffer" optimization
interfering with hw composer. basically the screen needed
to be redrawn in the areas that move from GL to
overlay.
Bug: 5245513
Change-Id: I9bf75c4fe905f3ef62005e52108b94edae692304
Diffstat (limited to 'services/surfaceflinger')
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 598220f..b4c5dec 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -817,6 +817,20 @@ void SurfaceFlinger::handleWorkList() mHwWorkListDirty = false; HWComposer& hwc(graphicPlane(0).displayHardware().getHwComposer()); if (hwc.initCheck() == NO_ERROR) { + + const DisplayHardware& hw(graphicPlane(0).displayHardware()); + uint32_t flags = hw.getFlags(); + if ((flags & DisplayHardware::SWAP_RECTANGLE) || + (flags & DisplayHardware::BUFFER_PRESERVED)) + { + // we need to redraw everything (the whole screen) + // NOTE: we could be more subtle here and redraw only + // the area which will end-up in an overlay. But since this + // shouldn't happen often, we invalidate everything. + mDirtyRegion.set(hw.bounds()); + mInvalidRegion = mDirtyRegion; + } + const Vector< sp<LayerBase> >& currentLayers(mVisibleLayersSortedByZ); const size_t count = currentLayers.size(); hwc.createWorkList(count); |