summaryrefslogtreecommitdiffstats
path: root/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index d2c63ddc10..49d6b297e4 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -76,7 +76,6 @@
#include <QPaintEngine>
#include <private/qpainter_p.h>
#include <private/qfontengine_p.h>
-#include <private/qpixmapdata_gl_p.h>
#include <private/qdatabuffer_p.h>
#include <private/qstatictext_p.h>
#include <private/qtriangulator_p.h>
@@ -2048,21 +2047,13 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev)
bool QGL2PaintEngineEx::end()
{
Q_D(QGL2PaintEngineEx);
- QGLContext *ctx = d->ctx;
+ QGLContext *ctx = d->ctx;
glUseProgram(0);
d->transferMode(BrushDrawingMode);
d->device->endPaint();
-#if defined(Q_WS_X11)
- // On some (probably all) drivers, deleting an X pixmap which has been bound to a texture
- // before calling glFinish/swapBuffers renders garbage. Presumably this is because X deletes
- // the pixmap behind the driver's back before it's had a chance to use it. To fix this, we
- // reference all QPixmaps which have been bound to stop them being deleted and only deref
- // them here, after swapBuffers, where they can be safely deleted.
- ctx->d_func()->boundPixmaps.clear();
-#endif
- d->ctx->d_ptr->active_engine = 0;
+ ctx->d_ptr->active_engine = 0;
d->resetGLState();
@@ -2335,8 +2326,8 @@ void QGL2PaintEngineExPrivate::systemStateChanged()
if (systemClip.isEmpty()) {
useSystemClip = false;
} else {
- if (q->paintDevice()->devType() == QInternal::Widget && currentClipWidget) {
- QWidgetPrivate *widgetPrivate = qt_widget_private(currentClipWidget->window());
+ if (q->paintDevice()->devType() == QInternal::Widget && currentClipDevice) {
+ QWidgetPrivate *widgetPrivate = qt_widget_private(static_cast<QWidget *>(currentClipDevice)->window());
useSystemClip = widgetPrivate->extra && widgetPrivate->extra->inRenderWithPainter;
} else {
useSystemClip = true;