summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl/qgl_p.h')
-rw-r--r--src/opengl/qgl_p.h51
1 files changed, 22 insertions, 29 deletions
diff --git a/src/opengl/qgl_p.h b/src/opengl/qgl_p.h
index 29d19854ef..6a503fab90 100644
--- a/src/opengl/qgl_p.h
+++ b/src/opengl/qgl_p.h
@@ -369,11 +369,14 @@ public:
EGLSurface eglSurface;
void destroyEglSurfaceForDevice();
EGLSurface eglSurfaceForDevice() const;
+ static QEglProperties *extraWindowSurfaceCreationProps;
+ static void setExtraWindowSurfaceCreationProps(QEglProperties *props);
#endif
#if defined(Q_WS_QPA)
QPlatformGLContext *platformContext;
void setupSharing();
+
#elif defined(Q_WS_X11) || defined(Q_WS_MAC)
void* cx;
#endif
@@ -416,6 +419,9 @@ public:
uint workaround_brokenTextureFromPixmap : 1;
uint workaround_brokenTextureFromPixmap_init : 1;
+ uint workaround_brokenAlphaTexSubImage : 1;
+ uint workaround_brokenAlphaTexSubImage_init : 1;
+
#ifndef QT_NO_EGL
uint ownsEglContext : 1;
#endif
@@ -686,6 +692,7 @@ public:
virtual ~QGLContextGroupResourceBase();
void insert(const QGLContext *context, void *value);
void *value(const QGLContext *context);
+ void cleanup(const QGLContext *context);
void cleanup(const QGLContext *context, void *value);
virtual void freeResource(void *value) = 0;
@@ -847,46 +854,32 @@ private:
};
-// This class can be used to match GL extensions without doing any mallocs. The
-// class assumes that the GL extension string ends with a space character,
-// which it should do on all conformant platforms. Create the object and pass
-// in a pointer to the extension string, then call match() on each extension
-// that should be matched. The match() function takes the extension name
-// *without* the terminating space character as input.
-
class QGLExtensionMatcher
{
public:
- QGLExtensionMatcher(const char *str)
- : gl_extensions(str), gl_extensions_length(qstrlen(str))
- {}
+ QGLExtensionMatcher(const char *str);
+ QGLExtensionMatcher();
- bool match(const char *str) {
+ bool match(const char *str) const {
int str_length = qstrlen(str);
- const char *extensions = gl_extensions;
- int extensions_length = gl_extensions_length;
-
- while (1) {
- // the total length that needs to be matched is the str_length +
- // the space character that terminates the extension name
- if (extensions_length < str_length + 1)
- return false;
- if (qstrncmp(extensions, str, str_length) == 0 && extensions[str_length] == ' ')
- return true;
- int split_pos = 0;
- while (split_pos < extensions_length && extensions[split_pos] != ' ')
- ++split_pos;
- ++split_pos; // added for the terminating space character
- extensions += split_pos;
- extensions_length -= split_pos;
+ Q_ASSERT(str);
+ Q_ASSERT(str_length > 0);
+ Q_ASSERT(str[str_length-1] != ' ');
+
+ for (int i = 0; i < m_offsets.size(); ++i) {
+ const char *extension = m_extensions.constData() + m_offsets.at(i);
+ if (qstrncmp(extension, str, str_length) == 0 && extension[str_length] == ' ')
+ return true;
}
return false;
}
private:
- const char *gl_extensions;
- int gl_extensions_length;
+ void init(const char *str);
+
+ QByteArray m_extensions;
+ QVector<int> m_offsets;
};