summaryrefslogtreecommitdiffstats
path: root/libs/gui
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2013-07-16 02:17:58 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-07-16 02:17:58 +0000
commit7f069d79e7f04192610ef93901c89835fea46444 (patch)
treef54b8510204d157278766f302f7088806d6ca942 /libs/gui
parent7556c37b1c1ddd82801bc9ea4cea1ade4d380a98 (diff)
parent8f938a53385a3c6d1c6aa24b3f38437bb2cc47ae (diff)
downloadframeworks_native-7f069d79e7f04192610ef93901c89835fea46444.zip
frameworks_native-7f069d79e7f04192610ef93901c89835fea46444.tar.gz
frameworks_native-7f069d79e7f04192610ef93901c89835fea46444.tar.bz2
Merge "always pass the BufferQueue explicitely to consumers"
Diffstat (limited to 'libs/gui')
-rw-r--r--libs/gui/BufferItemConsumer.cpp6
-rw-r--r--libs/gui/CpuConsumer.cpp5
-rw-r--r--libs/gui/GLConsumer.cpp6
-rw-r--r--libs/gui/SurfaceComposerClient.cpp3
-rw-r--r--libs/gui/tests/CpuConsumer_test.cpp3
-rw-r--r--libs/gui/tests/SurfaceTextureClient_test.cpp6
-rw-r--r--libs/gui/tests/SurfaceTexture_test.cpp6
7 files changed, 21 insertions, 14 deletions
diff --git a/libs/gui/BufferItemConsumer.cpp b/libs/gui/BufferItemConsumer.cpp
index 8d86c59..f5b2c7e 100644
--- a/libs/gui/BufferItemConsumer.cpp
+++ b/libs/gui/BufferItemConsumer.cpp
@@ -29,9 +29,9 @@
namespace android {
-BufferItemConsumer::BufferItemConsumer(uint32_t consumerUsage,
- int bufferCount, bool synchronousMode) :
- ConsumerBase(new BufferQueue(true) )
+BufferItemConsumer::BufferItemConsumer(const sp<BufferQueue>& bq,
+ uint32_t consumerUsage, int bufferCount, bool synchronousMode) :
+ ConsumerBase(bq)
{
mBufferQueue->setConsumerUsageBits(consumerUsage);
mBufferQueue->setSynchronousMode(synchronousMode);
diff --git a/libs/gui/CpuConsumer.cpp b/libs/gui/CpuConsumer.cpp
index 56bc7c6..adddfc2 100644
--- a/libs/gui/CpuConsumer.cpp
+++ b/libs/gui/CpuConsumer.cpp
@@ -30,8 +30,9 @@
namespace android {
-CpuConsumer::CpuConsumer(uint32_t maxLockedBuffers, bool synchronousMode) :
- ConsumerBase(new BufferQueue(true) ),
+CpuConsumer::CpuConsumer(const sp<BufferQueue>& bq,
+ uint32_t maxLockedBuffers, bool synchronousMode) :
+ ConsumerBase(bq),
mMaxLockedBuffers(maxLockedBuffers),
mCurrentLockedBuffers(0)
{
diff --git a/libs/gui/GLConsumer.cpp b/libs/gui/GLConsumer.cpp
index d12083f..07f27c3 100644
--- a/libs/gui/GLConsumer.cpp
+++ b/libs/gui/GLConsumer.cpp
@@ -78,9 +78,9 @@ static float mtxRot90[16] = {
static void mtxMul(float out[16], const float a[16], const float b[16]);
-GLConsumer::GLConsumer(GLuint tex, bool allowSynchronousMode,
- GLenum texTarget, bool useFenceSync, const sp<BufferQueue> &bufferQueue) :
- ConsumerBase(bufferQueue == 0 ? new BufferQueue(allowSynchronousMode) : bufferQueue),
+GLConsumer::GLConsumer(const sp<BufferQueue>& bq, GLuint tex,
+ GLenum texTarget, bool useFenceSync) :
+ ConsumerBase(bq),
mCurrentTransform(0),
mCurrentScalingMode(NATIVE_WINDOW_SCALING_MODE_FREEZE),
mCurrentFence(Fence::NO_FENCE),
diff --git a/libs/gui/SurfaceComposerClient.cpp b/libs/gui/SurfaceComposerClient.cpp
index f345df8..94f21b6 100644
--- a/libs/gui/SurfaceComposerClient.cpp
+++ b/libs/gui/SurfaceComposerClient.cpp
@@ -633,7 +633,8 @@ ScreenshotClient::~ScreenshotClient() {
sp<CpuConsumer> ScreenshotClient::getCpuConsumer() const {
if (mCpuConsumer == NULL) {
- mCpuConsumer = new CpuConsumer(1);
+ sp<BufferQueue> bq = new BufferQueue();
+ mCpuConsumer = new CpuConsumer(bq, 1);
mCpuConsumer->setName(String8("ScreenshotClient"));
}
return mCpuConsumer;
diff --git a/libs/gui/tests/CpuConsumer_test.cpp b/libs/gui/tests/CpuConsumer_test.cpp
index 73fdd04..f8a35b4 100644
--- a/libs/gui/tests/CpuConsumer_test.cpp
+++ b/libs/gui/tests/CpuConsumer_test.cpp
@@ -66,7 +66,8 @@ protected:
test_info->name(),
params.width, params.height,
params.maxLockedBuffers, params.format);
- mCC = new CpuConsumer(params.maxLockedBuffers);
+ sp<BufferQueue> bq = new BufferQueue();
+ mCC = new CpuConsumer(bq, params.maxLockedBuffers);
String8 name("CpuConsumer_Under_Test");
mCC->setName(name);
mSTC = new Surface(mCC->getProducerInterface());
diff --git a/libs/gui/tests/SurfaceTextureClient_test.cpp b/libs/gui/tests/SurfaceTextureClient_test.cpp
index 7376b4c..46bcb22 100644
--- a/libs/gui/tests/SurfaceTextureClient_test.cpp
+++ b/libs/gui/tests/SurfaceTextureClient_test.cpp
@@ -40,7 +40,8 @@ protected:
ALOGV("Begin test: %s.%s", testInfo->test_case_name(),
testInfo->name());
- mST = new GLConsumer(123);
+ sp<BufferQueue> bq = new BufferQueue();
+ mST = new GLConsumer(bq, 123);
mSTC = new Surface(mST->getBufferQueue());
mANW = mSTC;
@@ -715,7 +716,8 @@ protected:
ASSERT_NE(EGL_NO_CONTEXT, mEglContext);
for (int i = 0; i < NUM_SURFACE_TEXTURES; i++) {
- sp<GLConsumer> st(new GLConsumer(i));
+ sp<BufferQueue> bq = new BufferQueue();
+ sp<GLConsumer> st(new GLConsumer(bq, i));
sp<Surface> stc(new Surface(st->getBufferQueue()));
mEglSurfaces[i] = eglCreateWindowSurface(mEglDisplay, myConfig,
static_cast<ANativeWindow*>(stc.get()), NULL);
diff --git a/libs/gui/tests/SurfaceTexture_test.cpp b/libs/gui/tests/SurfaceTexture_test.cpp
index dd6c435..d97521a 100644
--- a/libs/gui/tests/SurfaceTexture_test.cpp
+++ b/libs/gui/tests/SurfaceTexture_test.cpp
@@ -385,7 +385,8 @@ protected:
virtual void SetUp() {
GLTest::SetUp();
- mGlConsumer = new GLConsumer(TEX_ID);
+ sp<BufferQueue> bq = new BufferQueue();
+ mGlConsumer = new GLConsumer(bq, TEX_ID);
mSurface = new Surface(mGlConsumer->getBufferQueue());
mANW = mSurface.get();
@@ -479,7 +480,8 @@ protected:
virtual void SetUp() {
GLTest::SetUp();
- mST = new GLConsumer(TEX_ID);
+ sp<BufferQueue> bq = new BufferQueue();
+ mST = new GLConsumer(bq, TEX_ID);
mSTC = new Surface(mST->getBufferQueue());
mANW = mSTC;
mTextureRenderer = new TextureRenderer(TEX_ID, mST);