summaryrefslogtreecommitdiffstats
path: root/src/opengl/qgl_symbian.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl/qgl_symbian.cpp')
-rw-r--r--src/opengl/qgl_symbian.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/opengl/qgl_symbian.cpp b/src/opengl/qgl_symbian.cpp
index b8e5c22..94c63fc 100644
--- a/src/opengl/qgl_symbian.cpp
+++ b/src/opengl/qgl_symbian.cpp
@@ -259,7 +259,7 @@ bool QGLContext::chooseContext(const QGLContext* shareContext) // almost same as
return true;
}
-void QGLWidget::resizeEvent(QResizeEvent *)
+void QGLWidget::resizeEvent(QResizeEvent *e)
{
Q_D(QGLWidget);
if (!isValid())
@@ -270,17 +270,18 @@ void QGLWidget::resizeEvent(QResizeEvent *)
if (this == qt_gl_share_widget())
return;
- if (QGLContext::currentContext())
- doneCurrent();
-
- // Symbian needs to recreate the surface on resize.
- d->recreateEglSurface();
+ if (!d->surfaceSizeInitialized || e->oldSize() != e->size()) {
+ // On Symbian we need to recreate the surface on resize.
+ d->recreateEglSurface();
+ d->surfaceSizeInitialized = true;
+ }
makeCurrent();
+
if (!d->glcx->initialized())
glInit();
+
resizeGL(width(), height());
- //handle overlay
}
const QGLContext* QGLWidget::overlayContext() const
@@ -363,6 +364,9 @@ void QGLWidgetPrivate::recreateEglSurface()
WId currentId = q->winId();
if (glcx->d_func()->eglSurface != EGL_NO_SURFACE) {
+ if (glcx == QGLContext::currentContext())
+ glcx->doneCurrent();
+
eglDestroySurface(glcx->d_func()->eglContext->display(),
glcx->d_func()->eglSurface);
}