diff options
Diffstat (limited to 'src/gui/embedded/qscreen_qws.cpp')
-rw-r--r-- | src/gui/embedded/qscreen_qws.cpp | 37 |
1 files changed, 30 insertions, 7 deletions
diff --git a/src/gui/embedded/qscreen_qws.cpp b/src/gui/embedded/qscreen_qws.cpp index cfce78c..fafa35d 100644 --- a/src/gui/embedded/qscreen_qws.cpp +++ b/src/gui/embedded/qscreen_qws.cpp @@ -49,6 +49,7 @@ #include "qpixmap.h" #include "qvarlengtharray.h" #include "qwsdisplay_qws.h" +#include "qpainter.h" #include <private/qdrawhelper_p.h> #include <private/qpaintengine_raster_p.h> #include <private/qpixmap_raster_p.h> @@ -180,7 +181,27 @@ void QScreenCursor::set(const QImage &image, int hotx, int hoty) const QRect r = boundingRect(); hotspot = QPoint(hotx, hoty); - cursor = image; + // These are in almost all cases the fastest formats to blend + QImage::Format f; + switch (qt_screen->depth()) { + case 12: + f = QImage::Format_ARGB4444_Premultiplied; + break; + case 15: + f = QImage::Format_ARGB8555_Premultiplied; + break; + case 16: + f = QImage::Format_ARGB8565_Premultiplied; + break; + case 18: + f = QImage::Format_ARGB6666_Premultiplied; + break; + default: + f = QImage::Format_ARGB32_Premultiplied; + } + + cursor = image.convertToFormat(f); + size = image.size(); if (enable && !hwaccel) @@ -198,10 +219,12 @@ void QScreenCursor::set(const QImage &image, int hotx, int hoty) */ void QScreenCursor::move(int x, int y) { - const QRegion r = boundingRect(); + QRegion r = boundingRect(); pos = QPoint(x,y); - if (enable && !hwaccel) - qt_screen->exposeRegion(r | boundingRect(), 0); + if (enable && !hwaccel) { + r |= boundingRect(); + qt_screen->exposeRegion(r, 0); + } } @@ -2417,7 +2440,7 @@ void QScreen::exposeRegion(QRegion r, int windowIndex) #endif compose(0, r, blendRegion, &blendBuffer, changing); - if (blendBuffer) { + if (blendBuffer && !blendBuffer->isNull()) { const QPoint offset = blendRegion.boundingRect().topLeft(); #ifndef QT_NO_QWS_CURSOR if (qt_screencursor && !qt_screencursor->isAccelerated()) { @@ -2708,7 +2731,7 @@ void QScreen::compose(int level, const QRegion &exposed, QRegion &blend, default: break; } - spanData.setup(qwsServer->backgroundBrush(), 256); + spanData.setup(qwsServer->backgroundBrush(), 256, QPainter::CompositionMode_SourceOver); spanData.dx = off.x(); spanData.dy = off.y(); } else if (!surface->isBuffered()) { @@ -2773,7 +2796,7 @@ void QScreen::paintBackground(const QRegion &r) rb.prepare(&img); QSpanData spanData; spanData.init(&rb, 0); - spanData.setup(bg, 256); + spanData.setup(bg, 256, QPainter::CompositionMode_Source); spanData.dx = off.x(); spanData.dy = off.y(); Q_ASSERT(spanData.blend); |