blob: d45907f8b69c576af444004c83c32ae6b2e712dc (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
#include <private/qgraphicssystem_p.h>
#include <private/qblittable_p.h>
#include <private/qpixmap_blitter_p.h>
#include <private/qpixmap_raster_p.h>
#include <private/qwindowsurface_rasterblittable_p.h>
#include "qblittable_image.h"
class QImageBlittableWindowSurface : public QRasterBlittableWindowSurface
{
public:
QImageBlittableWindowSurface(QWidget *widget)
: QRasterBlittableWindowSurface(widget)
{}
QBlittable *createBlittable(QImage *rasterSurface)
{
return new QImageBlittable(rasterSurface,false);
}
};
class QBlittableGraphicsSystem : public QGraphicsSystem
{
public:
~QBlittableGraphicsSystem() { }
QPixmapData *createPixmapData(QPixmapData::PixelType type) const
{
if (type == QPixmapData::PixmapType)
return new QBlittablePixmapData(type);
else
return new QRasterPixmapData(type);
}
QWindowSurface *createWindowSurface(QWidget *widget) const
{
return new QImageBlittableWindowSurface(widget);
}
QBlittable *createBlittable(const QSize &size) const
{
QImage *image = new QImage(size, QImage::Format_ARGB32_Premultiplied);
return new QImageBlittable(image,true);
}
QList<QGraphicsSystemScreen *> screens()
{ return m_screens; }
QList<QGraphicsSystemScreen *> m_screens;
};
|