summaryrefslogtreecommitdiffstats
path: root/src/gui/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/opengl')
-rw-r--r--src/gui/opengl/qopengltexturehelper_p.h16
-rw-r--r--src/gui/opengl/qopenglvertexarrayobject.cpp4
2 files changed, 15 insertions, 5 deletions
diff --git a/src/gui/opengl/qopengltexturehelper_p.h b/src/gui/opengl/qopengltexturehelper_p.h
index a255672602..6b26527269 100644
--- a/src/gui/opengl/qopengltexturehelper_p.h
+++ b/src/gui/opengl/qopengltexturehelper_p.h
@@ -76,6 +76,14 @@ QT_BEGIN_NAMESPACE
#define GL_TEXTURE_COMPARE_FUNC 0x884D
#endif
+// use GL_APICALL only on Android + __clang__
+#if !defined(Q_OS_ANDROID) || !defined(__clang__)
+# undef GL_APICALL
+# define GL_APICALL
+#elif !defined(GL_APICALL)
+# define GL_APICALL
+#endif
+
class QOpenGLContext;
class QOpenGLTextureHelper
@@ -754,15 +762,15 @@ private:
// OpenGL 1.3
void (QOPENGLF_APIENTRYP GetCompressedTexImage)(GLenum target, GLint level, GLvoid *img);
void (QOPENGLF_APIENTRYP CompressedTexSubImage1D)(GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data);
- void (QOPENGLF_APIENTRYP CompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
+ GL_APICALL void (QOPENGLF_APIENTRYP CompressedTexSubImage2D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data);
void (QOPENGLF_APIENTRYP CompressedTexSubImage3D)(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data);
void (QOPENGLF_APIENTRYP CompressedTexImage1D)(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data);
- void (QOPENGLF_APIENTRYP CompressedTexImage2D)(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
+ GL_APICALL void (QOPENGLF_APIENTRYP CompressedTexImage2D)(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data);
void (QOPENGLF_APIENTRYP CompressedTexImage3D)(GLenum target, GLint level, GLenum internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data);
- void (QOPENGLF_APIENTRYP ActiveTexture)(GLenum texture);
+ GL_APICALL void (QOPENGLF_APIENTRYP ActiveTexture)(GLenum texture);
// OpenGL 3.0
- void (QOPENGLF_APIENTRYP GenerateMipmap)(GLenum target);
+ GL_APICALL void (QOPENGLF_APIENTRYP GenerateMipmap)(GLenum target);
// OpenGL 3.2
void (QOPENGLF_APIENTRYP TexImage3DMultisample)(GLenum target, GLsizei samples, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedSampleLocations);
diff --git a/src/gui/opengl/qopenglvertexarrayobject.cpp b/src/gui/opengl/qopenglvertexarrayobject.cpp
index 6753064a60..babe52aa83 100644
--- a/src/gui/opengl/qopenglvertexarrayobject.cpp
+++ b/src/gui/opengl/qopenglvertexarrayobject.cpp
@@ -358,9 +358,11 @@ QOpenGLVertexArrayObject::~QOpenGLVertexArrayObject()
Q_D(QOpenGLVertexArrayObject);
QOpenGLContext *oldContext = 0;
+ QSurface *oldContextSurface = 0;
QScopedPointer<QOffscreenSurface> offscreenSurface;
if (d->context && ctx && d->context != ctx) {
oldContext = ctx;
+ oldContextSurface = ctx->surface();
// Cannot just make the current surface current again with another context.
// The format may be incompatible and some platforms (iOS) may impose
// restrictions on using a window with different contexts. Create an
@@ -380,7 +382,7 @@ QOpenGLVertexArrayObject::~QOpenGLVertexArrayObject()
destroy();
if (oldContext) {
- if (!oldContext->makeCurrent(oldContext->surface()))
+ if (!oldContext->makeCurrent(oldContextSurface))
qWarning("QOpenGLVertexArrayObject::~QOpenGLVertexArrayObject() failed to restore current context");
}
}