diff options
author | Liang Qi <liang.qi@nokia.com> | 2011-10-07 12:21:59 (GMT) |
---|---|---|
committer | Liang Qi <liang.qi@nokia.com> | 2011-10-07 12:21:59 (GMT) |
commit | 7cf9030bd7a50b6d98d454510417c6ecc3f33d49 (patch) | |
tree | 7c5c562ba490e217d8cef81ff1fd5958a0cacccb /src/gui/egl | |
parent | 7f3cd2949ccb16b1b611c05bf6ab7274cf04a0f8 (diff) | |
parent | 96fcfc720aa1c6d0b6d741f8169cd37ea9fcd9a9 (diff) | |
download | Qt-7cf9030bd7a50b6d98d454510417c6ecc3f33d49.zip Qt-7cf9030bd7a50b6d98d454510417c6ecc3f33d49.tar.gz Qt-7cf9030bd7a50b6d98d454510417c6ecc3f33d49.tar.bz2 |
Merge remote-tracking branch 'origin/4.7' into qt-4.8-from-4.7
Conflicts:
doc/src/getting-started/installation.qdoc
doc/src/platforms/platform-notes.qdoc
src/corelib/tools/qlocale_symbian.cpp
src/gui/kernel/qwidget_p.h
src/network/access/qnetworkaccesshttpbackend.cpp
src/opengl/qgl.cpp
src/plugins/bearer/symbian/qnetworksession_impl.cpp
Diffstat (limited to 'src/gui/egl')
-rw-r--r-- | src/gui/egl/qegl.cpp | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/gui/egl/qegl.cpp b/src/gui/egl/qegl.cpp index 2a37d45..6fe1c8c 100644 --- a/src/gui/egl/qegl.cpp +++ b/src/gui/egl/qegl.cpp @@ -684,6 +684,37 @@ EGLSurface QEgl::createSurface(QPaintDevice *device, EGLConfig cfg, const QEglPr else props = 0; EGLSurface surf; +#ifdef Q_OS_SYMBIAN + // On Symbian there might be situations (especially on 32MB GPU devices) + // where Qt is trying to create EGL surface while some other application + // is still holding all available GPU memory but is about to release it + // soon. For an example when exiting native video recorder and going back to + // Qt application behind it. Video stack tear down takes some time and Qt + // app might be too quick in reserving its EGL surface and thus running out + // of GPU memory right away. So if EGL surface creation fails due to bad + // alloc, let's try recreating it four times within ~1 second if needed. + // This strategy gives some time for video recorder to tear down its stack + // and a chance to Qt for creating a valid surface. + int tries = 4; + while(tries--) { + if (devType == QInternal::Widget) + surf = eglCreateWindowSurface(QEgl::display(), cfg, windowDrawable, props); + else + surf = eglCreatePixmapSurface(QEgl::display(), cfg, pixmapDrawable, props); + if (surf == EGL_NO_SURFACE) { + EGLint error = eglGetError(); + if (error == EGL_BAD_ALLOC) { + if (tries) { + User::After(1000 * 250); // 250ms + continue; + } + } + qWarning("QEglContext::createSurface(): Unable to create EGL surface, error = 0x%x", error); + } else { + break; + } + } +#else if (devType == QInternal::Widget) surf = eglCreateWindowSurface(QEgl::display(), cfg, windowDrawable, props); else @@ -691,6 +722,7 @@ EGLSurface QEgl::createSurface(QPaintDevice *device, EGLConfig cfg, const QEglPr if (surf == EGL_NO_SURFACE) { qWarning("QEglContext::createSurface(): Unable to create EGL surface, error = 0x%x", eglGetError()); } +#endif return surf; } #endif |