summaryrefslogtreecommitdiffstats
path: root/src/opengl/qpixmapdata_x11gl_egl.cpp
diff options
context:
space:
mode:
authorTom Cooksey <thomas.cooksey@nokia.com>2010-03-17 11:30:52 (GMT)
committerTom Cooksey <thomas.cooksey@nokia.com>2010-03-17 14:10:25 (GMT)
commite8a80a4eac6d0c1802d6e06e51c7ad5427f00ac8 (patch)
tree97dd4cc33b310a529f45bcd5e75ed3a057ca72f3 /src/opengl/qpixmapdata_x11gl_egl.cpp
parentcb06b04338545ee3f0227faaa26d0f97addb5cdd (diff)
downloadQt-e8a80a4eac6d0c1802d6e06e51c7ad5427f00ac8.zip
Qt-e8a80a4eac6d0c1802d6e06e51c7ad5427f00ac8.tar.gz
Qt-e8a80a4eac6d0c1802d6e06e51c7ad5427f00ac8.tar.bz2
Fix some rendering/scrolling artifacts with QX11GLWindowSurface
The GL2 paint engine sometimes adds a 0.49,0.49 offset when rendering into a multi-sampled QGLPaintDevice. The problem was that we weren't updating the QGLContext's QGLFormat with the EGLConfig so the paint engine thought it was rendering into an surface without multisampling and thus added the offset. Reviewed-By: TrustMe
Diffstat (limited to 'src/opengl/qpixmapdata_x11gl_egl.cpp')
-rw-r--r--src/opengl/qpixmapdata_x11gl_egl.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/opengl/qpixmapdata_x11gl_egl.cpp b/src/opengl/qpixmapdata_x11gl_egl.cpp
index 2bdfe5c..d3af60f 100644
--- a/src/opengl/qpixmapdata_x11gl_egl.cpp
+++ b/src/opengl/qpixmapdata_x11gl_egl.cpp
@@ -55,6 +55,7 @@
#endif
#include <QtOpenGL/private/qgl_p.h>
+#include <QtOpenGL/private/qgl_egl_p.h>
#include "qpixmapdata_x11gl_p.h"
@@ -255,6 +256,8 @@ QPaintEngine* QX11GLPixmapData::paintEngine() const
ctx = new QGLContext(glFormat());
Q_ASSERT(ctx->d_func()->eglContext == 0);
ctx->d_func()->eglContext = hasAlphaChannel() ? argbContext : rgbContext;
+ // Update the glFormat for the QGLContext:
+ qt_glformat_from_eglconfig(ctx->d_func()->glFormat, ctx->d_func()->eglContext->config());
}
QPaintEngine* engine;
@@ -303,6 +306,7 @@ void QX11GLPixmapData::beginPaint()
EGLConfig cfg = ctx->d_func()->eglContext->config();
Q_ASSERT(cfg != QEGL_NO_CONFIG);
+// qDebug("QX11GLPixmapData - using EGL Config ID %d", ctx->d_func()->eglContext->configAttrib(EGL_CONFIG_ID));
EGLSurface surface = QEgl::createSurface(&tmpPixmap, cfg);
if (surface == EGL_NO_SURFACE) {
qWarning() << "Error creating EGL surface for pixmap:" << QEgl::errorString();