diff options
| author | 2016-01-12 13:49:19 -0800 | |
|---|---|---|
| committer | 2016-02-02 11:15:47 -0800 | |
| commit | 9e314337cdc65b1fbf52060e9a6a4ddf2215c352 (patch) | |
| tree | fa3ac98f0e8fc8582224f4e0570ca0e592ec47ba /libs/gui/BufferQueueConsumer.cpp | |
| parent | 23b4abe024ea88c45e0b94c80e1fb537a573b143 (diff) | |
BQ: Conditionally compile validateConsistencyLocked
- Only enable it on userdebug and eng builds so that it won't slow
down user builds.
Change-Id: I70933a23d54657fdf5cbc23873da4fbee84b9a26
Diffstat (limited to 'libs/gui/BufferQueueConsumer.cpp')
| -rw-r--r-- | libs/gui/BufferQueueConsumer.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/libs/gui/BufferQueueConsumer.cpp b/libs/gui/BufferQueueConsumer.cpp index d182f6b788..9c1bbe4211 100644 --- a/libs/gui/BufferQueueConsumer.cpp +++ b/libs/gui/BufferQueueConsumer.cpp @@ -20,6 +20,12 @@ #define ATRACE_TAG ATRACE_TAG_GRAPHICS //#define LOG_NDEBUG 0 +#if DEBUG_ONLY_CODE +#define VALIDATE_CONSISTENCY() do { mCore->validateConsistencyLocked(); } while (0) +#else +#define VALIDATE_CONSISTENCY() +#endif + #include <gui/BufferItem.h> #include <gui/BufferQueueConsumer.h> #include <gui/BufferQueueCore.h> @@ -252,7 +258,7 @@ status_t BufferQueueConsumer::acquireBuffer(BufferItem* outBuffer, ATRACE_INT(mCore->mConsumerName.string(), mCore->mQueue.size()); - mCore->validateConsistencyLocked(); + VALIDATE_CONSISTENCY(); } if (listener != NULL) { @@ -296,7 +302,7 @@ status_t BufferQueueConsumer::detachBuffer(int slot) { mCore->mFreeSlots.insert(slot); mCore->clearBufferSlotLocked(slot); mCore->mDequeueCondition.broadcast(); - mCore->validateConsistencyLocked(); + VALIDATE_CONSISTENCY(); return NO_ERROR; } @@ -386,7 +392,7 @@ status_t BufferQueueConsumer::attachBuffer(int* outSlot, // for attached buffers. mSlots[*outSlot].mAcquireCalled = false; - mCore->validateConsistencyLocked(); + VALIDATE_CONSISTENCY(); return NO_ERROR; } @@ -446,7 +452,7 @@ status_t BufferQueueConsumer::releaseBuffer(int slot, uint64_t frameNumber, BQ_LOGV("releaseBuffer: releasing slot %d", slot); mCore->mDequeueCondition.broadcast(); - mCore->validateConsistencyLocked(); + VALIDATE_CONSISTENCY(); } // Autolock scope // Call back without lock held @@ -633,7 +639,7 @@ status_t BufferQueueConsumer::setMaxAcquiredBufferCount( BQ_LOGV("setMaxAcquiredBufferCount: %d", maxAcquiredBuffers); mCore->mMaxAcquiredBufferCount = maxAcquiredBuffers; - mCore->validateConsistencyLocked(); + VALIDATE_CONSISTENCY(); return NO_ERROR; } |