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);
* 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
// 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.
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();
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;
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);
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);
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)
{}