diff options
author | Oliver Wolff <oliver.wolff@qt.io> | 2018-04-12 13:59:51 +0200 |
---|---|---|
committer | Oliver Wolff <oliver.wolff@qt.io> | 2018-04-13 12:16:54 +0000 |
commit | a8906e35103c9c30597bf3b0034371498669f9da (patch) | |
tree | b97ba88d2ca57fca6092c4a21bcdcae814163232 /src/plugins/platforms/winrt | |
parent | 26355be54d7e7aa1c8e6a7adcb6bb9de68700dd9 (diff) |
winrt: QWinRTEGLContext: add isValid functionality
QPlatformOpenGLContext::isValid always returns true
but it is possible that creation of the context fails
in QWinRTEGLContext. This case should be reflected in
isValid because other places (like QOpenGLContext::isValid())
rely on it and not having proper information about the
validity of the context might lead to crashes.
Task-number: QTBUG-67568
Change-Id: If989ca47cdf7b27c44961beee5d97a4647184b0a
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
Diffstat (limited to 'src/plugins/platforms/winrt')
-rw-r--r-- | src/plugins/platforms/winrt/qwinrteglcontext.cpp | 6 | ||||
-rw-r--r-- | src/plugins/platforms/winrt/qwinrteglcontext.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/platforms/winrt/qwinrteglcontext.cpp b/src/plugins/platforms/winrt/qwinrteglcontext.cpp index 8a250c516a..eeb79be2e6 100644 --- a/src/plugins/platforms/winrt/qwinrteglcontext.cpp +++ b/src/plugins/platforms/winrt/qwinrteglcontext.cpp @@ -354,6 +354,12 @@ QFunctionPointer QWinRTEGLContext::getProcAddress(const char *procName) return eglGetProcAddress(procName); } +bool QWinRTEGLContext::isValid() const +{ + Q_D(const QWinRTEGLContext); + return d->eglContext != EGL_NO_CONTEXT; +} + EGLDisplay QWinRTEGLContext::display() { return g->eglDisplay; diff --git a/src/plugins/platforms/winrt/qwinrteglcontext.h b/src/plugins/platforms/winrt/qwinrteglcontext.h index 5c75aa90d0..325dc82c40 100644 --- a/src/plugins/platforms/winrt/qwinrteglcontext.h +++ b/src/plugins/platforms/winrt/qwinrteglcontext.h @@ -60,6 +60,7 @@ public: QSurfaceFormat format() const override; QFunctionPointer getProcAddress(const char *procName) override; + bool isValid() const override; static EGLDisplay display(); private: |