summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qcocoaglcontext.mm
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2012-05-29 15:23:25 +0200
committerQt by Nokia <qt-info@nokia.com>2012-06-05 18:48:00 +0200
commite1774d202912b5d053872f242c61d964a5d69450 (patch)
tree2db13710c7d5979e5b49639b9ed5ef3f566a2beb /src/plugins/platforms/cocoa/qcocoaglcontext.mm
parent7d28f7772cd8f5aad63359ed0b9c57c12923dc85 (diff)
Verify the surfaceType before activating the GL context
Verify that the surfaceType() of the QPlatformContext is of type OpenGLSurface before making the context active. Make it possible to get the QSurface from a QPlatformSurface, make QPlatformWindow use that to access the QWindow. Remove the setSurfaceType call from the eglfs plugin as this hiding a problem. Change-Id: I08906da052e066bb1f1f042030643c6389ab17d7 Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com> Reviewed-by: Girish Ramakrishnan <girish.1.ramakrishnan@nokia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa/qcocoaglcontext.mm')
-rw-r--r--src/plugins/platforms/cocoa/qcocoaglcontext.mm2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/plugins/platforms/cocoa/qcocoaglcontext.mm b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
index 637678c19e..0292e02ff1 100644
--- a/src/plugins/platforms/cocoa/qcocoaglcontext.mm
+++ b/src/plugins/platforms/cocoa/qcocoaglcontext.mm
@@ -86,6 +86,8 @@ void QCocoaGLContext::swapBuffers(QPlatformSurface *surface)
bool QCocoaGLContext::makeCurrent(QPlatformSurface *surface)
{
+ Q_ASSERT(surface->surface()->surfaceType() == QSurface::OpenGLSurface);
+
QCocoaAutoReleasePool pool;
QWindow *window = static_cast<QCocoaWindow *>(surface)->window();