summaryrefslogtreecommitdiffstats
path: root/src/openvg/qpaintengine_vg.cpp
diff options
context:
space:
mode:
authormread <qt-info@nokia.com>2012-01-09 15:04:18 (GMT)
committerQt by Nokia <qt-info@nokia.com>2012-01-13 15:32:52 (GMT)
commit854e72538426b32f72acd6c6c76af04bc8b78994 (patch)
tree86edc947d0c4d9498d0b206688c74e8ee0c9c01c /src/openvg/qpaintengine_vg.cpp
parent01ec128db5e2641a4fa0b8a8a9b6fc20ea1e02ba (diff)
downloadQt-854e72538426b32f72acd6c6c76af04bc8b78994.zip
Qt-854e72538426b32f72acd6c6c76af04bc8b78994.tar.gz
Qt-854e72538426b32f72acd6c6c76af04bc8b78994.tar.bz2
Recovering from draw failures after EGL surface creation failure
The Qt drawing system is not designed to handle failures in beginPaint and endPaint. But the Symbian port is creating EGL contexts and surfaces on demand in these functions. These can fail, eg in the defect reported the app gets a visibile=true event for such a short period that it fails to create the surface before it is invisible again. These failures have to be coped with. Brush image drawing is failing if the app is asked to draw while in the background, because the EGL surface cannot be created. After this, if the app comes to the foreground at the wrong time, the failed drawing is shown on the screen as a flat colored area. A failedToAlloc variable in the openvg paint engine was locking in this failed drawing, so that it would never redraw. This is fixed by removing all use of that variable. Failed surface creation during a draw in response to a visibility change event was also leaving the window backing store with bad content. This is now cleared on a surface creation failure so that drawing is retried when the next visibility change event arrives. The retry mechanism for creating a surface on failure also makes the problem circumstances more likely to occur and can block the app unnecessarily. Now, instead of blocking for 1 second every time on failed surface creation, it only blocks on the first failure in a sequence thereby allowing other parts of the app to run freely while it is in the background. Task-number: ou1cimx1#951921 Change-Id: I1e27746957ff624b0d9a1cdc9b319d0a3477135d Reviewed-by: Gareth Stockwell <gareth.stockwell@accenture.com> Reviewed-by: Shane Kearns <ext-shane.2.kearns@nokia.com>
Diffstat (limited to 'src/openvg/qpaintengine_vg.cpp')
-rw-r--r--src/openvg/qpaintengine_vg.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/openvg/qpaintengine_vg.cpp b/src/openvg/qpaintengine_vg.cpp
index a082e08..d8b45de 100644
--- a/src/openvg/qpaintengine_vg.cpp
+++ b/src/openvg/qpaintengine_vg.cpp
@@ -3343,15 +3343,9 @@ void QVGPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF
else
drawVGImage(d, r, vgpd->toVGImage(d->opacity), vgpd->size(), sr);
- if(!vgpd->failedToAlloc)
+ if (vgpd->vgImage != VG_INVALID_HANDLE)
return;
- // try to reallocate next time if reasonable small pixmap
- QSize screenSize = QApplication::desktop()->screenGeometry().size();
- if (pm.size().width() <= screenSize.width()
- && pm.size().height() <= screenSize.height())
- vgpd->failedToAlloc = false;
-
vgpd->source.beginDataAccess();
drawImage(r, vgpd->source.imageRef(), sr, Qt::AutoColor);
vgpd->source.endDataAccess(true);
@@ -3375,15 +3369,9 @@ void QVGPaintEngine::drawPixmap(const QPointF &pos, const QPixmap &pm)
else
drawVGImage(d, pos, vgpd->toVGImage(d->opacity));
- if (!vgpd->failedToAlloc)
+ if (vgpd->vgImage != VG_INVALID_HANDLE)
return;
- // try to reallocate next time if reasonable small pixmap
- QSize screenSize = QApplication::desktop()->screenGeometry().size();
- if (pm.size().width() <= screenSize.width()
- && pm.size().height() <= screenSize.height())
- vgpd->failedToAlloc = false;
-
vgpd->source.beginDataAccess();
drawImage(pos, vgpd->source.imageRef());
vgpd->source.endDataAccess(true);