diff options
author | Jason Barron <jbarron@trolltech.com> | 2010-02-04 13:15:56 (GMT) |
---|---|---|
committer | Jason Barron <jbarron@trolltech.com> | 2010-02-04 14:10:47 (GMT) |
commit | 91e236022acd79dfbc4aef9e30edb4d1aeb2685c (patch) | |
tree | a23bbc7bbdb65423e569ac70ffcd3388b9555064 /src/gui/kernel | |
parent | 56d1da45bc15989542fe3621c9c9de444219729c (diff) | |
download | Qt-91e236022acd79dfbc4aef9e30edb4d1aeb2685c.zip Qt-91e236022acd79dfbc4aef9e30edb4d1aeb2685c.tar.gz Qt-91e236022acd79dfbc4aef9e30edb4d1aeb2685c.tar.bz2 |
Flush the WSERV command buffer after deleting a surface.
For graphics systems that use EGL surfaces in the backing store
destroying the surface does not guarantee that the memory is
immediately freed because this command does not cause a flush. This
implies that a manual flush is instead needed. We do this in 2 places;
the first is when the surface is destroyed due to a visibility changed.
The second case is just after the window has been destroyed. At this
point the backing store has already been deleted so the deletion of
both the surface and window can happen atomically in WSERV.
Task-number: QT-2506
Reviewed-by: Iain
Diffstat (limited to 'src/gui/kernel')
-rw-r--r-- | src/gui/kernel/qapplication_s60.cpp | 3 | ||||
-rw-r--r-- | src/gui/kernel/qwidget_s60.cpp | 4 |
2 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/kernel/qapplication_s60.cpp b/src/gui/kernel/qapplication_s60.cpp index 6caac9f..6e03d7c 100644 --- a/src/gui/kernel/qapplication_s60.cpp +++ b/src/gui/kernel/qapplication_s60.cpp @@ -1647,6 +1647,9 @@ int QApplicationPrivate::symbianProcessWsEvent(const QSymbianEvent *symbianEvent if (visChangedEvent->iFlags & TWsVisibilityChangedEvent::ENotVisible) { delete w->d_func()->topData()->backingStore; w->d_func()->topData()->backingStore = 0; + // In order to ensure that any resources used by the window surface + // are immediately freed, we flush the WSERV command buffer. + S60->wsSession().Flush(); } else if ((visChangedEvent->iFlags & TWsVisibilityChangedEvent::EPartiallyVisible) && !w->d_func()->maybeBackingStore()) { w->d_func()->topData()->backingStore = new QWidgetBackingStore(w); diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 00f2213..0ce7534 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -1195,6 +1195,10 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) if (destroyWindow) { delete id; + // At this point the backing store should already be destroyed + // so we flush the command buffer to ensure that the freeing of + // those resources and deleting the window can happen "atomically" + S60->wsSession().Flush(); } } |