diff options
author | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-09-25 00:42:58 (GMT) |
---|---|---|
committer | Rhys Weatherley <rhys.weatherley@nokia.com> | 2009-09-25 00:42:58 (GMT) |
commit | 9f814e1efe11ced6d7b64d1fcc52382631f9cb52 (patch) | |
tree | 011c924414ebb7c9bf395b120f94687ccf7c1343 /src/gui/egl/qegl.cpp | |
parent | f3d15516572394b6bcd44a89dd66516fa4eba56e (diff) | |
download | Qt-9f814e1efe11ced6d7b64d1fcc52382631f9cb52.zip Qt-9f814e1efe11ced6d7b64d1fcc52382631f9cb52.tar.gz Qt-9f814e1efe11ced6d7b64d1fcc52382631f9cb52.tar.bz2 |
Make QEglContext API a little more flexible
Allow higher layers in QtOpenGL and QtOpenVG to set the EGLConfig
and EGLContext manually if they have some other way to determine
what the values should be (e.g. constructing a special config for a
specific platform). Also add a QEglProperties argument to
createContext() to allow fine-tuning of the context parameters.
Reviewed-by: Sarah Smith
Diffstat (limited to 'src/gui/egl/qegl.cpp')
-rw-r--r-- | src/gui/egl/qegl.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/gui/egl/qegl.cpp b/src/gui/egl/qegl.cpp index f06c153..840b9d6 100644 --- a/src/gui/egl/qegl.cpp +++ b/src/gui/egl/qegl.cpp @@ -60,7 +60,6 @@ QEglContext::QEglContext() , ctx(EGL_NO_CONTEXT) , cfg(0) , currentSurface(EGL_NO_SURFACE) - , share(false) , current(false) { } @@ -80,11 +79,6 @@ bool QEglContext::isValid() const return (ctx != EGL_NO_CONTEXT); } -bool QEglContext::isSharing() const -{ - return share; -} - bool QEglContext::isCurrent() const { return current; @@ -159,7 +153,7 @@ bool QEglContext::chooseConfig } // Create the EGLContext. -bool QEglContext::createContext(QEglContext *shareContext) +bool QEglContext::createContext(QEglContext *shareContext, const QEglProperties *properties) { // We need to select the correct API before calling eglCreateContext(). #ifdef EGL_OPENGL_ES_API @@ -173,6 +167,8 @@ bool QEglContext::createContext(QEglContext *shareContext) // Create a new context for the configuration. QEglProperties contextProps; + if (properties) + contextProps = *properties; #if defined(QT_OPENGL_ES_2) if (apiType == QEgl::OpenGL) contextProps.setValue(EGL_CONTEXT_CLIENT_VERSION, 2); @@ -193,7 +189,6 @@ bool QEglContext::createContext(QEglContext *shareContext) return false; } } - share = (shareContext != 0); return true; } @@ -216,7 +211,6 @@ void QEglContext::destroy() dpy = EGL_NO_DISPLAY; ctx = EGL_NO_CONTEXT; cfg = 0; - share = false; } bool QEglContext::makeCurrent(EGLSurface surface) |