diff options
author | Samuel Rødal <sroedal@trolltech.com> | 2009-06-15 08:55:38 (GMT) |
---|---|---|
committer | Samuel Rødal <sroedal@trolltech.com> | 2009-06-15 10:02:32 (GMT) |
commit | 5d02b900f6070872a305f8405b504ecc01833de7 (patch) | |
tree | 47cafbc13feb7e2bc9600e351d878d2ce9d9095c /src/opengl | |
parent | ca57370d923cbda2f14380382d887ad5e003a040 (diff) | |
download | Qt-5d02b900f6070872a305f8405b504ecc01833de7.zip Qt-5d02b900f6070872a305f8405b504ecc01833de7.tar.gz Qt-5d02b900f6070872a305f8405b504ecc01833de7.tar.bz2 |
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')
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp index 19cb02a..9663dd6 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; |