summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Barron <jbarron@trolltech.com>2009-04-30 07:18:35 (GMT)
committerJason Barron <jbarron@trolltech.com>2009-04-30 07:18:35 (GMT)
commit9b091d474a0584ea5aa271d466833cfb24e9a5da (patch)
tree5b1522845707c97033d5613c13a89257c7c7fc44
parent065cc545c985f31751edb1b80d577af8c964255f (diff)
downloadQt-9b091d474a0584ea5aa271d466833cfb24e9a5da.zip
Qt-9b091d474a0584ea5aa271d466833cfb24e9a5da.tar.gz
Qt-9b091d474a0584ea5aa271d466833cfb24e9a5da.tar.bz2
Small optimization when hiding windows.
When a window is hidden, it will call releaseBuffer() on the backing store which in turn will resize the window surface to a null rect. In this case, there is no need to update the QImage with the data pointer since it will be updated on the subsequent beginPaint() when the image is resized to a valid size again. This also avoids doing unnecessary locking on the FBSERV heap which still involves a context switch on older versions of Symbian.
-rw-r--r--src/gui/painting/qwindowsurface_s60.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/gui/painting/qwindowsurface_s60.cpp b/src/gui/painting/qwindowsurface_s60.cpp
index 85190c2..2618ce2 100644
--- a/src/gui/painting/qwindowsurface_s60.cpp
+++ b/src/gui/painting/qwindowsurface_s60.cpp
@@ -144,12 +144,13 @@ void QS60WindowSurface::setGeometry(const QRect& rect)
if (rect == geometry())
return;
+ QWindowSurface::setGeometry(rect);
+
TRect nativeRect(qt_QRect2TRect(rect));
User::LeaveIfError(d_ptr->bitmap->Resize(nativeRect.Size()));
- updatePaintDeviceOnBitmap();
-
- QWindowSurface::setGeometry(rect);
+ if (!rect.isNull())
+ updatePaintDeviceOnBitmap();
}
void QS60WindowSurface::lockBitmapHeap()