diff options
author | Jørgen Lind <jorgen.lind@nokia.com> | 2010-01-06 14:16:13 (GMT) |
---|---|---|
committer | Jørgen Lind <jorgen.lind@nokia.com> | 2010-01-06 14:16:13 (GMT) |
commit | 86bc22465a43496950bc0bf8901673ccd6c65fc3 (patch) | |
tree | dd4827b1f7c71a6efb88f16f158cacbcd623307a /src/plugins | |
parent | c489e061817d0880ac3f1492d8decf749a502e6f (diff) | |
download | Qt-86bc22465a43496950bc0bf8901673ccd6c65fc3.zip Qt-86bc22465a43496950bc0bf8901673ccd6c65fc3.tar.gz Qt-86bc22465a43496950bc0bf8901673ccd6c65fc3.tar.bz2 |
Added DirectFb scrolling to minimaldfb
Diffstat (limited to 'src/plugins')
3 files changed, 24 insertions, 3 deletions
diff --git a/src/plugins/graphicssystems/minimaldfb/qdirectfbinput.cpp b/src/plugins/graphicssystems/minimaldfb/qdirectfbinput.cpp index 00c2310..b8f6dd9 100644 --- a/src/plugins/graphicssystems/minimaldfb/qdirectfbinput.cpp +++ b/src/plugins/graphicssystems/minimaldfb/qdirectfbinput.cpp @@ -102,8 +102,9 @@ void QDirectFbInput::handleMouseEvents(const DFBEvent &event) Qt::MouseButtons buttons = QDirectFbConvenience::mouseButtons(event.window.buttons); QWidget *tlw = tlwMap.value(event.window.window_id); + IDirectFBDisplayLayer *layer = QDirectFbConvenience::dfbDisplayLayer(); IDirectFBWindow *window; - QDirectFbConvenience::dfbDisplayLayer()->GetWindow(layer,event.window.window_id,&window); + layer->GetWindow(layer,event.window.window_id,&window); if (event.window.type == DWET_BUTTONDOWN) { static long prevTime = 0; diff --git a/src/plugins/graphicssystems/minimaldfb/qgraphicssystem_minimaldfb.cpp b/src/plugins/graphicssystems/minimaldfb/qgraphicssystem_minimaldfb.cpp index 2d471e4..8bba616 100644 --- a/src/plugins/graphicssystems/minimaldfb/qgraphicssystem_minimaldfb.cpp +++ b/src/plugins/graphicssystems/minimaldfb/qgraphicssystem_minimaldfb.cpp @@ -57,7 +57,7 @@ QT_BEGIN_NAMESPACE QDirectFbGraphicsSystemScreen::QDirectFbGraphicsSystemScreen(int display) :QGraphicsSystemScreen() , m_input(this) { - IDirectFBDisplayLayer *m_layer = QDirectFbConvenience::dfbDisplayLayer(display); + m_layer = QDirectFbConvenience::dfbDisplayLayer(display); m_layer->SetCooperativeLevel(m_layer,DLSCL_SHARED); DFBDisplayLayerConfig config; diff --git a/src/plugins/graphicssystems/minimaldfb/qwindowsurface_minimaldfb.cpp b/src/plugins/graphicssystems/minimaldfb/qwindowsurface_minimaldfb.cpp index f7229e9..93ea44f 100644 --- a/src/plugins/graphicssystems/minimaldfb/qwindowsurface_minimaldfb.cpp +++ b/src/plugins/graphicssystems/minimaldfb/qwindowsurface_minimaldfb.cpp @@ -107,9 +107,29 @@ void QDirectFbWindowSurface::setGeometry(const QRect &rect) } +static inline void scrollSurface(IDirectFBSurface *surface, const QRect &r, int dx, int dy) +{ + const DFBRectangle rect = { r.x(), r.y(), r.width(), r.height() }; + surface->Blit(surface, surface, &rect, r.x() + dx, r.y() + dy); + const DFBRegion region = { rect.x + dx, rect.y + dy, r.right() + dx, r.bottom() + dy }; + surface->Flip(surface, ®ion, DFBSurfaceFlipFlags(DSFLIP_BLIT)); +} + bool QDirectFbWindowSurface::scroll(const QRegion &area, int dx, int dy) { - return QWindowSurface::scroll(area, dx, dy); + if (!m_dfbSurface || area.isEmpty()) + return false; + m_dfbSurface->SetBlittingFlags(m_dfbSurface, DSBLIT_NOFX); + if (area.rectCount() == 1) { + scrollSurface(m_dfbSurface, area.boundingRect(), dx, dy); + } else { + const QVector<QRect> rects = area.rects(); + const int n = rects.size(); + for (int i=0; i<n; ++i) { + scrollSurface(m_dfbSurface, rects.at(i), dx, dy); + } + } + return true; } void QDirectFbWindowSurface::beginPaint(const QRegion ®ion) |