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
This commit is contained in:
parent
b410863d6a
commit
e49ba8e2ed
6 changed files with 13 additions and 10 deletions
|
@ -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);
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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();
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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)
|
||||
{}
|
||||
|
||||
|
|
Loading…
Reference in a new issue