Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/context2d/qquickcontext2dcommandbuffer_p.h |
Switch to Source code | Preprocessed file |
Line | Source | Count |
---|---|---|
1 | - | |
2 | static_assert(bool(1 == 1), "Required feature " "quick_canvas" " for file " __FILE__ " not available."); | - |
3 | - | |
4 | - | |
5 | - | |
6 | - | |
7 | - | |
8 | class QQuickCanvasItem; | - |
9 | class QMutex; | - |
10 | - | |
11 | class QQuickContext2DCommandBuffer | - |
12 | { | - |
13 | public: | - |
14 | QQuickContext2DCommandBuffer(); | - |
15 | ~QQuickContext2DCommandBuffer(); | - |
16 | void reset(); | - |
17 | void clear(); | - |
18 | - | |
19 | inline int size() const { return never executed: commands.size();return commands.size(); never executed: }return commands.size(); | 0 |
20 | inline bool isEmpty() const {return never executed: commands.isEmpty();return commands.isEmpty(); never executed: }return commands.isEmpty(); | 0 |
21 | inline bool hasNext() const {return never executed: cmdIdx < commands.size();return cmdIdx < commands.size(); never executed: }return cmdIdx < commands.size(); | 0 |
22 | inline QQuickContext2D::PaintCommand takeNextCommand() { return never executed: commands.at(cmdIdx++);return commands.at(cmdIdx++); never executed: }return commands.at(cmdIdx++); | 0 |
23 | - | |
24 | inline qreal takeGlobalAlpha() { return never executed: takeReal();return takeReal(); never executed: }return takeReal(); | 0 |
25 | inline QPainter::CompositionMode takeGlobalCompositeOperation(){ return never executed: static_cast<QPainter::CompositionMode>(takeInt());return static_cast<QPainter::CompositionMode>(takeInt()); never executed: }return static_cast<QPainter::CompositionMode>(takeInt()); | 0 |
26 | inline QBrush takeStrokeStyle() { return never executed: takeBrush();return takeBrush(); never executed: }return takeBrush(); | 0 |
27 | inline QBrush takeFillStyle() { return never executed: takeBrush();return takeBrush(); never executed: }return takeBrush(); | 0 |
28 | - | |
29 | inline qreal takeLineWidth() { return never executed: takeReal();return takeReal(); never executed: }return takeReal(); | 0 |
30 | inline Qt::PenCapStyle takeLineCap() { return never executed: static_cast<Qt::PenCapStyle>(takeInt());return static_cast<Qt::PenCapStyle>(takeInt()); never executed: }return static_cast<Qt::PenCapStyle>(takeInt()); | 0 |
31 | inline Qt::PenJoinStyle takeLineJoin(){ return never executed: static_cast<Qt::PenJoinStyle>(takeInt());return static_cast<Qt::PenJoinStyle>(takeInt()); never executed: }return static_cast<Qt::PenJoinStyle>(takeInt()); | 0 |
32 | inline qreal takeMiterLimit() { return never executed: takeReal();return takeReal(); never executed: }return takeReal(); | 0 |
33 | - | |
34 | inline void setGlobalAlpha( qreal alpha) | - |
35 | { | - |
36 | commands << QQuickContext2D::GlobalAlpha; | - |
37 | reals << alpha; | - |
38 | } never executed: end of block | 0 |
39 | - | |
40 | inline void setGlobalCompositeOperation(QPainter::CompositionMode cm) | - |
41 | { | - |
42 | commands << QQuickContext2D::GlobalCompositeOperation; | - |
43 | ints << cm; | - |
44 | } never executed: end of block | 0 |
45 | - | |
46 | inline void setStrokeStyle(const QBrush &style, bool repeatX = false, bool repeatY = false) | - |
47 | { | - |
48 | commands << QQuickContext2D::StrokeStyle; | - |
49 | brushes << style; | - |
50 | bools << repeatX << repeatY; | - |
51 | } never executed: end of block | 0 |
52 | - | |
53 | inline void drawImage(const QImage& image, const QRectF& sr, const QRectF& dr) | - |
54 | { | - |
55 | commands << QQuickContext2D::DrawImage; | - |
56 | images << image; | - |
57 | rects << sr << dr; | - |
58 | } never executed: end of block | 0 |
59 | - | |
60 | inline void drawPixmap(QQmlRefPointer<QQuickCanvasPixmap> pixmap, const QRectF& sr, const QRectF& dr) | - |
61 | { | - |
62 | commands << QQuickContext2D::DrawPixmap; | - |
63 | pixmaps << pixmap; | - |
64 | rects << sr << dr; | - |
65 | } never executed: end of block | 0 |
66 | - | |
67 | inline qreal takeShadowOffsetX() { return never executed: takeReal();return takeReal(); never executed: }return takeReal(); | 0 |
68 | inline qreal takeShadowOffsetY() { return never executed: takeReal();return takeReal(); never executed: }return takeReal(); | 0 |
69 | inline qreal takeShadowBlur() { return never executed: takeReal();return takeReal(); never executed: }return takeReal(); | 0 |
70 | inline QColor takeShadowColor() { return never executed: takeColor();return takeColor(); never executed: }return takeColor(); | 0 |
71 | - | |
72 | - | |
73 | inline void updateMatrix(const QTransform& matrix) | - |
74 | { | - |
75 | commands << QQuickContext2D::UpdateMatrix; | - |
76 | matrixes << matrix; | - |
77 | } never executed: end of block | 0 |
78 | - | |
79 | inline void clearRect(const QRectF& r) | - |
80 | { | - |
81 | commands << QQuickContext2D::ClearRect; | - |
82 | rects << r; | - |
83 | } never executed: end of block | 0 |
84 | - | |
85 | inline void fillRect(const QRectF& r) | - |
86 | { | - |
87 | commands << QQuickContext2D::FillRect; | - |
88 | rects << r; | - |
89 | } never executed: end of block | 0 |
90 | - | |
91 | inline void strokeRect(const QRectF& r) | - |
92 | { | - |
93 | QPainterPath p; | - |
94 | p.addRect(r); | - |
95 | - | |
96 | commands << QQuickContext2D::Stroke; | - |
97 | pathes << p; | - |
98 | } never executed: end of block | 0 |
99 | - | |
100 | - | |
101 | inline void fill(const QPainterPath& path) | - |
102 | { | - |
103 | commands << QQuickContext2D::Fill; | - |
104 | pathes << path; | - |
105 | - | |
106 | } never executed: end of block | 0 |
107 | - | |
108 | inline void stroke(const QPainterPath& path) | - |
109 | { | - |
110 | commands << QQuickContext2D::Stroke; | - |
111 | pathes << path; | - |
112 | } never executed: end of block | 0 |
113 | - | |
114 | inline void clip(bool enabled, const QPainterPath& path) | - |
115 | { | - |
116 | commands << QQuickContext2D::Clip; | - |
117 | bools << enabled; | - |
118 | pathes << path; | - |
119 | } never executed: end of block | 0 |
120 | - | |
121 | - | |
122 | - | |
123 | inline void setFillStyle(const QBrush &style, bool repeatX = false, bool repeatY = false) | - |
124 | { | - |
125 | commands << QQuickContext2D::FillStyle; | - |
126 | brushes << style; | - |
127 | bools << repeatX << repeatY; | - |
128 | } never executed: end of block | 0 |
129 | - | |
130 | - | |
131 | inline void setLineWidth( qreal w) | - |
132 | { | - |
133 | commands << QQuickContext2D::LineWidth; | - |
134 | reals << w; | - |
135 | } never executed: end of block | 0 |
136 | - | |
137 | inline void setLineCap(Qt::PenCapStyle cap) | - |
138 | { | - |
139 | commands << QQuickContext2D::LineCap; | - |
140 | ints << cap; | - |
141 | } never executed: end of block | 0 |
142 | - | |
143 | inline void setLineJoin(Qt::PenJoinStyle join) | - |
144 | { | - |
145 | commands << QQuickContext2D::LineJoin; | - |
146 | ints << join; | - |
147 | } never executed: end of block | 0 |
148 | - | |
149 | inline void setMiterLimit( qreal limit) | - |
150 | { | - |
151 | commands << QQuickContext2D::MiterLimit; | - |
152 | reals << limit; | - |
153 | } never executed: end of block | 0 |
154 | - | |
155 | inline void setShadowOffsetX( qreal x) | - |
156 | { | - |
157 | commands << QQuickContext2D::ShadowOffsetX; | - |
158 | reals << x; | - |
159 | } never executed: end of block | 0 |
160 | - | |
161 | inline void setShadowOffsetY( qreal y) | - |
162 | { | - |
163 | commands << QQuickContext2D::ShadowOffsetY; | - |
164 | reals << y; | - |
165 | } never executed: end of block | 0 |
166 | - | |
167 | inline void setShadowBlur( qreal b) | - |
168 | { | - |
169 | commands << QQuickContext2D::ShadowBlur; | - |
170 | reals << b; | - |
171 | } never executed: end of block | 0 |
172 | - | |
173 | inline void setShadowColor(const QColor &color) | - |
174 | { | - |
175 | commands << QQuickContext2D::ShadowColor; | - |
176 | colors << color; | - |
177 | } never executed: end of block | 0 |
178 | - | |
179 | inline QTransform takeMatrix() { return never executed: matrixes.at(matrixIdx++);return matrixes.at(matrixIdx++); never executed: }return matrixes.at(matrixIdx++); | 0 |
180 | - | |
181 | inline QRectF takeRect() { return never executed: rects.at(rectIdx++);return rects.at(rectIdx++); never executed: }return rects.at(rectIdx++); | 0 |
182 | - | |
183 | inline QPainterPath takePath() { return never executed: pathes.at(pathIdx++);return pathes.at(pathIdx++); never executed: }return pathes.at(pathIdx++); | 0 |
184 | - | |
185 | inline const QImage& takeImage() { return never executed: images.at(imageIdx++);return images.at(imageIdx++); never executed: }return images.at(imageIdx++); | 0 |
186 | inline QQmlRefPointer<QQuickCanvasPixmap> takePixmap() { return never executed: pixmaps.at(pixmapIdx++);return pixmaps.at(pixmapIdx++); never executed: }return pixmaps.at(pixmapIdx++); | 0 |
187 | - | |
188 | inline int takeInt() { return never executed: ints.at(intIdx++);return ints.at(intIdx++); never executed: }return ints.at(intIdx++); | 0 |
189 | inline bool takeBool() {return never executed: bools.at(boolIdx++);return bools.at(boolIdx++); never executed: }return bools.at(boolIdx++); | 0 |
190 | inline qreal takeReal() { return never executed: reals.at(realIdx++);return reals.at(realIdx++); never executed: }return reals.at(realIdx++); | 0 |
191 | inline QColor takeColor() { return never executed: colors.at(colorIdx++);return colors.at(colorIdx++); never executed: }return colors.at(colorIdx++); | 0 |
192 | inline QBrush takeBrush() { return never executed: brushes.at(brushIdx++);return brushes.at(brushIdx++); never executed: }return brushes.at(brushIdx++); | 0 |
193 | - | |
194 | void replay(QPainter* painter, QQuickContext2D::State& state, const QVector2D &scaleFactor); | - |
195 | - | |
196 | private: | - |
197 | static QPen makePen(const QQuickContext2D::State& state); | - |
198 | void setPainterState(QPainter* painter, const QQuickContext2D::State& state, const QPen& pen); | - |
199 | int cmdIdx; | - |
200 | int intIdx; | - |
201 | int boolIdx; | - |
202 | int realIdx; | - |
203 | int rectIdx; | - |
204 | int colorIdx; | - |
205 | int matrixIdx; | - |
206 | int brushIdx; | - |
207 | int pathIdx; | - |
208 | int imageIdx; | - |
209 | int pixmapIdx; | - |
210 | QVector<QQuickContext2D::PaintCommand> commands; | - |
211 | - | |
212 | QVector<int> ints; | - |
213 | QVector<bool> bools; | - |
214 | QVector<qreal> reals; | - |
215 | QVector<QRectF> rects; | - |
216 | QVector<QColor> colors; | - |
217 | QVector<QTransform> matrixes; | - |
218 | QVector<QBrush> brushes; | - |
219 | QVector<QPainterPath> pathes; | - |
220 | QVector<QImage> images; | - |
221 | QVector<QQmlRefPointer<QQuickCanvasPixmap> > pixmaps; | - |
222 | QMutex queueLock; | - |
223 | }; | - |
224 | - | |
225 | - | |
Switch to Source code | Preprocessed file |