diff options
author | Jesse Hall <jessehall@google.com> | 2012-07-02 16:49:28 -0700 |
---|---|---|
committer | Jesse Hall <jessehall@google.com> | 2012-07-02 16:49:28 -0700 |
commit | c5c5a14c06de249d8e0445fd24699e1d9aa04549 (patch) | |
tree | 136f542789aa80830b870a41a8a902ce1993294d /services/surfaceflinger/SurfaceFlinger.cpp | |
parent | dc5b485f74edf2d2f31c62054eb6c180421a3ade (diff) | |
download | frameworks_native-c5c5a14c06de249d8e0445fd24699e1d9aa04549.zip frameworks_native-c5c5a14c06de249d8e0445fd24699e1d9aa04549.tar.gz frameworks_native-c5c5a14c06de249d8e0445fd24699e1d9aa04549.tar.bz2 |
Only set acquire fences on overlay layers
Change-Id: I08e8173f83580de5a4e43a0ba5ea03e5ec6e8782
Diffstat (limited to 'services/surfaceflinger/SurfaceFlinger.cpp')
-rw-r--r-- | services/surfaceflinger/SurfaceFlinger.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp index 6dfbe5b..3b2bf00 100644 --- a/services/surfaceflinger/SurfaceFlinger.cpp +++ b/services/surfaceflinger/SurfaceFlinger.cpp @@ -528,12 +528,25 @@ void SurfaceFlinger::postFramebuffer() // h/w composer. const DisplayHardware& hw(getDefaultDisplayHardware()); + HWComposer& hwc(hw.getHwComposer()); + size_t numLayers = mVisibleLayersSortedByZ.size(); const nsecs_t now = systemTime(); mDebugInSwapBuffers = now; + + if (hwc.initCheck() == NO_ERROR) { + HWComposer::LayerListIterator cur = hwc.begin(); + const HWComposer::LayerListIterator end = hwc.end(); + for (size_t i = 0; cur != end && i < numLayers; ++i, ++cur) { + if (cur->getCompositionType() == HWC_OVERLAY) { + mVisibleLayersSortedByZ[i]->setAcquireFence(*cur); + } else { + cur->setAcquireFenceFd(-1); + } + } + } + hw.flip(mSwapRegion); - size_t numLayers = mVisibleLayersSortedByZ.size(); - HWComposer& hwc(hw.getHwComposer()); if (hwc.initCheck() == NO_ERROR) { HWComposer::LayerListIterator cur = hwc.begin(); const HWComposer::LayerListIterator end = hwc.end(); |