2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Use QImage instead of QPixmap for theme preview.

Working with QPixmap from non-main thread is not defined.
This commit is contained in:
John Preston
2018-01-02 22:10:49 +03:00
parent e89350d4b7
commit 0ef3e19bc2
6 changed files with 113 additions and 77 deletions

View File

@@ -59,6 +59,13 @@ const QPixmap &circleMask(int width, int height) {
} // namespace
QPixmap PixmapFast(QImage &&image) {
Expects(image.format() == QImage::Format_ARGB32_Premultiplied
|| image.format() == QImage::Format_RGB32);
return QPixmap::fromImage(std::move(image), Qt::NoFormatConversion);
}
QImage prepareBlur(QImage img) {
auto ratio = img.devicePixelRatio();
auto fmt = img.format();