diff options
author | Dan Stoza <stoza@google.com> | 2015-04-02 13:48:15 -0700 |
---|---|---|
committer | Dan Stoza <stoza@google.com> | 2015-04-02 13:48:15 -0700 |
commit | 921d1d7a61f527b7bbf42e9ba46bd92342cc7c99 (patch) | |
tree | fb87ec51d61e981b1064b5b215d9b38419b1678d /libs | |
parent | f386c961eac36ff1d37b5c448905305b7473e0b1 (diff) | |
download | frameworks_native-921d1d7a61f527b7bbf42e9ba46bd92342cc7c99.zip frameworks_native-921d1d7a61f527b7bbf42e9ba46bd92342cc7c99.tar.gz frameworks_native-921d1d7a61f527b7bbf42e9ba46bd92342cc7c99.tar.bz2 |
Revert "libgui: Plumb attach/detach through CpuConsumer"
This reverts commit 20c5672883796c0dedf38f51dc2fc6f140b09ae6.
Diffstat (limited to 'libs')
-rw-r--r-- | libs/gui/BufferQueueConsumer.cpp | 8 | ||||
-rw-r--r-- | libs/gui/CpuConsumer.cpp | 55 |
2 files changed, 2 insertions, 61 deletions
diff --git a/libs/gui/BufferQueueConsumer.cpp b/libs/gui/BufferQueueConsumer.cpp index c7faeeb..526c3b7 100644 --- a/libs/gui/BufferQueueConsumer.cpp +++ b/libs/gui/BufferQueueConsumer.cpp @@ -247,16 +247,12 @@ status_t BufferQueueConsumer::attachBuffer(int* outSlot, ATRACE_BUFFER_INDEX(*outSlot); BQ_LOGV("attachBuffer(C): returning slot %d", *outSlot); - // If these are modified, they also need to be modified in - // CpuConsumer::attachAndReleaseBuffer mSlots[*outSlot].mGraphicBuffer = buffer; - mSlots[*outSlot].mFence = Fence::NO_FENCE; - mSlots[*outSlot].mFrameNumber = 0; - - // Changes to these do not need to be propagated to CpuConsumer mSlots[*outSlot].mBufferState = BufferSlot::ACQUIRED; mSlots[*outSlot].mAttachedByConsumer = true; mSlots[*outSlot].mNeedsCleanupOnRelease = false; + mSlots[*outSlot].mFence = Fence::NO_FENCE; + mSlots[*outSlot].mFrameNumber = 0; // mAcquireCalled tells BufferQueue that it doesn't need to send a valid // GraphicBuffer pointer on the next acquireBuffer call, which decreases diff --git a/libs/gui/CpuConsumer.cpp b/libs/gui/CpuConsumer.cpp index 1f9c657..eb39469 100644 --- a/libs/gui/CpuConsumer.cpp +++ b/libs/gui/CpuConsumer.cpp @@ -277,59 +277,4 @@ void CpuConsumer::freeBufferLocked(int slotIndex) { ConsumerBase::freeBufferLocked(slotIndex); } -status_t CpuConsumer::detachNextBuffer(BufferItem* outItem) { - if (outItem == NULL) { - return BAD_VALUE; - } - - Mutex::Autolock lock(mMutex); - - BufferItem item; - status_t result = acquireBufferLocked(&item, 0); - if (result != NO_ERROR) { - CC_LOGE("%s: Failed to acquire buffer (%d)", __FUNCTION__, result); - return result; - } - - result = mConsumer->detachBuffer(item.mSlot); - if (result != NO_ERROR) { - CC_LOGE("%s: Failed to detach buffer (%d)", __FUNCTION__, result); - return result; - } - - freeBufferLocked(item.mSlot); - - *outItem = item; - return NO_ERROR; -} - -status_t CpuConsumer::attachAndReleaseBuffer(const sp<GraphicBuffer>& buffer) { - if (buffer == NULL) { - return BAD_VALUE; - } - - Mutex::Autolock lock(mMutex); - - int slot = -1; - status_t result = mConsumer->attachBuffer(&slot, buffer); - if (result != NO_ERROR) { - CC_LOGE("%s: Failed to attach buffer (%d)", __FUNCTION__, result); - return result; - } - - // These behaviors must be kept in sync with - // BufferQueueConsumer::attachBuffer - mSlots[slot].mGraphicBuffer = buffer; - mSlots[slot].mFence = Fence::NO_FENCE; - mSlots[slot].mFrameNumber = 0; - - result = releaseBufferLocked(slot, buffer, EGL_NO_DISPLAY, EGL_NO_SYNC_KHR); - if (result != NO_ERROR) { - CC_LOGE("%s: Failed to release buffer (%d)", __FUNCTION__, result); - return result; - } - - return NO_ERROR; -} - } // namespace android |