diff options
author | Anders Bakken <anders.bakken@nokia.com> | 2009-04-08 22:08:24 (GMT) |
---|---|---|
committer | Anders Bakken <anders.bakken@nokia.com> | 2009-04-09 01:05:56 (GMT) |
commit | d8dda2706408e0c9558966e74376834d290dc6e3 (patch) | |
tree | a19f83f7029401aff358d44aaa79223226335cd7 /src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp | |
parent | 2cf88ffef18622b5c08cd48d4cb0b5624c59a713 (diff) | |
download | Qt-d8dda2706408e0c9558966e74376834d290dc6e3.zip Qt-d8dda2706408e0c9558966e74376834d290dc6e3.tar.gz Qt-d8dda2706408e0c9558966e74376834d290dc6e3.tar.bz2 |
Make flipping and paintOnScreen work better
Make the paintOnScreen case paint directly on the primary surface if the
size of the window surface == size of primary surface.
Reviewed-by: Donald <qt-info@nokia.com>
Diffstat (limited to 'src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp')
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp | 26 |
1 files changed, 14 insertions, 12 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp index f5626c8..8ed308c 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbsurface.cpp @@ -139,28 +139,32 @@ void QDirectFBSurface::setGeometry(const QRect &rect, const QRegion &mask) dfbWindow = 0; } #endif - if (dfbSurface) { + if (dfbSurface && dfbSurface != screen->dfbSurface()) { dfbSurface->Release(dfbSurface); dfbSurface = 0; } } else if (rect != geometry()) { - const bool isResize = rect.size() != geometry().size(); DFBResult result = DFB_OK; // If we're in a resize, the surface shouldn't be locked - Q_ASSERT( (lockedImage == 0) || (isResize == false)); + Q_ASSERT((lockedImage == 0) || (rect.size() == geometry().size())); if (onscreen) { - if (dfbSurface) - dfbSurface->Release(dfbSurface); - - DFBRectangle r = { rect.x(), rect.y(), - rect.width(), rect.height() }; IDirectFBSurface *primarySurface = screen->dfbSurface(); Q_ASSERT(primarySurface); - result = primarySurface->GetSubSurface(primarySurface, &r, &dfbSurface); + if (dfbSurface && dfbSurface != primarySurface) + dfbSurface->Release(dfbSurface); + + if (rect == screen->region().boundingRect()) { + dfbSurface = primarySurface; + } else { + const DFBRectangle r = { rect.x(), rect.y(), + rect.width(), rect.height() }; + result = primarySurface->GetSubSurface(primarySurface, &r, &dfbSurface); + } forceRaster = (dfbSurface && QDirectFBScreen::getImageFormat(dfbSurface) == QImage::Format_RGB32); } else { + const bool isResize = rect.size() != geometry().size(); #ifdef QT_NO_DIRECTFB_WM if (isResize) { if (dfbSurface) @@ -362,10 +366,8 @@ void QDirectFBSurface::flush(QWidget *widget, const QRegion ®ion, if (winOpacity != opacity) dfbWindow->SetOpacity(dfbWindow, winOpacity); } -#endif -#ifndef QT_NO_DIRECTFB_WM if (!(flipFlags & DSFLIP_BLIT)) { - dfbSurface->Flip(dfbSurface, 0, DFBSurfaceFlipFlags(flipFlags)); + dfbSurface->Flip(dfbSurface, 0, flipFlags); } else { if (region.numRects() > 1) { const QVector<QRect> rects = region.rects(); |