summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Bakken <anders.bakken@nokia.com>2009-09-04 09:42:14 -0700
committerAnders Bakken <anders.bakken@nokia.com>2009-09-04 09:42:14 -0700
commit3a18d6876f74ffbc415844fef5b1e49c083ded5d (patch)
treed98614d245e3130fdbd5e29ea3ae3289b712433e
parent27745a63a8fec14e9ea99e3860b05da8be21a1ff (diff)
Remove unnecessary call to exposeRegion in DFB
If we make sure to erase the background to background color in connect() we don't have to do it in setGeometry. Also clean up the code in QDBWindowSurface::flush Reviewed-by: Donald Carr <donald.carr@nokia.com>
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp4
-rw-r--r--src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp16
2 files changed, 8 insertions, 12 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
index b966ee2614..84a74c9c5f 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbscreen.cpp
@@ -1287,6 +1287,10 @@ bool QDirectFBScreen::connect(const QString &displaySpec)
}
if (!d_ptr->backgroundColor.isValid())
d_ptr->backgroundColor = Qt::green;
+ d_ptr->primarySurface->Clear(d_ptr->primarySurface, d_ptr->backgroundColor.red(),
+ d_ptr->backgroundColor.green(), d_ptr->backgroundColor.blue(),
+ d_ptr->backgroundColor.alpha());
+ d_ptr->primarySurface->Flip(d_ptr->primarySurface, 0, d_ptr->flipFlags);
#endif
return true;
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
index e2b439eb95..b1ffe6923b 100644
--- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
+++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp
@@ -248,10 +248,6 @@ void QDirectFBWindowSurface::setGeometry(const QRect &rect)
updateFormat();
QWSWindowSurface::setGeometry(rect);
-#ifdef QT_NO_DIRECTFB_WM
- if (oldRect.isEmpty())
- screen->exposeRegion(screen->region(), 0);
-#endif
}
QByteArray QDirectFBWindowSurface::permanentState() const
@@ -357,15 +353,11 @@ void QDirectFBWindowSurface::flush(QWidget *widget, const QRegion &region,
const QRect windowGeometry = QDirectFBWindowSurface::geometry();
#ifdef QT_NO_DIRECTFB_WM
if (mode == Offscreen) {
- QRegion r = region;
- r.translate(offset + windowGeometry.topLeft());
- screen->exposeRegion(r, 0);
- } else {
- screen->flipSurface(dfbSurface, flipFlags, region, offset);
- }
-#else
- screen->flipSurface(dfbSurface, flipFlags, region, offset);
+ screen->exposeRegion(region.translated(offset + geometry().topLeft()), 0);
+
+ } else
#endif
+ screen->flipSurface(dfbSurface, flipFlags, region, offset);
#ifdef QT_DIRECTFB_TIMING
enum { Secs = 3 };