From e8a80a4eac6d0c1802d6e06e51c7ad5427f00ac8 Mon Sep 17 00:00:00 2001 From: Tom Cooksey Date: Wed, 17 Mar 2010 12:30:52 +0100 Subject: 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 --- src/opengl/qpixmapdata_x11gl_egl.cpp | 4 ++++ 1 file changed, 4 insertions(+) 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 +#include #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(); -- cgit v0.12