/src/qtbase/src/gui/painting/qpaintengineex_p.h
Line | Count | Source |
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 | | // Qt-Security score:significant reason:default |
4 | | |
5 | | #ifndef QPAINTENGINEEX_P_H |
6 | | #define QPAINTENGINEEX_P_H |
7 | | |
8 | | // |
9 | | // W A R N I N G |
10 | | // ------------- |
11 | | // |
12 | | // This file is not part of the Qt API. It exists purely as an |
13 | | // implementation detail. This header file may change from version to |
14 | | // version without notice, or even be removed. |
15 | | // |
16 | | // We mean it. |
17 | | // |
18 | | |
19 | | #include <QtGui/private/qtguiglobal_p.h> |
20 | | #include <QtGui/qpaintengine.h> |
21 | | |
22 | | #include <private/qpaintengine_p.h> |
23 | | #include <private/qstroker_p.h> |
24 | | #include <private/qpainter_p.h> |
25 | | #include <private/qvectorpath_p.h> |
26 | | |
27 | | |
28 | | QT_BEGIN_NAMESPACE |
29 | | |
30 | | |
31 | | class QPainterState; |
32 | | class QPaintEngineExPrivate; |
33 | | class QStaticTextItem; |
34 | | struct StrokeHandler; |
35 | | |
36 | | #ifndef QT_NO_DEBUG_STREAM |
37 | | QDebug Q_GUI_EXPORT &operator<<(QDebug &, const QVectorPath &path); |
38 | | #endif |
39 | | |
40 | | class Q_GUI_EXPORT QPaintEngineEx : public QPaintEngine |
41 | | { |
42 | 0 | Q_DECLARE_PRIVATE(QPaintEngineEx) Unexecuted instantiation: QPaintEngineEx::d_func() Unexecuted instantiation: QPaintEngineEx::d_func() const |
43 | 0 | public: |
44 | 0 | QPaintEngineEx(); |
45 | 0 |
|
46 | 0 | virtual QPainterState *createState(QPainterState *orig) const; |
47 | 0 |
|
48 | 0 | virtual void draw(const QVectorPath &path); |
49 | 0 | virtual void fill(const QVectorPath &path, const QBrush &brush) = 0; |
50 | 0 | virtual void stroke(const QVectorPath &path, const QPen &pen); |
51 | 0 |
|
52 | 0 | virtual void clip(const QVectorPath &path, Qt::ClipOperation op) = 0; |
53 | 0 | virtual void clip(const QRect &rect, Qt::ClipOperation op); |
54 | 0 | virtual void clip(const QRegion ®ion, Qt::ClipOperation op); |
55 | 0 | virtual void clip(const QPainterPath &path, Qt::ClipOperation op); |
56 | 0 |
|
57 | 0 | virtual void clipEnabledChanged() = 0; |
58 | 0 | virtual void penChanged() = 0; |
59 | 0 | virtual void brushChanged() = 0; |
60 | 0 | virtual void brushOriginChanged() = 0; |
61 | 0 | virtual void opacityChanged() = 0; |
62 | 0 | virtual void compositionModeChanged() = 0; |
63 | 0 | virtual void renderHintsChanged() = 0; |
64 | 0 | virtual void transformChanged() = 0; |
65 | 0 |
|
66 | 0 | virtual void fillRect(const QRectF &rect, const QBrush &brush); |
67 | 0 | virtual void fillRect(const QRectF &rect, const QColor &color); |
68 | 0 |
|
69 | 0 | virtual void drawRoundedRect(const QRectF &rect, qreal xrad, qreal yrad, Qt::SizeMode mode); |
70 | 0 |
|
71 | 0 | virtual void drawRects(const QRect *rects, int rectCount) override; |
72 | 0 | virtual void drawRects(const QRectF *rects, int rectCount) override; |
73 | 0 |
|
74 | 0 | virtual void drawLines(const QLine *lines, int lineCount) override; |
75 | 0 | virtual void drawLines(const QLineF *lines, int lineCount) override; |
76 | 0 |
|
77 | 0 | virtual void drawEllipse(const QRectF &r) override; |
78 | 0 | virtual void drawEllipse(const QRect &r) override; |
79 | 0 |
|
80 | 0 | virtual void drawPath(const QPainterPath &path) override; |
81 | 0 |
|
82 | 0 | virtual void drawPoints(const QPointF *points, int pointCount) override; |
83 | 0 | virtual void drawPoints(const QPoint *points, int pointCount) override; |
84 | 0 |
|
85 | 0 | virtual void drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) override; |
86 | 0 | virtual void drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) override; |
87 | 0 |
|
88 | 0 | virtual void drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) override = 0; |
89 | 0 | virtual void drawPixmap(const QPointF &pos, const QPixmap &pm); |
90 | 0 |
|
91 | 0 | virtual void drawImage(const QRectF &r, const QImage &pm, const QRectF &sr, |
92 | 0 | Qt::ImageConversionFlags flags = Qt::AutoColor) override = 0; |
93 | 0 | virtual void drawImage(const QPointF &pos, const QImage &image); |
94 | 0 |
|
95 | 0 | virtual void drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) override; |
96 | 0 |
|
97 | 0 | virtual void drawPixmapFragments(const QPainter::PixmapFragment *fragments, int fragmentCount, const QPixmap &pixmap, |
98 | 0 | QFlags<QPainter::PixmapFragmentHint> hints); |
99 | 0 |
|
100 | 0 | virtual void updateState(const QPaintEngineState &state) override; |
101 | 0 |
|
102 | 0 | virtual void drawStaticTextItem(QStaticTextItem *); |
103 | 0 |
|
104 | 0 | virtual void setState(QPainterState *s); |
105 | 214k | inline QPainterState *state() { return static_cast<QPainterState *>(QPaintEngine::state); } |
106 | 142k | inline const QPainterState *state() const { return static_cast<const QPainterState *>(QPaintEngine::state); } |
107 | | |
108 | 0 | virtual void sync() {} |
109 | | |
110 | 0 | virtual void beginNativePainting() {} |
111 | 0 | virtual void endNativePainting() {} |
112 | | |
113 | | // These flags are needed in the implementation of paint buffers. |
114 | | enum Flags |
115 | | { |
116 | | DoNotEmulate = 0x01, // If set, QPainter will not wrap this engine in an emulation engine. |
117 | | IsEmulationEngine = 0x02 // If set, this object is a QEmulationEngine. |
118 | | }; |
119 | 0 | virtual uint flags() const {return 0;} |
120 | | virtual bool requiresPretransformedGlyphPositions(QFontEngine *fontEngine, const QTransform &m) const; |
121 | | virtual bool shouldDrawCachedGlyphs(QFontEngine *fontEngine, const QTransform &m) const; |
122 | | |
123 | | protected: |
124 | | QPaintEngineEx(QPaintEngineExPrivate &data); |
125 | | }; |
126 | | |
127 | | class Q_GUI_EXPORT QPaintEngineExPrivate : public QPaintEnginePrivate |
128 | | { |
129 | | Q_DECLARE_PUBLIC(QPaintEngineEx) Unexecuted instantiation: QPaintEngineExPrivate::q_func() Unexecuted instantiation: QPaintEngineExPrivate::q_func() const |
130 | | public: |
131 | | QPaintEngineExPrivate(); |
132 | | ~QPaintEngineExPrivate(); |
133 | | |
134 | | void replayClipOperations(); |
135 | | bool hasClipOperations() const; |
136 | | |
137 | | QStroker stroker; |
138 | | QDashStroker dasher; |
139 | | StrokeHandler *strokeHandler; |
140 | | QStrokerOps *activeStroker; |
141 | | QPen strokerPen; |
142 | | |
143 | | QRect exDeviceRect; |
144 | | }; |
145 | | |
146 | | QT_END_NAMESPACE |
147 | | |
148 | | #endif |