Loading include/gui/IGraphicBufferProducer.h +2 −6 Original line number Diff line number Diff line Loading @@ -113,14 +113,10 @@ public: // allow for the asynchronous behavior. If it is not enabled queue/dequeue // calls may block. // // This function should not be called when there are any currently dequeued // buffer slots, doing so will result in a BAD_VALUE error. // // Return of a value other than NO_ERROR means an error has occurred: // * NO_INIT - the buffer queue has been abandoned. // * BAD_VALUE - one of the below conditions occurred: // * client has one or more buffers dequeued // * this call would cause the maxBufferCount value to be exceeded // * BAD_VALUE - this call would cause the maxBufferCount value to be // exceeded virtual status_t setAsyncMode(bool async) = 0; // dequeueBuffer requests a new buffer slot for the client to use. Ownership Loading libs/gui/BufferQueueProducer.cpp +0 −8 Original line number Diff line number Diff line Loading @@ -159,14 +159,6 @@ status_t BufferQueueProducer::setAsyncMode(bool async) { return NO_INIT; } // There must be no dequeued buffers when changing the async mode. for (int s = 0; s < BufferQueueDefs::NUM_BUFFER_SLOTS; ++s) { if (mSlots[s].mBufferState == BufferSlot::DEQUEUED) { BQ_LOGE("setAsyncMode: buffer owned by producer"); return BAD_VALUE; } } if ((mCore->mMaxAcquiredBufferCount + mCore->mMaxDequeuedBufferCount + (async || mCore->mDequeueBufferCannotBlock ? 1 : 0)) > mCore->mMaxBufferCount) { Loading libs/gui/tests/IGraphicBufferProducer_test.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -616,10 +616,6 @@ TEST_F(IGraphicBufferProducerTest, SetAsyncMode_Fails) { TEST_PRODUCER_USAGE_BITS))) << "slot: " << dequeuedSlot; } // Client has one or more buffers dequeued EXPECT_EQ(BAD_VALUE, mProducer->setAsyncMode(false)) << "asyncMode: " << false; // Abandon buffer queue ASSERT_OK(mConsumer->consumerDisconnect()); Loading libs/gui/tests/SurfaceTextureGLThreadToGL_test.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ TEST_F(SurfaceTextureGLThreadToGLTest, } }; SetUpWindowAndContext(); runProducerThread(new PT()); mFC->waitForFrame(); Loading @@ -50,6 +52,8 @@ TEST_F(SurfaceTextureGLThreadToGLTest, } }; SetUpWindowAndContext(); runProducerThread(new PT()); mFC->waitForFrame(); Loading @@ -75,6 +79,8 @@ TEST_F(SurfaceTextureGLThreadToGLTest, } }; SetUpWindowAndContext(); runProducerThread(new PT()); for (int i = 0; i < NUM_ITERATIONS; i++) { Loading Loading @@ -104,6 +110,8 @@ TEST_F(SurfaceTextureGLThreadToGLTest, } }; SetUpWindowAndContext(); runProducerThread(new PT()); for (int i = 0; i < NUM_ITERATIONS; i++) { Loading Loading @@ -134,6 +142,8 @@ TEST_F(SurfaceTextureGLThreadToGLTest, } }; SetUpWindowAndContext(); runProducerThread(new PT()); // Allow three frames to be rendered and queued before starting the Loading libs/gui/tests/SurfaceTextureGLToGL.h +2 −0 Original line number Diff line number Diff line Loading @@ -34,7 +34,9 @@ protected: virtual void SetUp() { SurfaceTextureGLTest::SetUp(); } void SetUpWindowAndContext() { mProducerEglSurface = eglCreateWindowSurface(mEglDisplay, mGlConfig, mANW.get(), NULL); ASSERT_EQ(EGL_SUCCESS, eglGetError()); Loading Loading
include/gui/IGraphicBufferProducer.h +2 −6 Original line number Diff line number Diff line Loading @@ -113,14 +113,10 @@ public: // allow for the asynchronous behavior. If it is not enabled queue/dequeue // calls may block. // // This function should not be called when there are any currently dequeued // buffer slots, doing so will result in a BAD_VALUE error. // // Return of a value other than NO_ERROR means an error has occurred: // * NO_INIT - the buffer queue has been abandoned. // * BAD_VALUE - one of the below conditions occurred: // * client has one or more buffers dequeued // * this call would cause the maxBufferCount value to be exceeded // * BAD_VALUE - this call would cause the maxBufferCount value to be // exceeded virtual status_t setAsyncMode(bool async) = 0; // dequeueBuffer requests a new buffer slot for the client to use. Ownership Loading
libs/gui/BufferQueueProducer.cpp +0 −8 Original line number Diff line number Diff line Loading @@ -159,14 +159,6 @@ status_t BufferQueueProducer::setAsyncMode(bool async) { return NO_INIT; } // There must be no dequeued buffers when changing the async mode. for (int s = 0; s < BufferQueueDefs::NUM_BUFFER_SLOTS; ++s) { if (mSlots[s].mBufferState == BufferSlot::DEQUEUED) { BQ_LOGE("setAsyncMode: buffer owned by producer"); return BAD_VALUE; } } if ((mCore->mMaxAcquiredBufferCount + mCore->mMaxDequeuedBufferCount + (async || mCore->mDequeueBufferCannotBlock ? 1 : 0)) > mCore->mMaxBufferCount) { Loading
libs/gui/tests/IGraphicBufferProducer_test.cpp +0 −4 Original line number Diff line number Diff line Loading @@ -616,10 +616,6 @@ TEST_F(IGraphicBufferProducerTest, SetAsyncMode_Fails) { TEST_PRODUCER_USAGE_BITS))) << "slot: " << dequeuedSlot; } // Client has one or more buffers dequeued EXPECT_EQ(BAD_VALUE, mProducer->setAsyncMode(false)) << "asyncMode: " << false; // Abandon buffer queue ASSERT_OK(mConsumer->consumerDisconnect()); Loading
libs/gui/tests/SurfaceTextureGLThreadToGL_test.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -31,6 +31,8 @@ TEST_F(SurfaceTextureGLThreadToGLTest, } }; SetUpWindowAndContext(); runProducerThread(new PT()); mFC->waitForFrame(); Loading @@ -50,6 +52,8 @@ TEST_F(SurfaceTextureGLThreadToGLTest, } }; SetUpWindowAndContext(); runProducerThread(new PT()); mFC->waitForFrame(); Loading @@ -75,6 +79,8 @@ TEST_F(SurfaceTextureGLThreadToGLTest, } }; SetUpWindowAndContext(); runProducerThread(new PT()); for (int i = 0; i < NUM_ITERATIONS; i++) { Loading Loading @@ -104,6 +110,8 @@ TEST_F(SurfaceTextureGLThreadToGLTest, } }; SetUpWindowAndContext(); runProducerThread(new PT()); for (int i = 0; i < NUM_ITERATIONS; i++) { Loading Loading @@ -134,6 +142,8 @@ TEST_F(SurfaceTextureGLThreadToGLTest, } }; SetUpWindowAndContext(); runProducerThread(new PT()); // Allow three frames to be rendered and queued before starting the Loading
libs/gui/tests/SurfaceTextureGLToGL.h +2 −0 Original line number Diff line number Diff line Loading @@ -34,7 +34,9 @@ protected: virtual void SetUp() { SurfaceTextureGLTest::SetUp(); } void SetUpWindowAndContext() { mProducerEglSurface = eglCreateWindowSurface(mEglDisplay, mGlConfig, mANW.get(), NULL); ASSERT_EQ(EGL_SUCCESS, eglGetError()); Loading