diff options
| author | 2015-11-23 21:00:43 +0000 | |
|---|---|---|
| committer | 2015-11-23 21:00:43 +0000 | |
| commit | e0c44ed2625f28533736b91a1922b71c53803ab0 (patch) | |
| tree | 6349d34783f8b8b0ae53210e665efe1eccc21a08 | |
| parent | bd6a46d44cc950c49e94bb242a8ac7e3c4cf08cb (diff) | |
| parent | 33fcc2ecf707bfa15360d6d3ec95c778423d3032 (diff) | |
Merge "Don't generate EGL fence in single buffer mode"
| -rw-r--r-- | libs/gui/GLConsumer.cpp | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/libs/gui/GLConsumer.cpp b/libs/gui/GLConsumer.cpp index 83e4d66412..39a7ae39d5 100644 --- a/libs/gui/GLConsumer.cpp +++ b/libs/gui/GLConsumer.cpp @@ -408,15 +408,17 @@ status_t GLConsumer::updateAndReleaseLocked(const BufferItem& item) } // Do whatever sync ops we need to do before releasing the old slot. - err = syncForReleaseLocked(mEglDisplay); - if (err != NO_ERROR) { - // Release the buffer we just acquired. It's not safe to - // release the old buffer, so instead we just drop the new frame. - // As we are still under lock since acquireBuffer, it is safe to - // release by slot. - releaseBufferLocked(slot, mSlots[slot].mGraphicBuffer, - mEglDisplay, EGL_NO_SYNC_KHR); - return err; + if (!item.mSingleBufferMode || slot != mCurrentTexture) { + err = syncForReleaseLocked(mEglDisplay); + if (err != NO_ERROR) { + // Release the buffer we just acquired. It's not safe to + // release the old buffer, so instead we just drop the new frame. + // As we are still under lock since acquireBuffer, it is safe to + // release by slot. + releaseBufferLocked(slot, mSlots[slot].mGraphicBuffer, + mEglDisplay, EGL_NO_SYNC_KHR); + return err; + } } GLC_LOGV("updateAndRelease: (slot=%d buf=%p) -> (slot=%d buf=%p)", |