summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qpixmap_mac.cpp
diff options
context:
space:
mode:
authorRohan McGovern <rohan.mcgovern@nokia.com>2011-09-14 07:45:44 (GMT)
committerRohan McGovern <rohan.mcgovern@nokia.com>2011-09-14 07:45:44 (GMT)
commit1b30b3a6726adf806ae221357393e562285e8346 (patch)
treec650ff836d3abdf5890726354ee6e2b9bce11304 /src/gui/image/qpixmap_mac.cpp
parent1c1a5fe0e2d9e28be5e0e14732d79d34c9bb2a74 (diff)
parent704dd92581783d91ccd234d58896d7078eed14a5 (diff)
downloadQt-1b30b3a6726adf806ae221357393e562285e8346.zip
Qt-1b30b3a6726adf806ae221357393e562285e8346.tar.gz
Qt-1b30b3a6726adf806ae221357393e562285e8346.tar.bz2
Merge remote branch 'origin/4.8' into 4.8-from-4.7
Conflicts: src/gui/text/qtextengine_p.h src/network/ssl/qsslsocket_openssl.cpp
Diffstat (limited to 'src/gui/image/qpixmap_mac.cpp')
-rw-r--r--src/gui/image/qpixmap_mac.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/gui/image/qpixmap_mac.cpp b/src/gui/image/qpixmap_mac.cpp
index 3afc724..47b6eef 100644
--- a/src/gui/image/qpixmap_mac.cpp
+++ b/src/gui/image/qpixmap_mac.cpp
@@ -54,6 +54,7 @@
#include <private/qpaintengine_mac_p.h>
#include <private/qt_mac_p.h>
#include <private/qt_cocoa_helpers_mac_p.h>
+#include <private/qapplication_p.h>
#include <limits.h>
#include <string.h>
@@ -73,12 +74,18 @@ static int qt_pixmap_serial = 0;
Q_GUI_EXPORT quint32 *qt_mac_pixmap_get_base(const QPixmap *pix)
{
- return static_cast<QMacPixmapData*>(pix->data.data())->pixels;
+ if (QApplicationPrivate::graphics_system_name == QLatin1String("raster"))
+ return reinterpret_cast<quint32 *>(static_cast<QRasterPixmapData*>(pix->data.data())->buffer()->bits());
+ else
+ return static_cast<QMacPixmapData*>(pix->data.data())->pixels;
}
Q_GUI_EXPORT int qt_mac_pixmap_get_bytes_per_line(const QPixmap *pix)
{
- return static_cast<QMacPixmapData*>(pix->data.data())->bytesPerRow;
+ if (QApplicationPrivate::graphics_system_name == QLatin1String("raster"))
+ return static_cast<QRasterPixmapData*>(pix->data.data())->buffer()->bytesPerLine();
+ else
+ return static_cast<QMacPixmapData*>(pix->data.data())->bytesPerRow;
}
void qt_mac_cgimage_data_free(void *info, const void *memoryToFree, size_t)
@@ -413,7 +420,11 @@ void QMacPixmapData::fill(const QColor &fillColor)
*(dptr + i) = colr;
}
}
- macSetHasAlpha(fillColor.alpha() != 255);
+
+ // If we had an alpha channel from before, don't
+ // switch it off. Only go from no alpha to alpha:
+ if (fillColor.alpha() != 255)
+ macSetHasAlpha(true);
}
QPixmap QMacPixmapData::alphaChannel() const