Mac: pixmaps dont treat alpha exactly the same as other platforms
authorRichard Moe Gustavsen <richard.gustavsen@nokia.com>
Wed, 12 Jan 2011 09:47:29 +0000 (10:47 +0100)
committerRichard Moe Gustavsen <richard.gustavsen@nokia.com>
Wed, 12 Jan 2011 10:20:06 +0000 (11:20 +0100)
commita53e579a388c6bca6374b56328622bc8c1e0f138
tree5ac6aa633dff674e098eb3c22f2d1fb03a2e2cf1
parent6e16cc33983c9ed2c8362f0d31ef712df7949375
Mac: pixmaps dont treat alpha exactly the same as other platforms

From fixing qwidget autotest, it seems to be the case that filling
a pixmap with a solid color on mac changes the hasAlpha status. This
is different from X11 (and raster engine). That is, the following
code will produce different result:

QPixmap pixmap(100, 100);
pixmap.setAlphaChannel(QPixmap(100, 100));
qDebug() << "Has alpha after setting channel?" << pixmap.hasAlpha();
pixmap.fill(Qt::red);
qDebug() << "Has alpha after fill?" << pixmap.hasAlpha();

So, this patch remove the possibility of converting an already alpha
supporting pixmap to non-alpha upon fill. NB: somewhat related, the
following code works the same on both x11, raster and mac (prints
'false'), but still seems wrong:

QPixmap pixmap2(pixmap);
qDebug() << "pixmap2 has alpha initially?" << pixmap2.hasAlpha();

Rev-By: Fabien Freling
src/gui/image/qpixmap_mac.cpp