Группа :: Система/Библиотеки
Пакет: qt4
Главная Изменения Спек Патчи Загрузить Bugs and FR
Патч: 0144-qpixmap-setmask.diff
qt-bugs@ issue :
Trolltech task ID :
bugs.kde.org number : None
applied: no
author: Clarence Dang <dang@kde.org>
Subject: QPixmap::setMask(QBitmap()) does not detach
From: Clarence Dang <dang@kde.org>
To: qt-bugs@trolltech.com
Date: 2006-09-05 12:40:27 +0000
Test case:
~~~
{
QPixmap greenPixmap (100, 100);
greenPixmap.fill (Qt::green);
QBitmap greenPixmapTempMask (100, 100);
greenPixmapTempMask.fill (Qt::color0/*transparent*/);
greenPixmap.setMask (greenPixmapTempMask);
QPixmap transPixmap = greenPixmap;
// BUG: This mutates transPixmap
greenPixmap.setMask (QBitmap ());
greenPixmap.save ("green.png", "PNG");
transPixmap.save ("trans.png", "PNG");
}
~~~
Index: src/gui/image/qpixmap_x11.cpp
===================================================================
--- src/gui/image/qpixmap_x11.cpp (revision 563328)
+++ src/gui/image/qpixmap_x11.cpp (working copy)
@@ -561,6 +561,7 @@ void QPixmap::setMask(const QBitmap &new
} else
#endif
if (data->x11_mask) {
+ detach ();
#ifndef QT_NO_XRENDER
if (data->picture) {
XRenderPictureAttributes attrs;