diff options
author | David Boddie <dboddie@trolltech.com> | 2009-11-19 13:53:04 (GMT) |
---|---|---|
committer | David Boddie <dboddie@trolltech.com> | 2009-11-19 13:53:04 (GMT) |
commit | 4e53466f63bf05e90a69f80fda8580dabc1e9ed0 (patch) | |
tree | 0978f427af78291d8dd16004cc4ca33dbe1af433 /src/gui/image | |
parent | 5bd71902f97ba75dc93ccf709dbfdd2ffeb361b2 (diff) | |
parent | fbbdf8698fb0444d5170b7d0a14e870ea789398f (diff) | |
download | Qt-4e53466f63bf05e90a69f80fda8580dabc1e9ed0.zip Qt-4e53466f63bf05e90a69f80fda8580dabc1e9ed0.tar.gz Qt-4e53466f63bf05e90a69f80fda8580dabc1e9ed0.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/oslo-staging-1 into 4.6
Diffstat (limited to 'src/gui/image')
-rw-r--r-- | src/gui/image/qpixmap_mac.cpp | 7 | ||||
-rw-r--r-- | src/gui/image/qpixmap_mac_p.h | 1 | ||||
-rw-r--r-- | src/gui/image/qpixmap_x11.cpp | 5 |
3 files changed, 10 insertions, 3 deletions
diff --git a/src/gui/image/qpixmap_mac.cpp b/src/gui/image/qpixmap_mac.cpp index 6175931..365c271 100644 --- a/src/gui/image/qpixmap_mac.cpp +++ b/src/gui/image/qpixmap_mac.cpp @@ -160,8 +160,8 @@ QSet<QMacPixmapData*> QMacPixmapData::validDataPointers; QMacPixmapData::QMacPixmapData(PixelType type) : QPixmapData(type, MacClass), has_alpha(0), has_mask(0), - uninit(true), pixels(0), pixelsToFree(0), bytesPerRow(0), - cg_data(0), cg_dataBeingReleased(0), cg_mask(0), + uninit(true), pixels(0), pixelsSize(0), pixelsToFree(0), + bytesPerRow(0), cg_data(0), cg_dataBeingReleased(0), cg_mask(0), pengine(0) { } @@ -637,8 +637,9 @@ void QMacPixmapData::macCreatePixels() } if (pixels) - memcpy(base_pixels, pixels, numBytes); + memcpy(base_pixels, pixels, pixelsSize); pixels = base_pixels; + pixelsSize = numBytes; } #if 0 diff --git a/src/gui/image/qpixmap_mac_p.h b/src/gui/image/qpixmap_mac_p.h index a3fb95f..45ab8e2 100644 --- a/src/gui/image/qpixmap_mac_p.h +++ b/src/gui/image/qpixmap_mac_p.h @@ -107,6 +107,7 @@ private: pixelsToFree later on instead of malloc'ing memory. */ quint32 *pixels; + uint pixelsSize; quint32 *pixelsToFree; uint bytesPerRow; QRectF cg_mask_rect; diff --git a/src/gui/image/qpixmap_x11.cpp b/src/gui/image/qpixmap_x11.cpp index 3f297df..7008fbd 100644 --- a/src/gui/image/qpixmap_x11.cpp +++ b/src/gui/image/qpixmap_x11.cpp @@ -416,6 +416,11 @@ void QX11PixmapData::fromImage(const QImage &img, d = img.depth(); is_null = (w <= 0 || h <= 0); + if (is_null) { + w = h = 0; + return; + } + if (defaultScreen >= 0 && defaultScreen != xinfo.screen()) { QX11InfoData* xd = xinfo.getX11Data(true); xd->screen = defaultScreen; |