summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWouter Huysentruit <wouter.huysentruit@dzine.be>2013-07-02 18:00:09 (GMT)
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-07-04 18:13:43 (GMT)
commit11aed7c927d7ad8130d2b18a110a3f557c41e9a1 (patch)
treefc20c86684bf25643c8832732afe4e1593921369
parentefcbcd3e23b530443b55374e63db39e27b21ad9c (diff)
downloadQt-11aed7c927d7ad8130d2b18a110a3f557c41e9a1.zip
Qt-11aed7c927d7ad8130d2b18a110a3f557c41e9a1.tar.gz
Qt-11aed7c927d7ad8130d2b18a110a3f557c41e9a1.tar.bz2
Set projection matrix for systems with OpenGL 3.1
The projection matrix should also be set for systems running OpenGL 3.1 with GL_ARB_compatibility extension. Task-number: QTBUG-28284 This fix is based on Commit 9514422eeecb468fbf0a60604f5699f9caba3f39 from qt/qtbase project. Change-Id: Iadc5bf3a0e73e401e5c8c5b220fb9bd0ace3970f Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp4
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h5
2 files changed, 8 insertions, 1 deletions
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index 1c4ba7a..413942d 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -568,6 +568,7 @@ void QGL2PaintEngineEx::beginNativePainting()
#ifndef QT_OPENGL_ES_2
const QGLFormat &fmt = d->device->format();
if (fmt.majorVersion() < 3 || (fmt.majorVersion() == 3 && fmt.minorVersion() < 1)
+ || (fmt.majorVersion() == 3 && fmt.minorVersion() == 1 && d->hasCompatibilityExtension)
|| fmt.profile() == QGLFormat::CompatibilityProfile)
{
// be nice to people who mix OpenGL 1.x code with QPainter commands
@@ -2139,6 +2140,9 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev)
d->device->beginPaint();
#if !defined(QT_OPENGL_ES_2)
+ QGLExtensionMatcher extensions;
+ d->hasCompatibilityExtension = extensions.match("GL_ARB_compatibility");
+
bool success = qt_resolve_version_2_0_functions(d->ctx)
&& qt_resolve_buffer_extensions(d->ctx)
&& (!QGLFramebufferObject::hasOpenGLFramebufferObjects()
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index f3c0683..7e00be5 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -187,7 +187,8 @@ public:
snapToPixelGrid(false),
nativePaintingActive(false),
inverseScale(1),
- lastMaskTextureUsed(0)
+ lastMaskTextureUsed(0),
+ hasCompatibilityExtension(false)
{ }
~QGL2PaintEngineExPrivate();
@@ -318,6 +319,8 @@ public:
QVector<GLuint> unusedIBOSToClean;
const GLfloat *vertexAttribPointers[3];
+
+ bool hasCompatibilityExtension;
};