summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gui/kernel/qapplication_s60.cpp11
-rw-r--r--src/gui/kernel/qt_s60_p.h1
-rw-r--r--src/gui/painting/qdrawutil.cpp5
-rw-r--r--src/opengl/qwindowsurface_gl.cpp5
4 files changed, 21 insertions, 1 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp
index 67cb6bd4a2..9b191dc9ec 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 4fd194625b..7363f4b3e1 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 1e98b05ba5..3d8e2ed775 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 d512946c01..67c8c2930c 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";