summaryrefslogtreecommitdiffstats
path: root/src/gui/image
diff options
context:
space:
mode:
authorWater-Team <water@pad.test.qt.nokia.com>2011-10-17 23:00:33 (GMT)
committerWater-Team <water@pad.test.qt.nokia.com>2011-10-17 23:00:33 (GMT)
commit923693d4919f22eabd5cec8fb6e855514bb64fb7 (patch)
treece5c6ec3f89b9bef3684c748bc4bc39af0d53a9a /src/gui/image
parentec9a31abf003880a60d1120738a3bee7075b8ca8 (diff)
parent09e7218a1c30ca33a5d82280f89f07ba54b96555 (diff)
downloadQt-923693d4919f22eabd5cec8fb6e855514bb64fb7.zip
Qt-923693d4919f22eabd5cec8fb6e855514bb64fb7.tar.gz
Qt-923693d4919f22eabd5cec8fb6e855514bb64fb7.tar.bz2
Merge branch '4.8-upstream' into master-water
Diffstat (limited to 'src/gui/image')
-rw-r--r--src/gui/image/qimage.cpp12
-rw-r--r--src/gui/image/qvolatileimage.cpp14
2 files changed, 14 insertions, 12 deletions
diff --git a/src/gui/image/qimage.cpp b/src/gui/image/qimage.cpp
index a3378de..f527bcf 100644
--- a/src/gui/image/qimage.cpp
+++ b/src/gui/image/qimage.cpp
@@ -5908,12 +5908,12 @@ bool qt_xForm_helper(const QTransform &trueMat, int xoffset, int type, int depth
uchar *dptr, int dbpl, int p_inc, int dHeight,
const uchar *sptr, int sbpl, int sWidth, int sHeight)
{
- int m11 = int(trueMat.m11()*4096.0);
- int m12 = int(trueMat.m12()*4096.0);
- int m21 = int(trueMat.m21()*4096.0);
- int m22 = int(trueMat.m22()*4096.0);
- int dx = qRound(trueMat.dx()*4096.0);
- int dy = qRound(trueMat.dy()*4096.0);
+ int m11 = int(trueMat.m11()*qreal(4096.0));
+ int m12 = int(trueMat.m12()*qreal(4096.0));
+ int m21 = int(trueMat.m21()*qreal(4096.0));
+ int m22 = int(trueMat.m22()*qreal(4096.0));
+ int dx = qRound(trueMat.dx()*qreal(4096.0));
+ int dy = qRound(trueMat.dy()*qreal(4096.0));
int m21ydx = dx + (xoffset<<16) + (m11 + m21) / 2;
int m22ydy = dy + (m12 + m22) / 2;
diff --git a/src/gui/image/qvolatileimage.cpp b/src/gui/image/qvolatileimage.cpp
index 9734c82..350d70f 100644
--- a/src/gui/image/qvolatileimage.cpp
+++ b/src/gui/image/qvolatileimage.cpp
@@ -248,12 +248,14 @@ void QVolatileImage::copyFrom(QVolatileImage *source, const QRect &rect)
const uchar *sptr = srcImgRef.constBits() + r.y() * srcbpl;
beginDataAccess();
QImage &dstImgRef(imageRef());
- int dstbpl = dstImgRef.bytesPerLine();
- uchar *dptr = dstImgRef.bits();
- for (int y = 0; y < r.height(); ++y) {
- qMemCopy(dptr, sptr + r.x() * srcbpp, r.width() * srcbpp);
- sptr += srcbpl;
- dptr += dstbpl;
+ if (!dstImgRef.isNull()) {
+ int dstbpl = dstImgRef.bytesPerLine();
+ uchar *dptr = dstImgRef.bits();
+ for (int y = 0; y < r.height(); ++y) {
+ qMemCopy(dptr, sptr + r.x() * srcbpp, r.width() * srcbpp);
+ sptr += srcbpl;
+ dptr += dstbpl;
+ }
}
endDataAccess();
source->endDataAccess(true);