summaryrefslogtreecommitdiffstats
path: root/src/opengl/qwindowsurface_gl.cpp
diff options
context:
space:
mode:
authorOlivier Goffart <olivier.goffart@nokia.com>2011-04-27 09:27:52 (GMT)
committerOlivier Goffart <olivier.goffart@nokia.com>2011-04-27 09:27:52 (GMT)
commit896db169ea224deb96c59ce8af800d019de63f12 (patch)
tree8350c36941ccfd74df35fb8a6a761edcbf042452 /src/opengl/qwindowsurface_gl.cpp
parent7a73de74fc517ff5722289cce4e4e754ff2417be (diff)
parentf8fea6f3b8fd3a1baa256130b23efc9e67a40e21 (diff)
downloadQt-896db169ea224deb96c59ce8af800d019de63f12.zip
Qt-896db169ea224deb96c59ce8af800d019de63f12.tar.gz
Qt-896db169ea224deb96c59ce8af800d019de63f12.tar.bz2
Merge remote-tracking branch 'origin/4.7' into qt-4.8-from-4.7
Conflicts: src/opengl/qwindowsurface_gl.cpp src/s60installs/eabi/QtGuiu.def
Diffstat (limited to 'src/opengl/qwindowsurface_gl.cpp')
-rw-r--r--src/opengl/qwindowsurface_gl.cpp48
1 files changed, 16 insertions, 32 deletions
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp
index 70c1fde..56e2c3b 100644
--- a/src/opengl/qwindowsurface_gl.cpp
+++ b/src/opengl/qwindowsurface_gl.cpp
@@ -717,7 +717,6 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint &
} else {
glFlush();
}
-
return;
}
@@ -874,8 +873,22 @@ void QGLWindowSurface::updateGeometry() {
bool hijack(true);
QWidgetPrivate *wd = window()->d_func();
- if (wd->extraData() && wd->extraData()->glContext)
- hijack = false; // we already have gl context for widget
+ if (wd->extraData() && wd->extraData()->glContext) {
+#ifdef Q_OS_SYMBIAN // Symbian needs to recreate the context when native window size changes
+ if (d_ptr->size != geometry().size()) {
+ if (window() != qt_gl_share_widget())
+ --(_qt_gl_share_widget()->widgetRefCount);
+
+ delete wd->extraData()->glContext;
+ wd->extraData()->glContext = 0;
+ d_ptr->ctx = 0;
+ }
+ else
+#endif
+ {
+ hijack = false; // we already have gl context for widget
+ }
+ }
if (hijack)
hijackWindow(window());
@@ -896,35 +909,6 @@ void QGLWindowSurface::updateGeometry() {
d_ptr->size = surfSize;
-#ifdef Q_OS_SYMBIAN
- if (!hijack) { // Symbian needs to recreate EGL surface when native window size changes
- if (ctx->d_func()->eglSurface != EGL_NO_SURFACE) {
- eglDestroySurface(ctx->d_func()->eglContext->display(),
- ctx->d_func()->eglSurface);
- }
-
- ctx->d_func()->eglSurface = QEgl::createSurface(ctx->device(),
- ctx->d_func()->eglContext->config());
-
- eglGetError(); // Clear error state.
- if (!d_ptr->destructive_swap_buffers) {
- eglSurfaceAttrib(ctx->d_func()->eglContext->display(),
- ctx->d_func()->eglSurface,
- EGL_SWAP_BEHAVIOR, EGL_BUFFER_PRESERVED);
-
- if (eglGetError() != EGL_SUCCESS)
- qWarning("QGLWindowSurface: could not enable preserved swap behaviour");
- } else {
- eglSurfaceAttrib(ctx->d_func()->eglContext->display(),
- ctx->d_func()->eglSurface,
- EGL_SWAP_BEHAVIOR, EGL_BUFFER_DESTROYED);
-
- if (eglGetError() != EGL_SUCCESS)
- qWarning("QGLWindowSurface: could not enable destroyed swap behaviour");
- }
- }
-#endif
-
if (d_ptr->ctx) {
#ifndef QT_OPENGL_ES_2
if (d_ptr->destructive_swap_buffers)