Remove deprecated BufferQueue constructor

Bug: 13415624
Change-Id: I153b5470b21832cebe3c617d28a4ab9c9bf3b362
This commit is contained in:
Dan Stoza 2014-04-07 13:41:37 -07:00
parent fc9aeb8590
commit 5603a2fbbd
9 changed files with 49 additions and 37 deletions

View File

@ -64,11 +64,13 @@ protected:
test_info->name(),
params.width, params.height,
params.maxLockedBuffers, params.format);
sp<BufferQueue> bq = new BufferQueue();
mCC = new CpuConsumer(bq, params.maxLockedBuffers);
sp<IGraphicBufferProducer> producer;
sp<IGraphicBufferConsumer> consumer;
BufferQueue::createBufferQueue(&producer, &consumer);
mCC = new CpuConsumer(consumer, params.maxLockedBuffers);
String8 name("CpuConsumer_Under_Test");
mCC->setName(name);
mSTC = new Surface(bq);
mSTC = new Surface(producer);
mANW = mSTC;
}

View File

@ -80,11 +80,9 @@ protected:
ALOGV("Begin test: %s.%s", testInfo->test_case_name(),
testInfo->name());
mBQ = new BufferQueue();
mDC = new DummyConsumer;
mProducer = mBQ;
mConsumer = mBQ;
BufferQueue::createBufferQueue(&mProducer, &mConsumer);
// Test check: Can't connect producer if no consumer yet
ASSERT_EQ(NO_INIT, TryConnectProducer());
@ -201,7 +199,6 @@ protected:
}
private: // hide from test body
sp<BufferQueue> mBQ;
sp<DummyConsumer> mDC;
protected: // accessible from test body

View File

@ -34,9 +34,11 @@ protected:
virtual void SetUp() {
GLTest::SetUp();
sp<BufferQueue> bq = new BufferQueue();
mGlConsumer = new GLConsumer(bq, TEX_ID);
mSurface = new Surface(bq);
sp<IGraphicBufferProducer> producer;
sp<IGraphicBufferConsumer> consumer;
BufferQueue::createBufferQueue(&producer, &consumer);
mGlConsumer = new GLConsumer(consumer, TEX_ID);
mSurface = new Surface(producer);
mANW = mSurface.get();
}

View File

