bool GonkNativeWindow::returnBuffer(uint32_t aIndex, uint32_t aGeneration) { BI_LOGD("GonkNativeWindow::returnBuffer: slot=%d (generation=%d)", aIndex, aGeneration); Mutex::Autolock lock(mMutex); if (aGeneration != mBufferQueue->getGeneration()) { BI_LOGD("returnBuffer: buffer is from generation %d (current is %d)", aGeneration, mBufferQueue->getGeneration()); return false; } status_t err = releaseBufferLocked(aIndex); if (err != NO_ERROR) { return false; } return true; }
bool GonkNativeWindow::returnBuffer(uint32_t index, uint32_t generation, const sp<Fence>& fence) { BI_LOGD("GonkNativeWindow::returnBuffer: slot=%d (generation=%d)", index, generation); Mutex::Autolock lock(mMutex); if (generation != mBufferQueue->getGeneration()) { BI_LOGD("returnBuffer: buffer is from generation %d (current is %d)", generation, mBufferQueue->getGeneration()); return false; } status_t err; err = addReleaseFenceLocked(index, fence); err = releaseBufferLocked(index); if (err != NO_ERROR) { return false; } return true; }
void GonkNativeWindow::returnBuffer(TextureClient* client) { BI_LOGD("GonkNativeWindow::returnBuffer"); Mutex::Autolock lock(mMutex); int index = mBufferQueue->getSlotFromTextureClientLocked(client); if (index < 0) { } sp<Fence> fence = client->GetReleaseFenceHandle().mFence; if (!fence.get()) { fence = Fence::NO_FENCE; } status_t err; err = addReleaseFenceLocked(index, fence); err = releaseBufferLocked(index); }
void GonkNativeWindow::setNewFrameCallback( GonkNativeWindowNewFrameCallback* aCallback) { BI_LOGD("setNewFrameCallback"); Mutex::Autolock lock(mMutex); mNewFrameCallback = aCallback; }