diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 11 | ||||
-rw-r--r-- | src/gui/kernel/qt_s60_p.h | 1 | ||||
-rw-r--r-- | src/gui/painting/qdrawutil.cpp | 5 | ||||
-rw-r--r-- | src/opengl/qwindowsurface_gl.cpp | 5 |
4 files changed, 21 insertions, 1 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 2338ff4..38947e1 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -243,7 +243,9 @@ void QS60Data::controlVisibilityChanged(CCoeControl *control, bool visible) QApplicationPrivate *d = QApplicationPrivate::instance(); d->emitAboutToUseGpuResources(); - if (backingStore.data()) { + // (Re)create the backing store and force repaint if we have no + // backing store already, or EGL surface cration failed on last attempt. + if (backingStore.data() && !S60->eglSurfaceCreationError) { backingStore.registerWidget(widget); } else { S60->eglSurfaceCreationError = false; @@ -1348,6 +1350,13 @@ void QSymbianControl::Draw(const TRect& aRect) const void QSymbianControl::doDraw(const TRect& controlRect) const { + // Bail out immediately, if we don't have a drawing surface. Surface is attempted to be recreated + // when this application becomes visible for the next time. + if (S60->eglSurfaceCreationError) { + qWarning() << "QSymbianControl::doDraw: EGL surface creation has failed, abort"; + return; + } + // Set flag to avoid calling DrawNow in window surface QWidget *window = qwidget->window(); Q_ASSERT(window); diff --git a/src/gui/kernel/qt_s60_p.h b/src/gui/kernel/qt_s60_p.h index ab0aeb5..e1f50f4 100644 --- a/src/gui/kernel/qt_s60_p.h +++ b/src/gui/kernel/qt_s60_p.h @@ -388,6 +388,7 @@ inline QS60Data::QS60Data() screenFurnitureFullyCreated(0), beginFullScreenCalled(0), endFullScreenCalled(0), + eglSurfaceCreationError(0), s60ApplicationFactory(0), s60InstalledTrapHandler(0), editorFlags(0) diff --git a/src/gui/painting/qdrawutil.cpp b/src/gui/painting/qdrawutil.cpp index 2f5babf..1facd8f 100644 --- a/src/gui/painting/qdrawutil.cpp +++ b/src/gui/painting/qdrawutil.cpp @@ -1105,6 +1105,11 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin const QPixmap &pixmap, const QRect &sourceRect,const QMargins &sourceMargins, const QTileRules &rules, QDrawBorderPixmap::DrawingHints hints) { + if (!painter->isActive()) { + qWarning("qDrawBorderPixmap: Painter not active"); + return; + } + QRectFArray sourceData[2]; QRectFArray targetData[2]; diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp index c39eb53..81e857f 100644 --- a/src/opengl/qwindowsurface_gl.cpp +++ b/src/opengl/qwindowsurface_gl.cpp @@ -693,6 +693,11 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint & } QGLContext *ctx = reinterpret_cast<QGLContext *>(parent->d_func()->extraData()->glContext); +#ifdef Q_OS_SYMBIAN + if (!ctx) + return; +#endif + if (widget != window()) { if (initializeOffscreenTexture(window()->size())) qWarning() << "QGLWindowSurface: Flushing to native child widget, may lead to significant performance loss"; |