@ -68,13 +68,15 @@ protected:
}
virtual void SetUp() {
mBufferQueue = new BufferQueue();
ASSERT_EQ(NO_ERROR, mBufferQueue->setDefaultBufferSize(
sp<IGraphicBufferProducer> producer;
sp<IGraphicBufferConsumer> consumer;
BufferQueue::createBufferQueue(&producer, &consumer);
ASSERT_EQ(NO_ERROR, consumer->setDefaultBufferSize(
DISPLAY_WIDTH, DISPLAY_HEIGHT));
mCpuConsumer = new CpuConsumer(mBufferQueue, 1);
mCpuConsumer = new CpuConsumer(consumer, 1);
String8 name("CpuConsumer_for_SRGBTest");
mCpuConsumer->setName(name);
mInputSurface = new Surface(mBufferQueue);
mInputSurface = new Surface(producer);
ASSERT_NO_FATAL_FAILURE(createEGLSurface(mInputSurface.get()));
ASSERT_NO_FATAL_FAILURE(createDebugSurface());
@ -222,7 +224,6 @@ protected:
}
// Primary producer and consumer
sp<BufferQueue> mBufferQueue;
sp<Surface> mInputSurface;
sp<CpuConsumer> mCpuConsumer;
CpuConsumer::LockedBuffer mLockedBuffer;

View File

@ -43,9 +43,11 @@ protected:
ALOGV("Begin test: %s.%s", testInfo->test_case_name(),
testInfo->name());
sp<BufferQueue> bq = new BufferQueue();
mST = new GLConsumer(bq, 123);
mSTC = new Surface(bq);
sp<IGraphicBufferProducer> producer;
sp<IGraphicBufferConsumer> consumer;
BufferQueue::createBufferQueue(&producer, &consumer);
mST = new GLConsumer(consumer, 123);
mSTC = new Surface(producer);
mANW = mSTC;
// We need a valid GL context so we can test updateTexImage()
@ -711,9 +713,11 @@ protected:
ASSERT_NE(EGL_NO_CONTEXT, mEglContext);
for (int i = 0; i < NUM_SURFACE_TEXTURES; i++) {
sp<BufferQueue> bq = new BufferQueue();
sp<GLConsumer> st(new GLConsumer(bq, i));
sp<Surface> stc(new Surface(bq));
sp<IGraphicBufferProducer> producer;
sp<IGraphicBufferConsumer> consumer;
BufferQueue::createBufferQueue(&producer, &consumer);
sp<GLConsumer> st(new GLConsumer(consumer, i));
sp<Surface> stc(new Surface(producer));
mEglSurfaces[i] = eglCreateWindowSurface(mEglDisplay, myConfig,
static_cast<ANativeWindow*>(stc.get()), NULL);
ASSERT_EQ(EGL_SUCCESS, eglGetError());

View File

@ -37,10 +37,10 @@ protected:
void SetUp() {
GLTest::SetUp();
sp<BufferQueue> bq = new BufferQueue();
mBQ = bq;
mST = new GLConsumer(bq, TEX_ID);
mSTC = new Surface(bq);
sp<IGraphicBufferProducer> producer;
BufferQueue::createBufferQueue(&producer, &mConsumer);
mST = new GLConsumer(mConsumer, TEX_ID);
mSTC = new Surface(producer);
mANW = mSTC;
mTextureRenderer = new TextureRenderer(TEX_ID, mST);
ASSERT_NO_FATAL_FAILURE(mTextureRenderer->SetUp());
@ -60,7 +60,7 @@ protected:
mTextureRenderer->drawTexture();
}
sp<BufferQueue> mBQ;
sp<IGraphicBufferConsumer> mConsumer;
sp<GLConsumer> mST;
sp<Surface> mSTC;
sp<ANativeWindow> mANW;

View File

@ -451,7 +451,7 @@ TEST_F(SurfaceTextureGLTest, DisconnectStressTest) {
};
sp<DisconnectWaiter> dw(new DisconnectWaiter());
mBQ->consumerConnect(dw, false);
mConsumer->consumerConnect(dw, false);
sp<Thread> pt(new ProducerThread(mANW));

View File

@ -88,11 +88,13 @@ TEST_F(SurfaceTest, ScreenshotsOfProtectedBuffersSucceed) {
sp<ANativeWindow> anw(mSurface);
// Verify the screenshot works with no protected buffers.
sp<BufferQueue> bq = new BufferQueue();
sp<CpuConsumer> consumer = new CpuConsumer(bq, 1);
sp<IGraphicBufferProducer> producer;
sp<IGraphicBufferConsumer> consumer;
BufferQueue::createBufferQueue(&producer, &consumer);
sp<CpuConsumer> cpuConsumer = new CpuConsumer(consumer, 1);
sp<ISurfaceComposer> sf(ComposerService::getComposerService());
sp<IBinder> display(sf->getBuiltInDisplay(ISurfaceComposer::eDisplayIdMain));
ASSERT_EQ(NO_ERROR, sf->captureScreen(display, bq,
ASSERT_EQ(NO_ERROR, sf->captureScreen(display, producer,
64, 64, 0, 0x7fffffff, false));
// Set the PROTECTED usage bit and verify that the screenshot fails. Note
@ -121,7 +123,7 @@ TEST_F(SurfaceTest, ScreenshotsOfProtectedBuffersSucceed) {
&buf));
ASSERT_EQ(NO_ERROR, anw->queueBuffer(anw.get(), buf, -1));
}
ASSERT_EQ(NO_ERROR, sf->captureScreen(display, bq,
ASSERT_EQ(NO_ERROR, sf->captureScreen(display, producer,
64, 64, 0, 0x7fffffff, false));
}
@ -136,10 +138,12 @@ TEST_F(SurfaceTest, ConcreteTypeIsSurface) {
TEST_F(SurfaceTest, QueryConsumerUsage) {
const int TEST_USAGE_FLAGS =
GRALLOC_USAGE_SW_READ_OFTEN | GRALLOC_USAGE_HW_RENDER;
sp<BufferQueue> bq = new BufferQueue();
sp<BufferItemConsumer> c = new BufferItemConsumer(bq,
sp<IGraphicBufferProducer> producer;
sp<IGraphicBufferConsumer> consumer;
BufferQueue::createBufferQueue(&producer, &consumer);
sp<BufferItemConsumer> c = new BufferItemConsumer(consumer,
TEST_USAGE_FLAGS);
sp<Surface> s = new Surface(bq);
sp<Surface> s = new Surface(producer);
sp<ANativeWindow> anw(s);

View File

@ -107,9 +107,11 @@ TEST_F(EGLTest, EGLTerminateSucceedsWithRemainingObjects) {
};
// Create a EGLSurface
sp<BufferQueue> bq = new BufferQueue();
bq->consumerConnect(new DummyConsumer, false);
sp<Surface> mSTC = new Surface(static_cast<sp<IGraphicBufferProducer> >( bq));
sp<IGraphicBufferProducer> producer;
sp<IGraphicBufferConsumer> consumer;
BufferQueue::createBufferQueue(&producer, &consumer);
consumer->consumerConnect(new DummyConsumer, false);
sp<Surface> mSTC = new Surface(producer);
sp<ANativeWindow> mANW = mSTC;
EGLSurface eglSurface = eglCreateWindowSurface(mEglDisplay, config,