summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDan Stoza <stoza@google.com>2014-06-24 13:09:19 -0700
committerDan Stoza <stoza@google.com>2014-06-24 13:09:19 -0700
commite49ba8e2ed8e17156eb00c8fc8e2285df62bc018 (patch)
tree75c16e16f849b08d9f377c75bad708d6510e7388
parentb410863d6aae1e923ff163942adef01ff6a2ea81 (diff)
downloadframeworks_native-e49ba8e2ed8e17156eb00c8fc8e2285df62bc018.zip
frameworks_native-e49ba8e2ed8e17156eb00c8fc8e2285df62bc018.tar.gz
frameworks_native-e49ba8e2ed8e17156eb00c8fc8e2285df62bc018.tar.bz2
GLConsumer: Stop using default constructor params
Removes the dependency on default constructor parameters for GLConsumer so that a different constructor prototype can safely be added. Change-Id: I0da924bbd4c141edbf305598c1be8bc575654680
-rw-r--r--cmds/flatland/GLHelper.cpp2
-rw-r--r--include/gui/GLConsumer.h7
-rw-r--r--libs/gui/tests/MultiTextureConsumer_test.cpp3
-rw-r--r--libs/gui/tests/SurfaceTextureClient_test.cpp6
-rw-r--r--libs/gui/tests/SurfaceTextureGL.h3
-rw-r--r--services/surfaceflinger/SurfaceFlingerConsumer.h2
6 files changed, 13 insertions, 10 deletions
diff --git a/cmds/flatland/GLHelper.cpp b/cmds/flatland/GLHelper.cpp
index 4b5aba9..3155766 100644
--- a/cmds/flatland/GLHelper.cpp
+++ b/cmds/flatland/GLHelper.cpp
@@ -205,7 +205,7 @@ bool GLHelper::createNamedSurfaceTexture(GLuint name, uint32_t w, uint32_t h,
sp<IGraphicBufferConsumer> consumer;
BufferQueue::createBufferQueue(&producer, &consumer, mGraphicBufferAlloc);
sp<GLConsumer> glc = new GLConsumer(consumer, name,
- GL_TEXTURE_EXTERNAL_OES, false);
+ GL_TEXTURE_EXTERNAL_OES, false, true);
glc->setDefaultBufferSize(w, h);
glc->setDefaultMaxBufferCount(3);
glc->setConsumerUsageBits(GRALLOC_USAGE_HW_COMPOSER);
diff --git a/include/gui/GLConsumer.h b/include/gui/GLConsumer.h
index a5fdfb9..787b3d4 100644
--- a/include/gui/GLConsumer.h
+++ b/include/gui/GLConsumer.h
@@ -52,9 +52,8 @@ class String8;
* This class was previously called SurfaceTexture.
*/
class GLConsumer : public ConsumerBase {
-protected:
- enum { TEXTURE_EXTERNAL = 0x8D65 }; // GL_TEXTURE_EXTERNAL_OES
public:
+ enum { TEXTURE_EXTERNAL = 0x8D65 }; // GL_TEXTURE_EXTERNAL_OES
typedef ConsumerBase::FrameAvailableListener FrameAvailableListener;
// GLConsumer constructs a new GLConsumer object. tex indicates the
@@ -82,8 +81,8 @@ public:
// context to another. If such a transfer is not needed there is no
// requirement that either of these methods be called.
GLConsumer(const sp<IGraphicBufferConsumer>& bq,
- uint32_t tex, uint32_t texureTarget = TEXTURE_EXTERNAL,
- bool useFenceSync = true, bool isControlledByApp = false);
+ uint32_t tex, uint32_t texureTarget, bool useFenceSync,
+ bool isControlledByApp);
// updateTexImage acquires the most recently queued buffer, and sets the
// image contents of the target texture to it.
diff --git a/libs/gui/tests/MultiTextureConsumer_test.cpp b/libs/gui/tests/MultiTextureConsumer_test.cpp
index 1eb6ef6..3a25ac5 100644
--- a/libs/gui/tests/MultiTextureConsumer_test.cpp
+++ b/libs/gui/tests/MultiTextureConsumer_test.cpp
@@ -37,7 +37,8 @@ protected:
sp<IGraphicBufferProducer> producer;
sp<IGraphicBufferConsumer> consumer;
BufferQueue::createBufferQueue(&producer, &consumer);
- mGlConsumer = new GLConsumer(consumer, TEX_ID);
+ mGlConsumer = new GLConsumer(consumer, TEX_ID,
+ GLConsumer::TEXTURE_EXTERNAL, true, false);
mSurface = new Surface(producer);
mANW = mSurface.get();
diff --git a/libs/gui/tests/SurfaceTextureClient_test.cpp b/libs/gui/tests/SurfaceTextureClient_test.cpp
index 7f9fcc4..8cdf3bc 100644
--- a/libs/gui/tests/SurfaceTextureClient_test.cpp
+++ b/libs/gui/tests/SurfaceTextureClient_test.cpp
@@ -46,7 +46,8 @@ protected:
sp<IGraphicBufferProducer> producer;
sp<IGraphicBufferConsumer> consumer;
BufferQueue::createBufferQueue(&producer, &consumer);
- mST = new GLConsumer(consumer, 123);
+ mST = new GLConsumer(consumer, 123, GLConsumer::TEXTURE_EXTERNAL, true,
+ false);
mSTC = new Surface(producer);
mANW = mSTC;
@@ -716,7 +717,8 @@ protected:
sp<IGraphicBufferProducer> producer;
sp<IGraphicBufferConsumer> consumer;
BufferQueue::createBufferQueue(&producer, &consumer);
- sp<GLConsumer> st(new GLConsumer(consumer, i));
+ sp<GLConsumer> st(new GLConsumer(consumer, i,
+ GLConsumer::TEXTURE_EXTERNAL, true, false));
sp<Surface> stc(new Surface(producer));
mEglSurfaces[i] = eglCreateWindowSurface(mEglDisplay, myConfig,
static_cast<ANativeWindow*>(stc.get()), NULL);
diff --git a/libs/gui/tests/SurfaceTextureGL.h b/libs/gui/tests/SurfaceTextureGL.h
index 3bff192..53eb68c 100644
--- a/libs/gui/tests/SurfaceTextureGL.h
+++ b/libs/gui/tests/SurfaceTextureGL.h
@@ -39,7 +39,8 @@ protected:
GLTest::SetUp();
sp<IGraphicBufferProducer> producer;
BufferQueue::createBufferQueue(&producer, &mConsumer);
- mST = new GLConsumer(mConsumer, TEX_ID);
+ mST = new GLConsumer(mConsumer, TEX_ID, GLConsumer::TEXTURE_EXTERNAL,
+ true, false);
mSTC = new Surface(producer);
mANW = mSTC;
mTextureRenderer = new TextureRenderer(TEX_ID, mST);
diff --git a/services/surfaceflinger/SurfaceFlingerConsumer.h b/services/surfaceflinger/SurfaceFlingerConsumer.h
index ed307c2..5633980 100644
--- a/services/surfaceflinger/SurfaceFlingerConsumer.h
+++ b/services/surfaceflinger/SurfaceFlingerConsumer.h
@@ -34,7 +34,7 @@ public:
SurfaceFlingerConsumer(const sp<IGraphicBufferConsumer>& consumer,
uint32_t tex)
- : GLConsumer(consumer, tex, GLConsumer::TEXTURE_EXTERNAL, false),
+ : GLConsumer(consumer, tex, GLConsumer::TEXTURE_EXTERNAL, false, false),
mTransformToDisplayInverse(false)
{}