detach();
- if (!data->scroll(dx, dy, src)) {
- // Fallback
- QPixmap pix = *this;
- QPainter painter(&pix);
- painter.setCompositionMode(QPainter::CompositionMode_Source);
- painter.drawPixmap(src.translated(dx, dy), *this, src);
- painter.end();
- *this = pix;
- }
+ data->scroll(dx, dy, src);
if (exposed) {
*exposed += dest;
fromImage(image, flags);
}
-// 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), Qt::NoOpaqueDetection);
}
-bool QRasterPixmapData::scroll(int dx, int dy, const QRect &rect)
+// from qwindowsurface.cpp
+extern void qt_scrollRectInImage(QImage *img, const QRect &rect, const QPoint &offset);
+
+void QRasterPixmapData::scroll(int dx, int dy, const QRect &rect)
{
if (!image.isNull())
qt_scrollRectInImage(&image, rect, QPoint(dx, dy));
- return true;
}
void QRasterPixmapData::fill(const QColor &color)
void fromImageReader(QImageReader *imageReader, Qt::ImageConversionFlags flags);
void copy(const QPixmapData *data, const QRect &rect);
- bool scroll(int dx, int dy, const QRect &rect);
+ void scroll(int dx, int dy, const QRect &rect);
void fill(const QColor &color);
void setMask(const QBitmap &mask);
bool hasAlphaChannel() const;
}
}
-bool QX11PixmapData::scroll(int dx, int dy, const QRect &rect)
+void QX11PixmapData::scroll(int dx, int dy, const QRect &rect)
{
GC gc = XCreateGC(qt_x11Data->display, hd, 0, 0);
XCopyArea(qt_x11Data->display, hd, hd, gc,
rect.left(), rect.top(), rect.width(), rect.height(),
rect.left() + dx, rect.top() + dy);
XFreeGC(qt_x11Data->display, gc);
- return true;
}
#if !defined(QT_NO_XRENDER)
void resize(int width, int height);
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 scroll(int dx, int dy, const QRect &rect);
void fill(const QColor &color);
QBitmap mask() const;
Qt::ImageConversionFlags flags);
virtual void copy(const QPixmapData *data, const QRect &rect) = 0;
- virtual bool scroll(int dx, int dy, const QRect &rect) = 0;
+ virtual void scroll(int dx, int dy, const QRect &rect) = 0;
virtual int metric(QPaintDevice::PaintDeviceMetric metric) const = 0;
virtual void fill(const QColor &color) = 0;