From e49ba8e2ed8e17156eb00c8fc8e2285df62bc018 Mon Sep 17 00:00:00 2001 From: Dan Stoza Date: Tue, 24 Jun 2014 13:09:19 -0700 Subject: [PATCH] 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 --- cmds/flatland/GLHelper.cpp | 2 +- include/gui/GLConsumer.h | 7 +++---- libs/gui/tests/MultiTextureConsumer_test.cpp | 3 ++- libs/gui/tests/SurfaceTextureClient_test.cpp | 6 ++++-- libs/gui/tests/SurfaceTextureGL.h | 3 ++- services/surfaceflinger/SurfaceFlingerConsumer.h | 2 +- 6 files changed, 13 insertions(+), 10 deletions(-) diff --git a/cmds/flatland/GLHelper.cpp b/cmds/flatland/GLHelper.cpp index 4b5aba9e7..3155766a8 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 consumer; BufferQueue::createBufferQueue(&producer, &consumer, mGraphicBufferAlloc); sp 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 a5fdfb9d2..787b3d406 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& 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 1eb6ef6f5..3a25ac59c 100644 --- a/libs/gui/tests/MultiTextureConsumer_test.cpp +++ b/libs/gui/tests/MultiTextureConsumer_test.cpp @@ -37,7 +37,8 @@ protected: sp producer; sp 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 7f9fcc4ec..8cdf3bc34 100644 --- a/libs/gui/tests/SurfaceTextureClient_test.cpp +++ b/libs/gui/tests/SurfaceTextureClient_test.cpp @@ -46,7 +46,8 @@ protected: sp producer; sp 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 producer; sp consumer; BufferQueue::createBufferQueue(&producer, &consumer); - sp st(new GLConsumer(consumer, i)); + sp st(new GLConsumer(consumer, i, + GLConsumer::TEXTURE_EXTERNAL, true, false)); sp stc(new Surface(producer)); mEglSurfaces[i] = eglCreateWindowSurface(mEglDisplay, myConfig, static_cast(stc.get()), NULL); diff --git a/libs/gui/tests/SurfaceTextureGL.h b/libs/gui/tests/SurfaceTextureGL.h index 3bff192a9..53eb68cad 100644 --- a/libs/gui/tests/SurfaceTextureGL.h +++ b/libs/gui/tests/SurfaceTextureGL.h @@ -39,7 +39,8 @@ protected: GLTest::SetUp(); sp 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 ed307c214..5633980ee 100644 --- a/services/surfaceflinger/SurfaceFlingerConsumer.h +++ b/services/surfaceflinger/SurfaceFlingerConsumer.h @@ -34,7 +34,7 @@ public: SurfaceFlingerConsumer(const sp& consumer, uint32_t tex) - : GLConsumer(consumer, tex, GLConsumer::TEXTURE_EXTERNAL, false), + : GLConsumer(consumer, tex, GLConsumer::TEXTURE_EXTERNAL, false, false), mTransformToDisplayInverse(false) {}