diff options
Diffstat (limited to 'src/gui/painting/qwindowsurface_rasterblittable.cpp')
-rw-r--r-- | src/gui/painting/qwindowsurface_rasterblittable.cpp | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/gui/painting/qwindowsurface_rasterblittable.cpp b/src/gui/painting/qwindowsurface_rasterblittable.cpp new file mode 100644 index 0000000..56a79ba --- /dev/null +++ b/src/gui/painting/qwindowsurface_rasterblittable.cpp @@ -0,0 +1,26 @@ +#include "qwindowsurface_rasterblittable_p.h" + +#include <private/qpaintengine_blitter_p.h> +#include <private/qpixmap_blitter_p.h> + +QRasterBlittableWindowSurface::QRasterBlittableWindowSurface(QWidget *widget) + : QRasterWindowSurface(widget), + m_currentImage(0), + m_blittable(0), + m_pmData(new QBlittablePixmapData(QPixmapData::PixmapType)), + m_pixmap(new QPixmap(m_pmData)) +{ +} + +QPaintDevice *QRasterBlittableWindowSurface::paintDevice() +{ + QPaintDevice *device = QRasterWindowSurface::paintDevice(); + if (m_currentImage != device) { + if (device->devType() == QInternal::Image) { + m_currentImage = static_cast<QImage *>(device); + m_blittable = createBlittable(m_currentImage); + m_pmData->setBlittable(m_blittable); + } + } + return m_pixmap; +} |