summaryrefslogtreecommitdiff
path: root/src/opengl/gl2paintengineex
diff options
context:
space:
mode:
authorSamuel Rødal <sroedal@trolltech.com>2009-06-15 10:55:38 +0200
committerSamuel Rødal <sroedal@trolltech.com>2009-06-15 12:02:32 +0200
commit5d02b900f6070872a305f8405b504ecc01833de7 (patch)
tree47cafbc13feb7e2bc9600e351d878d2ce9d9095c /src/opengl/gl2paintengineex
parentca57370d923cbda2f14380382d887ad5e003a040 (diff)
downloadqt4-tools-5d02b900f6070872a305f8405b504ecc01833de7.tar.gz
Enabled switching multisampling on/off in GL2 engine on desktop.
Switching multisampling is not supported in GLES 2.0, but it's supported in GL 2.0 so we should do it on desktop at least. Reviewed-by: Trond
Diffstat (limited to 'src/opengl/gl2paintengineex')
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 19cb02acc0..9663dd6b5b 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -982,6 +982,14 @@ void QGL2PaintEngineEx::compositionModeChanged()
void QGL2PaintEngineEx::renderHintsChanged()
{
+#if !defined(QT_OPENGL_ES_2)
+ if ((state()->renderHints & QPainter::Antialiasing)
+ || (state()->renderHints & QPainter::HighQualityAntialiasing))
+ glEnable(GL_MULTISAMPLE);
+ else
+ glDisable(GL_MULTISAMPLE);
+#endif
+
// qDebug("QGL2PaintEngineEx::renderHintsChanged() not implemented!");
}
@@ -1180,6 +1188,10 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev)
glDepthFunc(GL_LEQUAL);
glDepthMask(false);
+#if !defined(QT_OPENGL_ES_2)
+ glDisable(GL_MULTISAMPLE);
+#endif
+
QGLPixmapData *source = d->drawable.copyOnBegin();
if (d->drawable.context()->d_func()->clear_on_painter_begin && d->drawable.autoFillBackground()) {
if (d->drawable.hasTransparentBackground())
@@ -1485,6 +1497,8 @@ void QGL2PaintEngineEx::setState(QPainterState *new_state)
return;
}
+ renderHintsChanged();
+
d->matrixDirty = true;
d->compositionModeDirty = true;
d->brushTextureDirty = true;