From 9b091d474a0584ea5aa271d466833cfb24e9a5da Mon Sep 17 00:00:00 2001 From: Jason Barron Date: Thu, 30 Apr 2009 09:18:35 +0200 Subject: 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. --- src/gui/painting/qwindowsurface_s60.cpp | 7 ++++--- 1 file 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() -- cgit v0.12