diff options
Diffstat (limited to 'src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp')
-rw-r--r-- | src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp | 68 |
1 files changed, 11 insertions, 57 deletions
diff --git a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp index 58f7098..61cfec51 100644 --- a/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp +++ b/src/plugins/gfxdrivers/directfb/qdirectfbwindowsurface.cpp @@ -238,9 +238,6 @@ void QDirectFBWindowSurface::setGeometry(const QRect &rect) if (!dfbSurface) { dfbSurface = screen->createDFBSurface(rect.size(), screen->pixelFormat(), QDirectFBScreen::DontTrackSurface); } - const QRegion region = QRegion(oldRect.isEmpty() ? screen->region() : QRegion(oldRect)).subtracted(rect); - screen->erase(region); - screen->flipSurface(primarySurface, flipFlags, region, QPoint()); } if (result != DFB_OK) DirectFBErrorFatal("QDirectFBWindowSurface::setGeometry()", result); @@ -250,6 +247,10 @@ 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 @@ -350,63 +351,16 @@ void QDirectFBWindowSurface::flush(QWidget *, const QRegion ®ion, const QRect windowGeometry = QDirectFBWindowSurface::geometry(); #ifdef QT_NO_DIRECTFB_WM - IDirectFBSurface *primarySurface = screen->primarySurface(); if (mode == Offscreen) { - primarySurface->SetBlittingFlags(primarySurface, DSBLIT_NOFX); - const QRect windowRect(0, 0, windowGeometry.width(), windowGeometry.height()); - const int n = region.numRects(); - if (n == 1 || boundingRectFlip ) { - const QRect regionBoundingRect = region.boundingRect().translated(offset); - const QRect source = windowRect & regionBoundingRect; - const DFBRectangle rect = { - source.x(), source.y(), source.width(), source.height() - }; - primarySurface->Blit(primarySurface, dfbSurface, &rect, - windowGeometry.x() + source.x(), - windowGeometry.y() + source.y()); - } else { - const QVector<QRect> rects = region.rects(); - QVarLengthArray<DFBRectangle, 16> dfbRectangles(n); - QVarLengthArray<DFBPoint, 16> dfbPoints(n); - - for (int i=0; i<n; ++i) { - const QRect &r = rects.at(i).translated(offset); - const QRect source = windowRect & r; - DFBRectangle &rect = dfbRectangles[i]; - rect.x = source.x(); - rect.y = source.y(); - rect.w = source.width(); - rect.h = source.height(); - dfbPoints[i].x = (windowGeometry.x() + source.x()); - dfbPoints[i].y = (windowGeometry.y() + source.y()); - } - primarySurface->BatchBlit(primarySurface, dfbSurface, dfbRectangles.constData(), - dfbPoints.constData(), n); - } - } - -#ifdef QT_NO_DIRECTFB_CURSOR - if (QScreenCursor *cursor = QScreenCursor::instance()) { - const QRect cursorRectangle = cursor->boundingRect(); - if (cursor->isVisible() && !cursor->isAccelerated() - && region.intersects(cursorRectangle.translated(-(offset + windowGeometry.topLeft())))) { - const QImage image = cursor->image(); - - IDirectFBSurface *surface = screen->createDFBSurface(image, image.format(), QDirectFBScreen::DontTrackSurface); - primarySurface->SetBlittingFlags(primarySurface, DSBLIT_BLEND_ALPHACHANNEL); - primarySurface->Blit(primarySurface, surface, 0, cursorRectangle.x(), cursorRectangle.y()); - surface->Release(surface); -#if (Q_DIRECTFB_VERSION >= 0x010000) - primarySurface->ReleaseSource(primarySurface); -#endif - } + QRegion r = region; + r.translate(offset + windowGeometry.topLeft()); + screen->exposeRegion(r, 0); + } else { + screen->flipSurface(dfbSurface, flipFlags, region, offset); } -#endif - if (mode == Offscreen) { - screen->flipSurface(primarySurface, flipFlags, region, offset + windowGeometry.topLeft()); - } else -#endif +#else screen->flipSurface(dfbSurface, flipFlags, region, offset); +#endif #ifdef QT_DIRECTFB_TIMING enum { Secs = 3 }; |