diff options
Diffstat (limited to 'src/opengl')
-rw-r--r-- | src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp | 14 | ||||
-rw-r--r-- | src/opengl/qgl_x11.cpp | 12 | ||||
-rw-r--r-- | src/opengl/qgraphicssystem_gl.cpp | 1 | ||||
-rw-r--r-- | src/opengl/qpixmapdata_gl.cpp | 3 | ||||
-rw-r--r-- | src/opengl/qwindowsurface_gl.cpp | 12 |
5 files changed, 37 insertions, 5 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; diff --git a/src/opengl/qgl_x11.cpp b/src/opengl/qgl_x11.cpp index da61634..f241e61 100644 --- a/src/opengl/qgl_x11.cpp +++ b/src/opengl/qgl_x11.cpp @@ -522,7 +522,11 @@ void *QGLContext::tryVisual(const QGLFormat& f, int bufDepth) const QX11Info *xinfo = qt_x11Info(d->paintDevice); bool useFBConfig = false; -#if defined(GLX_VERSION_1_3) && !defined(QT_NO_XRENDER) +#if defined(GLX_VERSION_1_3) && !defined(QT_NO_XRENDER) && !defined(Q_OS_HPUX) + /* + HPUX defines GLX_VERSION_1_3 but does not implement the corresponding functions. + Specifically glXChooseFBConfig and glXGetVisualFromFBConfig are not implemented. + */ QWidget* widget = 0; if (d->paintDevice->devType() == QInternal::Widget) widget = static_cast<QWidget*>(d->paintDevice); @@ -565,7 +569,7 @@ void *QGLContext::tryVisual(const QGLFormat& f, int bufDepth) } #endif -#if defined(GLX_VERSION_1_3) +#if defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX) // GLX_RENDER_TYPE is only in glx >=1.3 if (useFBConfig) { spec[i++] = GLX_RENDER_TYPE; @@ -627,7 +631,7 @@ void *QGLContext::tryVisual(const QGLFormat& f, int bufDepth) spec[i++] = f.samples() == -1 ? 4 : f.samples(); } -#if defined(GLX_VERSION_1_3) +#if defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX) if (useFBConfig) { spec[i++] = GLX_DRAWABLE_TYPE; switch(d->paintDevice->devType()) { @@ -652,7 +656,7 @@ void *QGLContext::tryVisual(const QGLFormat& f, int bufDepth) XVisualInfo* chosenVisualInfo = 0; -#if defined(GLX_VERSION_1_3) +#if defined(GLX_VERSION_1_3) && !defined(Q_OS_HPUX) while (useFBConfig) { GLXFBConfig *configs; int configCount = 0; diff --git a/src/opengl/qgraphicssystem_gl.cpp b/src/opengl/qgraphicssystem_gl.cpp index ce8ad7a..a75f3a5 100644 --- a/src/opengl/qgraphicssystem_gl.cpp +++ b/src/opengl/qgraphicssystem_gl.cpp @@ -44,6 +44,7 @@ #include "private/qpixmap_raster_p.h" #include "private/qpixmapdata_gl_p.h" #include "private/qwindowsurface_gl_p.h" +#include "private/qgl_p.h" #include <private/qwindowsurface_raster_p.h> QT_BEGIN_NAMESPACE diff --git a/src/opengl/qpixmapdata_gl.cpp b/src/opengl/qpixmapdata_gl.cpp index 48feb82..e641d2c 100644 --- a/src/opengl/qpixmapdata_gl.cpp +++ b/src/opengl/qpixmapdata_gl.cpp @@ -398,7 +398,8 @@ static TextureBuffer createTextureBuffer(const QSize &size, QGL2PaintEngineEx *e bool QGLPixmapData::useFramebufferObjects() { return QGLFramebufferObject::hasOpenGLFramebufferObjects() - && QGLFramebufferObject::hasOpenGLFramebufferBlit(); + && QGLFramebufferObject::hasOpenGLFramebufferBlit() + && qt_gl_preferGL2Engine(); } QPaintEngine* QGLPixmapData::paintEngine() const diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index 01974a2..cdfaa3c 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -72,6 +72,10 @@ #include <private/qpaintengineex_opengl2_p.h> +#ifndef QT_OPENGL_ES_2 +#include <private/qpaintengine_opengl_p.h> +#endif + #ifndef GLX_ARB_multisample #define GLX_SAMPLE_BUFFERS_ARB 100000 #define GLX_SAMPLES_ARB 100001 @@ -315,9 +319,17 @@ void QGLWindowSurface::hijackWindow(QWidget *widget) Q_GLOBAL_STATIC(QGL2PaintEngineEx, qt_gl_window_surface_2_engine) +#if !defined (QT_OPENGL_ES_2) +Q_GLOBAL_STATIC(QOpenGLPaintEngine, qt_gl_window_surface_engine) +#endif + /*! \reimp */ QPaintEngine *QGLWindowSurface::paintEngine() const { +#if !defined(QT_OPENGL_ES_2) + if (!qt_gl_preferGL2Engine()) + return qt_gl_window_surface_engine(); +#endif return qt_gl_window_surface_2_engine(); } |