Merge "Remove deprecated BufferQueue constructor"

This commit is contained in:
Dan Stoza 2014-03-17 18:46:14 +00:00 committed by Android (Google) Code Review
commit 2c22093c1c

View File

@ -201,14 +201,16 @@ bool GLHelper::getShaderProgram(const char* name, GLuint* outPgm) {
bool GLHelper::createNamedSurfaceTexture(GLuint name, uint32_t w, uint32_t h, bool GLHelper::createNamedSurfaceTexture(GLuint name, uint32_t w, uint32_t h,
sp<GLConsumer>* glConsumer, EGLSurface* surface) { sp<GLConsumer>* glConsumer, EGLSurface* surface) {
sp<BufferQueue> bq = new BufferQueue(mGraphicBufferAlloc); sp<IGraphicBufferProducer> producer;
sp<GLConsumer> glc = new GLConsumer(bq, name, 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);
glc->setDefaultBufferSize(w, h); glc->setDefaultBufferSize(w, h);
glc->setDefaultMaxBufferCount(3); glc->setDefaultMaxBufferCount(3);
glc->setConsumerUsageBits(GRALLOC_USAGE_HW_COMPOSER); glc->setConsumerUsageBits(GRALLOC_USAGE_HW_COMPOSER);
sp<ANativeWindow> anw = new Surface(bq); sp<ANativeWindow> anw = new Surface(producer);
EGLSurface s = eglCreateWindowSurface(mDisplay, mConfig, anw.get(), NULL); EGLSurface s = eglCreateWindowSurface(mDisplay, mConfig, anw.get(), NULL);
if (s == EGL_NO_SURFACE) { if (s == EGL_NO_SURFACE) {
fprintf(stderr, "eglCreateWindowSurface error: %#x\n", eglGetError()); fprintf(stderr, "eglCreateWindowSurface error: %#x\n", eglGetError());