diff options
author | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2016-04-08 17:27:14 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2016-05-09 15:56:20 +0000 |
commit | 844ea8beea8d8edb68fea18017cdc57592b2808c (patch) | |
tree | 9022f103b0231239bcd07c73e88fb273d9407b80 /src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp | |
parent | 1e971f855546f1b94c7cdf7a31ad64ebe6c3e23d (diff) |
linuxfb: Support transparency
Always clearing to opaque black makes it impossible to create semi-transparent overlays with linuxfb. Instead, behave like other platforms' backingstores: if the target image has an alpha channel, clear to transparent instead and set the correct composition mode. Task-number: QTBUG-52475 Change-Id: I2db4588e0112e200a3aa5eed49f806c37d7ca8b5 Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io>
Diffstat (limited to 'src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp')
-rw-r--r-- | src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp b/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp index 8c3e73fd808..13e06ef104e 100644 --- a/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp +++ b/src/plugins/platforms/linuxfb/qlinuxfbscreen.cpp @@ -405,9 +405,12 @@ QRegion QLinuxFbScreen::doRedraw() if (!mBlitter) mBlitter = new QPainter(&mFbScreenImage); - QVector<QRect> rects = touched.rects(); - for (int i = 0; i < rects.size(); i++) + const QVector<QRect> rects = touched.rects(); + mBlitter->setCompositionMode(QPainter::CompositionMode_Source); + + for (int i = 0; i < rects.size(); ++i) mBlitter->drawImage(rects[i], *mScreenImage, rects[i]); + return touched; } |