summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2010-06-23 11:55:20 (GMT)
committerSamuel Rødal <samuel.rodal@nokia.com>2010-06-23 12:05:13 (GMT)
commit5817f04060f5a545a71a1f9e9dfa167f92a4ab93 (patch)
tree125b55e5593e699ee73daa8934f80c75f64db73f /src
parent0c0eac000ecbe8c0bdcb8c6d914854b1a09a720b (diff)
downloadQt-5817f04060f5a545a71a1f9e9dfa167f92a4ab93.zip
Qt-5817f04060f5a545a71a1f9e9dfa167f92a4ab93.tar.gz
Qt-5817f04060f5a545a71a1f9e9dfa167f92a4ab93.tar.bz2
Fixed missing copy of raster pixmap data after change fb76a872e20bd.
It's expected that copy actually does a deep copy of the image data. Because QRasterPixmapData::fromImage() will just use the source image as is in this case we need to do a deep copy of the QImage. Reviewed-by: Trond
Diffstat (limited to 'src')
-rw-r--r--src/gui/image/qpixmap_raster.cpp5
-rw-r--r--src/gui/image/qpixmap_raster_p.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/src/gui/image/qpixmap_raster.cpp b/src/gui/image/qpixmap_raster.cpp
index 13e95c7..e188745 100644
--- a/src/gui/image/qpixmap_raster.cpp
+++ b/src/gui/image/qpixmap_raster.cpp
@@ -155,6 +155,11 @@ void QRasterPixmapData::fromImage(const QImage &sourceImage,
// from qwindowsurface.cpp
extern void qt_scrollRectInImage(QImage &img, const QRect &rect, const QPoint &offset);
+void QRasterPixmapData::copy(const QPixmapData *data, const QRect &rect)
+{
+ fromImage(data->toImage(rect).copy(), Qt::NoOpaqueDetection);
+}
+
bool QRasterPixmapData::scroll(int dx, int dy, const QRect &rect)
{
if (!image.isNull())
diff --git a/src/gui/image/qpixmap_raster_p.h b/src/gui/image/qpixmap_raster_p.h
index 42ceeca..a46e054 100644
--- a/src/gui/image/qpixmap_raster_p.h
+++ b/src/gui/image/qpixmap_raster_p.h
@@ -75,6 +75,7 @@ public:
bool fromData(const uchar *buffer, uint len, const char *format, Qt::ImageConversionFlags flags);
void fromImage(const QImage &image, Qt::ImageConversionFlags flags);
+ void copy(const QPixmapData *data, const QRect &rect);
bool scroll(int dx, int dy, const QRect &rect);
void fill(const QColor &color);
void setMask(const QBitmap &mask);