1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QPAINTENGINE_PIC_P_H
5#define QPAINTENGINE_PIC_P_H
6
7//
8// W A R N I N G
9// -------------
10//
11// This file is not part of the Qt API. It exists purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <QtGui/private/qtguiglobal_p.h>
19#include <QtGui/qpaintengine.h>
20
21#ifndef QT_NO_PICTURE
22
23QT_BEGIN_NAMESPACE
24
25class QPicturePaintEnginePrivate;
26class QBuffer;
27
28class QPicturePaintEngine : public QPaintEngine
29{
30 Q_DECLARE_PRIVATE(QPicturePaintEngine)
31public:
32 QPicturePaintEngine();
33 ~QPicturePaintEngine();
34
35 bool begin(QPaintDevice *pdev) override;
36 bool end() override;
37
38 void updateState(const QPaintEngineState &state) override;
39
40 void updatePen(const QPen &pen);
41 void updateBrush(const QBrush &brush);
42 void updateBrushOrigin(const QPointF &origin);
43 void updateFont(const QFont &font);
44 void updateBackground(Qt::BGMode bgmode, const QBrush &bgBrush);
45 void updateMatrix(const QTransform &matrix);
46 void updateClipRegion(const QRegion &region, Qt::ClipOperation op);
47 void updateClipPath(const QPainterPath &path, Qt::ClipOperation op);
48 void updateRenderHints(QPainter::RenderHints hints);
49 void updateCompositionMode(QPainter::CompositionMode cmode);
50 void updateClipEnabled(bool enabled);
51 void updateOpacity(qreal opacity);
52
53 void drawEllipse(const QRectF &rect) override;
54 void drawPath(const QPainterPath &path) override;
55 void drawPolygon(const QPointF *points, int numPoints, PolygonDrawMode mode) override;
56 using QPaintEngine::drawPolygon;
57
58 void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override;
59 void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) override;
60 void drawImage(const QRectF &r, const QImage &image, const QRectF &sr,
61 Qt::ImageConversionFlags flags = Qt::AutoColor) override;
62 void drawTextItem(const QPointF &p, const QTextItem &ti) override;
63
64 Type type() const override { return Picture; }
65
66protected:
67 QPicturePaintEngine(QPaintEnginePrivate &dptr);
68
69private:
70 Q_DISABLE_COPY_MOVE(QPicturePaintEngine)
71
72 void writeCmdLength(int pos, const QRectF &r, bool corr);
73};
74
75QT_END_NAMESPACE
76
77#endif // QT_NO_PICTURE
78
79#endif // QPAINTENGINE_PIC_P_H
80

source code of qtbase/src/gui/image/qpaintengine_pic_p.h