summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms
diff options
context:
space:
mode:
authorJesse Barnes <jbarnes@virtuousgeek.org>2010-10-27 21:44:04 (GMT)
committerJørgen Lind <jorgen.lind@nokia.com>2011-01-25 17:59:45 (GMT)
commit81e5d2db862cfaf58eb6394c9fe1968547926c78 (patch)
treef28a3300d8bc672f46214834c9828f83b1def373 /src/plugins/platforms
parent8288733d680bba6be762ed0e26aa4e95cdfe68e8 (diff)
downloadQt-81e5d2db862cfaf58eb6394c9fe1968547926c78.zip
Qt-81e5d2db862cfaf58eb6394c9fe1968547926c78.tar.gz
Qt-81e5d2db862cfaf58eb6394c9fe1968547926c78.tar.bz2
Wayland: render to a texture, not a renderbuffer
This will let us source from offscreen GL widget surfaces and copy into the parent surface.
Diffstat (limited to 'src/plugins/platforms')
-rw-r--r--src/plugins/platforms/wayland/qwaylandintegration.cpp8
-rw-r--r--src/plugins/platforms/wayland/qwaylandwindowsurface.cpp2
-rw-r--r--src/plugins/platforms/wayland/qwaylandwindowsurface.h2
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