summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-04-11 14:36:55 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-04-11 14:36:55 +0200
commit98d3e40fb7c88b670a93e73dace2d0f05a5f903c (patch)
treeb1292124a86c219fb434db4ec28e8f805ff52287 /src/opengl
parenta74e4b85be83e2da47f4a1d8fcf0e78079335b80 (diff)
parentbab494e4d046f5617d19f5fec35eeff94377c51f (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: mkspecs/qnx-armv7le-qcc/qplatformdefs.h src/printsupport/kernel/qcups.cpp src/widgets/styles/qstyle.h tests/auto/widgets/itemviews/qlistwidget/tst_qlistwidget.cpp Change-Id: Ia41e13051169a6d4a8a1267548e7d47b859bb267
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/opengl.pro1
-rw-r--r--src/opengl/qgl.cpp10
-rw-r--r--src/opengl/qgl_qpa.cpp5
-rw-r--r--src/opengl/qglbuffer.cpp16
-rw-r--r--src/opengl/qglframebufferobject.cpp3
-rw-r--r--src/opengl/qglfunctions.cpp22
6 files changed, 24 insertions, 33 deletions
diff --git a/src/opengl/opengl.pro b/src/opengl/opengl.pro
index f685c26603..5fef609a2a 100644
--- a/src/opengl/opengl.pro
+++ b/src/opengl/opengl.pro
@@ -11,7 +11,6 @@ QMAKE_DOCS = $$PWD/doc/qtopengl.qdocconf
load(qt_module)
contains(QT_CONFIG, opengl):CONFIG += opengl
-contains(QT_CONFIG, opengles1):CONFIG += opengles1
contains(QT_CONFIG, opengles2):CONFIG += opengles2
HEADERS += qgl.h \
diff --git a/src/opengl/qgl.cpp b/src/opengl/qgl.cpp
index e602a05af9..3cfdcc549c 100644
--- a/src/opengl/qgl.cpp
+++ b/src/opengl/qgl.cpp
@@ -2934,8 +2934,9 @@ void QGLContext::setFormat(const QGLFormat &format)
void QGLContext::setDevice(QPaintDevice *pDev)
{
Q_D(QGLContext);
- if (isValid())
- reset();
+ // Do not touch the valid flag here. The context is either a new one and
+ // valid is not yet set or it is adapted from a valid QOpenGLContext in which
+ // case it must remain valid.
d->paintDevice = pDev;
if (d->paintDevice && (d->paintDevice->devType() != QInternal::Widget
&& d->paintDevice->devType() != QInternal::Pixmap
@@ -4083,6 +4084,11 @@ QPixmap QGLWidget::renderPixmap(int w, int h, bool useContext)
Depending on your hardware, you can explicitly select which color
buffer to grab with a glReadBuffer() call before calling this
function.
+
+ On QNX the back buffer is not preserved when swapBuffers() is called. The back buffer
+ where this function reads from, might thus not contain the same content as the front buffer.
+ In order to retrieve what is currently visible on the screen, swapBuffers()
+ has to be executed prior to this function call.
*/
QImage QGLWidget::grabFrameBuffer(bool withAlpha)
{
diff --git a/src/opengl/qgl_qpa.cpp b/src/opengl/qgl_qpa.cpp
index fe4d1c363c..10e6ffde46 100644
--- a/src/opengl/qgl_qpa.cpp
+++ b/src/opengl/qgl_qpa.cpp
@@ -109,6 +109,11 @@ QSurfaceFormat QGLFormat::toSurfaceFormat(const QGLFormat &format)
retFormat.setMajorVersion(format.majorVersion());
retFormat.setMinorVersion(format.minorVersion());
retFormat.setProfile(static_cast<QSurfaceFormat::OpenGLContextProfile>(format.profile()));
+ // QGLFormat has no way to set DeprecatedFunctions, that is, to tell that forward
+ // compatibility should not be requested. Some drivers fail to ignore the fwdcompat
+ // bit with compatibility profiles so make sure it is not set.
+ if (format.profile() == QGLFormat::CompatibilityProfile)
+ retFormat.setOption(QSurfaceFormat::DeprecatedFunctions);
return retFormat;
}
diff --git a/src/opengl/qglbuffer.cpp b/src/opengl/qglbuffer.cpp
index 0bcb9d4f1f..1c9545990f 100644
--- a/src/opengl/qglbuffer.cpp
+++ b/src/opengl/qglbuffer.cpp
@@ -344,20 +344,18 @@ void QGLBuffer::destroy()
bool QGLBuffer::read(int offset, void *data, int count)
{
#if !defined(QT_OPENGL_ES)
- if (QOpenGLContext::openGLModuleType() != QOpenGLContext::GLES1) {
- Q_D(QGLBuffer);
- if (!d->funcs->hasOpenGLFeature(QOpenGLFunctions::Buffers) || !d->guard->id())
- return false;
- while (glGetError() != GL_NO_ERROR) ; // Clear error state.
- d->funcs->glGetBufferSubData(d->type, offset, count, data);
- return glGetError() == GL_NO_ERROR;
- }
+ Q_D(QGLBuffer);
+ if (!d->funcs->hasOpenGLFeature(QOpenGLFunctions::Buffers) || !d->guard->id())
+ return false;
+ while (glGetError() != GL_NO_ERROR) ; // Clear error state.
+ d->funcs->glGetBufferSubData(d->type, offset, count, data);
+ return glGetError() == GL_NO_ERROR;
#else
Q_UNUSED(offset);
Q_UNUSED(data);
Q_UNUSED(count);
-#endif
return false;
+#endif
}
/*!
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index d636da91b5..bd8bc2f64a 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -1114,6 +1114,9 @@ QGLFramebufferObjectFormat QGLFramebufferObject::format() const
\fn QImage QGLFramebufferObject::toImage() const
Returns the contents of this framebuffer object as a QImage.
+
+ On QNX the back buffer is not preserved when a buffer swap occures. So this function
+ might return old content.
*/
QImage QGLFramebufferObject::toImage() const
{
diff --git a/src/opengl/qglfunctions.cpp b/src/opengl/qglfunctions.cpp
index d6d77d0568..42b3b47f7f 100644
--- a/src/opengl/qglfunctions.cpp
+++ b/src/opengl/qglfunctions.cpp
@@ -223,7 +223,7 @@ QGLFunctions::QGLFunctions(const QGLContext *context)
static int qt_gl_resolve_features()
{
QOpenGLContext *ctx = QOpenGLContext::currentContext();
- if (ctx->isES() && QOpenGLContext::openGLModuleType() != QOpenGLContext::GLES1) {
+ if (ctx->isES()) {
// OpenGL ES 2
int features = QGLFunctions::Multitexture |
QGLFunctions::Shaders |
@@ -243,26 +243,6 @@ static int qt_gl_resolve_features()
if (extensions.match("GL_IMG_texture_npot"))
features |= QGLFunctions::NPOTTextures;
return features;
- } else if (ctx->isES()) {
- // OpenGL ES 1
- int features = QGLFunctions::Multitexture |
- QGLFunctions::Buffers |
- QGLFunctions::CompressedTextures |
- QGLFunctions::Multisample;
- QOpenGLExtensionMatcher extensions;
- if (extensions.match("GL_OES_framebuffer_object"))
- features |= QGLFunctions::Framebuffers;
- if (extensions.match("GL_OES_blend_equation_separate"))
- features |= QGLFunctions::BlendEquationSeparate;
- if (extensions.match("GL_OES_blend_func_separate"))
- features |= QGLFunctions::BlendFuncSeparate;
- if (extensions.match("GL_OES_blend_subtract"))
- features |= QGLFunctions::BlendSubtract;
- if (extensions.match("GL_OES_texture_npot"))
- features |= QGLFunctions::NPOTTextures;
- if (extensions.match("GL_IMG_texture_npot"))
- features |= QGLFunctions::NPOTTextures;
- return features;
} else {
// OpenGL
int features = 0;