diff -r b72c6db6890b -r 5dc02b23752f src/gui/painting/qwindowsurface.cpp --- a/src/gui/painting/qwindowsurface.cpp Wed Jun 23 19:07:03 2010 +0300 +++ b/src/gui/painting/qwindowsurface.cpp Tue Jul 06 15:10:48 2010 +0300 @@ -49,13 +49,19 @@ class QWindowSurfacePrivate { public: - QWindowSurfacePrivate(QWidget *w) : window(w), staticContentsSupport(false) {} + QWindowSurfacePrivate(QWidget *w) + : window(w) + , staticContentsSupport(0) + , partialUpdateSupport(1) + { + } QWidget *window; QRect geometry; QRegion staticContents; QList bufferImages; - bool staticContentsSupport; + uint staticContentsSupport : 1; + uint partialUpdateSupport : 1; }; /*! @@ -284,6 +290,10 @@ void QWindowSurface::setStaticContentsSupport(bool enable) { + if (enable && !d_ptr->partialUpdateSupport) { + qWarning("QWindowSurface::setStaticContentsSupport: static contents support requires partial update support"); + return; + } d_ptr->staticContentsSupport = enable; } @@ -302,6 +312,20 @@ return d_ptr->staticContentsSupport && !d_ptr->staticContents.isEmpty(); } +bool QWindowSurface::hasPartialUpdateSupport() const +{ + return d_ptr->partialUpdateSupport; +} + +void QWindowSurface::setPartialUpdateSupport(bool enable) +{ + if (!enable && d_ptr->staticContentsSupport) { + qWarning("QWindowSurface::setPartialUpdateSupport: static contents support requires partial update support"); + return; + } + d_ptr->partialUpdateSupport = enable; +} + void qt_scrollRectInImage(QImage &img, const QRect &rect, const QPoint &offset) { // make sure we don't detach