diff options
author | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-05-11 16:50:00 +0100 |
---|---|---|
committer | Gareth Stockwell <ext-gareth.stockwell@nokia.com> | 2010-06-02 14:40:47 +0100 |
commit | d7057e7c1f1a4769c6e9b0e1c54446d5104c1484 (patch) | |
tree | 5278dbf2b152a39939d41b628df49e66ae5a8d8b /src/gui/painting | |
parent | 3a72235d7cf2aa953cb32654545c480fd2d08866 (diff) | |
download | qt4-tools-d7057e7c1f1a4769c6e9b0e1c54446d5104c1484.tar.gz |
Added reference counting to QWidgetBackingStore
On Symbian, the top-level widget's backing store must be destroyed when
it is no longer required, in order to conserve memory. The criteria
for destroying the backing store is when neither the TLW nor any of
its native descendents (which share the backing store) are visible.
In order to implement this requirement, a count must be kept of the
number of native widgets which are using the TLW's backing store.
This patch provides the mechanism for maintaining this count, and for
destroying the backing store when the count is decremented to zero.
No calls to either the increment nor decrement functions are made,
however, by this code included in this patch; this code will be added
to only the Symbian backend by a subsequent patch.
Task-number: QTBUG-8697
Reviewed-by: Bjørn Erik Nilsen
Reviewed-by: Jason Barron
Diffstat (limited to 'src/gui/painting')
-rw-r--r-- | src/gui/painting/qbackingstore.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/gui/painting/qbackingstore.cpp b/src/gui/painting/qbackingstore.cpp index 8de9eaa5c8..3ddffef7c2 100644 --- a/src/gui/painting/qbackingstore.cpp +++ b/src/gui/painting/qbackingstore.cpp @@ -914,7 +914,7 @@ void QWidgetPrivate::moveRect(const QRect &rect, int dx, int dy) invalidateBuffer((newRect & clipR).translated(-data.crect.topLeft())); } else { - QWidgetBackingStore *wbs = x->backingStore; + QWidgetBackingStore *wbs = x->backingStore.data(); QRegion childExpose(newRect & clipR); if (sourceRect.isValid() && wbs->bltRect(sourceRect, dx, dy, pw)) @@ -957,7 +957,7 @@ void QWidgetPrivate::scrollRect(const QRect &rect, int dx, int dy) if (x->inTopLevelResize) return; - QWidgetBackingStore *wbs = x->backingStore; + QWidgetBackingStore *wbs = x->backingStore.data(); if (!wbs) return; |