summaryrefslogtreecommitdiffstats
path: root/src/gui/image/qpixmap_x11_p.h
diff options
context:
space:
mode:
authorSamuel Rødal <samuel.rodal@nokia.com>2010-06-22 13:24:26 +0200
committerSamuel Rødal <samuel.rodal@nokia.com>2010-06-23 10:45:11 +0200
commitfb76a872e20bd0df8e7bbe9c039b7f20423c6f12 (patch)
treec01d5f47cad65a056eb6edc1cab11c628b11e2f8 /src/gui/image/qpixmap_x11_p.h
parenteaf886318568bfbd9aa1722586264c8fdf90df12 (diff)
Optimized sub-rect copying / painting of QPixmaps.
Prevented downloading of the whole XImage by introducing new QPixmapData::toImage() overload taking a sub-rect. Also avoid an additional copy by simply taking ownership of the XImage data when the XImage format matches the QImage format. Reviewed-by: Trond
Diffstat (limited to 'src/gui/image/qpixmap_x11_p.h')
-rw-r--r--src/gui/image/qpixmap_x11_p.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/image/qpixmap_x11_p.h b/src/gui/image/qpixmap_x11_p.h
index 7575838163..821fb691ea 100644
--- a/src/gui/image/qpixmap_x11_p.h
+++ b/src/gui/image/qpixmap_x11_p.h
@@ -62,6 +62,8 @@ QT_BEGIN_NAMESPACE
class QX11PaintEngine;
+struct QXImageWrapper;
+
class Q_GUI_EXPORT QX11PixmapData : public QPixmapData
{
public:
@@ -87,6 +89,7 @@ public:
QPixmap transformed(const QTransform &transform,
Qt::TransformationMode mode) const;
QImage toImage() const;
+ QImage toImage(const QRect &rect) const;
QPaintEngine* paintEngine() const;
Qt::HANDLE handle() const { return hd; }
@@ -116,10 +119,15 @@ private:
void release();
+ QImage toImage(const QXImageWrapper &xi, const QRect &rect) const;
+
QBitmap mask_to_bitmap(int screen) const;
static Qt::HANDLE bitmap_to_mask(const QBitmap &, int screen);
void bitmapFromImage(const QImage &image);
+ bool canTakeQImageFromXImage(const QXImageWrapper &xi) const;
+ QImage takeQImageFromXImage(const QXImageWrapper &xi) const;
+
Qt::HANDLE hd;
enum Flag {