diff options
Diffstat (limited to 'src/gui/embedded/qscreen_qws.cpp')
-rw-r--r-- | src/gui/embedded/qscreen_qws.cpp | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/src/gui/embedded/qscreen_qws.cpp b/src/gui/embedded/qscreen_qws.cpp index 25550b0..7f3af17 100644 --- a/src/gui/embedded/qscreen_qws.cpp +++ b/src/gui/embedded/qscreen_qws.cpp @@ -181,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) |