From 81e5d2db862cfaf58eb6394c9fe1968547926c78 Mon Sep 17 00:00:00 2001 From: Jesse Barnes Date: Wed, 27 Oct 2010 14:44:04 -0700 Subject: Wayland: render to a texture, not a renderbuffer This will let us source from offscreen GL widget surfaces and copy into the parent surface. --- src/plugins/platforms/wayland/qwaylandintegration.cpp | 8 ++++---- src/plugins/platforms/wayland/qwaylandwindowsurface.cpp | 2 -- src/plugins/platforms/wayland/qwaylandwindowsurface.h | 2 +- 3 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/plugins/platforms/wayland/qwaylandintegration.cpp b/src/plugins/platforms/wayland/qwaylandintegration.cpp index 6842dbf..866a197 100644 --- a/src/plugins/platforms/wayland/qwaylandintegration.cpp +++ b/src/plugins/platforms/wayland/qwaylandintegration.cpp @@ -538,10 +538,10 @@ void QWaylandGLContext::makeCurrent() eglMakeCurrent(mDisplay->eglDisplay(), 0, 0, mBuffer->mContext); glBindFramebuffer(GL_FRAMEBUFFER, mBuffer->mFbo); - glBindRenderbuffer(GL_RENDERBUFFER, mBuffer->mRbo); - glEGLImageTargetRenderbufferStorageOES(GL_RENDERBUFFER, mBuffer->mImage); - glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, - GL_RENDERBUFFER, mBuffer->mRbo); + glBindTexture(GL_TEXTURE_2D, mBuffer->mTexture); + glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, mBuffer->mImage); + glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, + GL_TEXTURE_2D, mBuffer->mTexture, 0); } void QWaylandGLContext::doneCurrent() diff --git a/src/plugins/platforms/wayland/qwaylandwindowsurface.cpp b/src/plugins/platforms/wayland/qwaylandwindowsurface.cpp index 4ae04be..2374eac 100644 --- a/src/plugins/platforms/wayland/qwaylandwindowsurface.cpp +++ b/src/plugins/platforms/wayland/qwaylandwindowsurface.cpp @@ -222,7 +222,6 @@ QWaylandDrmBuffer::QWaylandDrmBuffer(QWaylandDisplay *display, imageAttribs[3] = size.height(); mImage = eglCreateDRMImageMESA(mDisplay->eglDisplay(), imageAttribs); glGenFramebuffers(1, &mFbo); - glGenRenderbuffers(1, &mRbo); glGenTextures(1, &mTexture); glBindTexture(GL_TEXTURE_2D, mTexture); glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, mImage); @@ -237,7 +236,6 @@ QWaylandDrmBuffer::QWaylandDrmBuffer(QWaylandDisplay *display, QWaylandDrmBuffer::~QWaylandDrmBuffer(void) { glDeleteFramebuffers(1, &mFbo); - glDeleteRenderbuffers(1, &mRbo); glDeleteTextures(1, &mTexture); eglDestroyImageKHR(mDisplay->eglDisplay(), mImage); wl_buffer_destroy(mBuffer); diff --git a/src/plugins/platforms/wayland/qwaylandwindowsurface.h b/src/plugins/platforms/wayland/qwaylandwindowsurface.h index c8ccdb1..eb9cc40 100644 --- a/src/plugins/platforms/wayland/qwaylandwindowsurface.h +++ b/src/plugins/platforms/wayland/qwaylandwindowsurface.h @@ -99,7 +99,7 @@ public: QWaylandDisplay *mDisplay; QGLFramebufferObject *pdev; QSize mSize; - GLuint mFbo, mRbo; + GLuint mFbo; }; class QWaylandDrmWindowSurface : public QWindowSurface -- cgit v0.12