summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2011-01-27 14:25:00 (GMT)
committerJørgen Lind <jorgen.lind@nokia.com>2011-01-27 14:32:40 (GMT)
commit2ab07dd167e05fe60525fde9b7b180738e431b9d (patch)
treee09be856660d4b3fe4dc5829ebcad28c2528e40c /src
parentdbb0f9bfbe98dfd789948ed65fe906b3c2b757f7 (diff)
downloadQt-2ab07dd167e05fe60525fde9b7b180738e431b9d.zip
Qt-2ab07dd167e05fe60525fde9b7b180738e431b9d.tar.gz
Qt-2ab07dd167e05fe60525fde9b7b180738e431b9d.tar.bz2
Lighthouse: Wayland plugin. Only create depth and stencil buffers once
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/wayland/qwaylandcursor.cpp2
-rw-r--r--src/plugins/platforms/wayland/qwaylanddrmsurface.cpp16
2 files changed, 9 insertions, 9 deletions
diff --git a/src/plugins/platforms/wayland/qwaylandcursor.cpp b/src/plugins/platforms/wayland/qwaylandcursor.cpp
index 29c6abd..f51281d 100644
--- a/src/plugins/platforms/wayland/qwaylandcursor.cpp
+++ b/src/plugins/platforms/wayland/qwaylandcursor.cpp
@@ -48,7 +48,7 @@
#include <QtGui/QImageReader>
-#define DATADIR "/home/jlind/install/share"
+#define DATADIR "/usr/share"
static const struct pointer_image {
const char *filename;
diff --git a/src/plugins/platforms/wayland/qwaylanddrmsurface.cpp b/src/plugins/platforms/wayland/qwaylanddrmsurface.cpp
index 76c8c33..603c018 100644
--- a/src/plugins/platforms/wayland/qwaylanddrmsurface.cpp
+++ b/src/plugins/platforms/wayland/qwaylanddrmsurface.cpp
@@ -77,7 +77,6 @@ QWaylandDrmBuffer::QWaylandDrmBuffer(QWaylandDisplay *display,
mImage = eglCreateDRMImageMESA(mDisplay->eglDisplay(), imageAttribs);
- glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, mImage);
glGenTextures(1, &mTexture);
glBindTexture(GL_TEXTURE_2D, mTexture);
glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, mImage);
@@ -112,7 +111,6 @@ QWaylandDrmBuffer::~QWaylandDrmBuffer(void)
void QWaylandDrmBuffer::bindToCurrentFbo()
{
Q_ASSERT(QPlatformGLContext::currentContext());
- glBindTexture(GL_TEXTURE_2D, mTexture);
glFramebufferTexture2D(GL_FRAMEBUFFER_EXT, GL_COLOR_ATTACHMENT0,
GL_TEXTURE_2D, mTexture, 0);
QT_CHECK_GLERROR();
@@ -135,6 +133,13 @@ QWaylandPaintDevice::QWaylandPaintDevice(QWaylandDisplay *display, QWindowSurfac
glGenFramebuffers(1, &m_thisFBO);
glBindFramebuffer(GL_FRAMEBUFFER_EXT, m_thisFBO);
+ glGenRenderbuffers(1, &mDepthStencil);
+ glBindRenderbuffer(GL_RENDERBUFFER_EXT, mDepthStencil);
+ glFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
+ GL_RENDERBUFFER_EXT, mDepthStencil);
+ glFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT,
+ GL_RENDERBUFFER_EXT, mDepthStencil);
+
if (windowSurface->size().isValid())
resize(windowSurface->size());
}
@@ -184,15 +189,9 @@ void QWaylandPaintDevice::resize(const QSize &size)
}
}
- glDeleteRenderbuffers(1,&mDepthStencil);
- glGenRenderbuffers(1,&mDepthStencil);
glBindRenderbuffer(GL_RENDERBUFFER_EXT,mDepthStencil);
glRenderbufferStorage(GL_RENDERBUFFER_EXT,
GL_DEPTH24_STENCIL8_EXT, size.width(), size.height());
- glFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, GL_DEPTH_ATTACHMENT_EXT,
- GL_RENDERBUFFER_EXT, mDepthStencil);
- glFramebufferRenderbuffer(GL_FRAMEBUFFER_EXT, GL_STENCIL_ATTACHMENT_EXT,
- GL_RENDERBUFFER_EXT, mDepthStencil);
GLenum status = glCheckFramebufferStatus(GL_FRAMEBUFFER_EXT);
@@ -247,6 +246,7 @@ void QWaylandDrmWindowSurface::flush(QWidget *widget, const QRegion &region, con
Q_UNUSED(offset);
QWaylandWindow *ww = (QWaylandWindow *) widget->platformWindow();
+ glFlush();
ww->attach(mPaintDevice->currentDrmBufferAndSwap());
QVector<QRect> rects = region.rects();