Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | | - |
4 | QEmulationPaintEngine::QEmulationPaintEngine(QPaintEngineEx *engine) | - |
5 | : real_engine(engine) | - |
6 | { | - |
7 | QPaintEngine::state = real_engine->state(); | - |
8 | } executed: } Execution Count:2942 | 2942 |
9 | | - |
10 | | - |
11 | QPaintEngine::Type QEmulationPaintEngine::type() const | - |
12 | { | - |
13 | return real_engine->type(); never executed: return real_engine->type(); | 0 |
14 | } | - |
15 | | - |
16 | bool QEmulationPaintEngine::begin(QPaintDevice *) | - |
17 | { | - |
18 | return true; never executed: return true; | 0 |
19 | } | - |
20 | | - |
21 | bool QEmulationPaintEngine::end() | - |
22 | { | - |
23 | return true; never executed: return true; | 0 |
24 | } | - |
25 | | - |
26 | | - |
27 | QPainterState *QEmulationPaintEngine::createState(QPainterState *orig) const | - |
28 | { | - |
29 | return real_engine->createState(orig); executed: return real_engine->createState(orig); Execution Count:12 | 12 |
30 | } | - |
31 | | - |
32 | void QEmulationPaintEngine::fill(const QVectorPath &path, const QBrush &brush) | - |
33 | { | - |
34 | QPainterState *s = state(); | - |
35 | | - |
36 | if (s->bgMode == Qt::OpaqueMode) { evaluated: s->bgMode == Qt::OpaqueMode yes Evaluation Count:5169 | yes Evaluation Count:2797 |
| 2797-5169 |
37 | Qt::BrushStyle style = brush.style(); | - |
38 | if ((style >= Qt::Dense1Pattern && style <= Qt::DiagCrossPattern) || (style == Qt::TexturePattern )) evaluated: style >= Qt::Dense1Pattern yes Evaluation Count:5165 | yes Evaluation Count:4 |
partially evaluated: style <= Qt::DiagCrossPattern yes Evaluation Count:5165 | no Evaluation Count:0 |
partially evaluated: (style == Qt::TexturePattern ) no Evaluation Count:0 | yes Evaluation Count:4 |
| 0-5165 |
39 | real_engine->fill(path, s->bgBrush); executed: real_engine->fill(path, s->bgBrush); Execution Count:5165 | 5165 |
40 | } executed: } Execution Count:5169 | 5169 |
41 | | - |
42 | Qt::BrushStyle style = qbrush_style(brush); | - |
43 | if (style >= Qt::LinearGradientPattern && style <= Qt::ConicalGradientPattern) { evaluated: style >= Qt::LinearGradientPattern yes Evaluation Count:6 | yes Evaluation Count:7960 |
partially evaluated: style <= Qt::ConicalGradientPattern yes Evaluation Count:6 | no Evaluation Count:0 |
| 0-7960 |
44 | const QGradient *g = brush.gradient(); | - |
45 | | - |
46 | if (g->coordinateMode() > QGradient::LogicalMode) { evaluated: g->coordinateMode() > QGradient::LogicalMode yes Evaluation Count:3 | yes Evaluation Count:3 |
| 3 |
47 | if (g->coordinateMode() == QGradient::StretchToDeviceMode) { evaluated: g->coordinateMode() == QGradient::StretchToDeviceMode yes Evaluation Count:1 | yes Evaluation Count:2 |
| 1-2 |
48 | QBrush copy = brush; | - |
49 | QTransform mat = copy.transform(); | - |
50 | mat.scale(real_engine->painter()->device()->width(), real_engine->painter()->device()->height()); | - |
51 | copy.setTransform(mat); | - |
52 | real_engine->fill(path, copy); | - |
53 | return; executed: return; Execution Count:1 | 1 |
54 | } else if (g->coordinateMode() == QGradient::ObjectBoundingMode) { partially evaluated: g->coordinateMode() == QGradient::ObjectBoundingMode yes Evaluation Count:2 | no Evaluation Count:0 |
| 0-2 |
55 | QBrush copy = brush; | - |
56 | QTransform mat = copy.transform(); | - |
57 | QRectF r = path.controlPointRect(); | - |
58 | mat.translate(r.x(), r.y()); | - |
59 | mat.scale(r.width(), r.height()); | - |
60 | copy.setTransform(mat); | - |
61 | real_engine->fill(path, copy); | - |
62 | return; executed: return; Execution Count:2 | 2 |
63 | } | - |
64 | } | - |
65 | } executed: } Execution Count:3 | 3 |
66 | | - |
67 | real_engine->fill(path, brush); | - |
68 | } executed: } Execution Count:7963 | 7963 |
69 | | - |
70 | void QEmulationPaintEngine::stroke(const QVectorPath &path, const QPen &pen) | - |
71 | { | - |
72 | QPainterState *s = state(); | - |
73 | | - |
74 | if (s->bgMode == Qt::OpaqueMode && pen.style() > Qt::SolidLine) { evaluated: s->bgMode == Qt::OpaqueMode yes Evaluation Count:16 | yes Evaluation Count:11170 |
partially evaluated: pen.style() > Qt::SolidLine no Evaluation Count:0 | yes Evaluation Count:16 |
| 0-11170 |
75 | QPen bgPen = pen; | - |
76 | bgPen.setBrush(s->bgBrush); | - |
77 | bgPen.setStyle(Qt::SolidLine); | - |
78 | real_engine->stroke(path, bgPen); | - |
79 | } | 0 |
80 | | - |
81 | QBrush brush = pen.brush(); | - |
82 | QPen copy = pen; | - |
83 | Qt::BrushStyle style = qbrush_style(brush); | - |
84 | if (style >= Qt::LinearGradientPattern && style <= Qt::ConicalGradientPattern) { partially evaluated: style >= Qt::LinearGradientPattern no Evaluation Count:0 | yes Evaluation Count:11186 |
never evaluated: style <= Qt::ConicalGradientPattern | 0-11186 |
85 | const QGradient *g = brush.gradient(); | - |
86 | | - |
87 | if (g->coordinateMode() > QGradient::LogicalMode) { never evaluated: g->coordinateMode() > QGradient::LogicalMode | 0 |
88 | if (g->coordinateMode() == QGradient::StretchToDeviceMode) { never evaluated: g->coordinateMode() == QGradient::StretchToDeviceMode | 0 |
89 | QTransform mat = brush.transform(); | - |
90 | mat.scale(real_engine->painter()->device()->width(), real_engine->painter()->device()->height()); | - |
91 | brush.setTransform(mat); | - |
92 | copy.setBrush(brush); | - |
93 | real_engine->stroke(path, copy); | - |
94 | return; | 0 |
95 | } else if (g->coordinateMode() == QGradient::ObjectBoundingMode) { never evaluated: g->coordinateMode() == QGradient::ObjectBoundingMode | 0 |
96 | QTransform mat = brush.transform(); | - |
97 | QRectF r = path.controlPointRect(); | - |
98 | mat.translate(r.x(), r.y()); | - |
99 | mat.scale(r.width(), r.height()); | - |
100 | brush.setTransform(mat); | - |
101 | copy.setBrush(brush); | - |
102 | real_engine->stroke(path, copy); | - |
103 | return; | 0 |
104 | } | - |
105 | } | - |
106 | } | 0 |
107 | | - |
108 | real_engine->stroke(path, pen); | - |
109 | } executed: } Execution Count:11186 | 11186 |
110 | | - |
111 | void QEmulationPaintEngine::clip(const QVectorPath &path, Qt::ClipOperation op) | - |
112 | { | - |
113 | real_engine->clip(path, op); | - |
114 | } executed: } Execution Count:6 | 6 |
115 | | - |
116 | void QEmulationPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) | - |
117 | { | - |
118 | if (state()->bgMode == Qt::OpaqueMode && pm.isQBitmap()) partially evaluated: state()->bgMode == Qt::OpaqueMode no Evaluation Count:0 | yes Evaluation Count:3 |
never evaluated: pm.isQBitmap() | 0-3 |
119 | fillBGRect(r); never executed: fillBGRect(r); | 0 |
120 | real_engine->drawPixmap(r, pm, sr); | - |
121 | } executed: } Execution Count:3 | 3 |
122 | | - |
123 | void QEmulationPaintEngine::drawTextItem(const QPointF &p, const QTextItem &textItem) | - |
124 | { | - |
125 | if (state()->bgMode == Qt::OpaqueMode) { never evaluated: state()->bgMode == Qt::OpaqueMode | 0 |
126 | const QTextItemInt &ti = static_cast<const QTextItemInt &>(textItem); | - |
127 | QRectF rect(p.x(), p.y() - ti.ascent.toReal(), ti.width.toReal(), (ti.ascent + ti.descent + 1).toReal()); | - |
128 | fillBGRect(rect); | - |
129 | } | 0 |
130 | | - |
131 | QPainterState *s = state(); | - |
132 | Qt::BrushStyle style = qbrush_style(s->pen.brush()); | - |
133 | if (style >= Qt::LinearGradientPattern && style <= Qt::ConicalGradientPattern) never evaluated: style >= Qt::LinearGradientPattern never evaluated: style <= Qt::ConicalGradientPattern | 0 |
134 | { | - |
135 | QPen savedPen = s->pen; | - |
136 | QGradient g = *s->pen.brush().gradient(); | - |
137 | | - |
138 | if (g.coordinateMode() > QGradient::LogicalMode) { never evaluated: g.coordinateMode() > QGradient::LogicalMode | 0 |
139 | QTransform mat = s->pen.brush().transform(); | - |
140 | if (g.coordinateMode() == QGradient::StretchToDeviceMode) { never evaluated: g.coordinateMode() == QGradient::StretchToDeviceMode | 0 |
141 | mat.scale(real_engine->painter()->device()->width(), real_engine->painter()->device()->height()); | - |
142 | } else if (g.coordinateMode() == QGradient::ObjectBoundingMode) { never evaluated: g.coordinateMode() == QGradient::ObjectBoundingMode | 0 |
143 | const QTextItemInt &ti = static_cast<const QTextItemInt &>(textItem); | - |
144 | QRectF r(p.x(), p.y() - ti.ascent.toReal(), ti.width.toReal(), (ti.ascent + ti.descent + 1).toReal()); | - |
145 | mat.translate(r.x(), r.y()); | - |
146 | mat.scale(r.width(), r.height()); | - |
147 | } | 0 |
148 | g.setCoordinateMode(QGradient::LogicalMode); | - |
149 | QBrush brush(g); | - |
150 | brush.setTransform(mat); | - |
151 | s->pen.setBrush(brush); | - |
152 | penChanged(); | - |
153 | real_engine->drawTextItem(p, textItem); | - |
154 | s->pen = savedPen; | - |
155 | penChanged(); | - |
156 | return; | 0 |
157 | } | - |
158 | } | 0 |
159 | | - |
160 | real_engine->drawTextItem(p, textItem); | - |
161 | } | 0 |
162 | | - |
163 | void QEmulationPaintEngine::drawStaticTextItem(QStaticTextItem *item) | - |
164 | { | - |
165 | real_engine->drawStaticTextItem(item); | - |
166 | } | 0 |
167 | | - |
168 | void QEmulationPaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) | - |
169 | { | - |
170 | if (state()->bgMode == Qt::OpaqueMode && pixmap.isQBitmap()) never evaluated: state()->bgMode == Qt::OpaqueMode never evaluated: pixmap.isQBitmap() | 0 |
171 | fillBGRect(r); never executed: fillBGRect(r); | 0 |
172 | real_engine->drawTiledPixmap(r, pixmap, s); | - |
173 | } | 0 |
174 | | - |
175 | void QEmulationPaintEngine::drawImage(const QRectF &r, const QImage &pm, const QRectF &sr, Qt::ImageConversionFlags flags) | - |
176 | { | - |
177 | real_engine->drawImage(r, pm, sr, flags); | - |
178 | } | 0 |
179 | | - |
180 | void QEmulationPaintEngine::clipEnabledChanged() | - |
181 | { | - |
182 | real_engine->clipEnabledChanged(); | - |
183 | } | 0 |
184 | | - |
185 | void QEmulationPaintEngine::penChanged() | - |
186 | { | - |
187 | real_engine->penChanged(); | - |
188 | } executed: } Execution Count:13996 | 13996 |
189 | | - |
190 | void QEmulationPaintEngine::brushChanged() | - |
191 | { | - |
192 | real_engine->brushChanged(); | - |
193 | } executed: } Execution Count:5033 | 5033 |
194 | | - |
195 | void QEmulationPaintEngine::brushOriginChanged() | - |
196 | { | - |
197 | real_engine->brushOriginChanged(); | - |
198 | } | 0 |
199 | | - |
200 | void QEmulationPaintEngine::opacityChanged() | - |
201 | { | - |
202 | real_engine->opacityChanged(); | - |
203 | } | 0 |
204 | | - |
205 | void QEmulationPaintEngine::compositionModeChanged() | - |
206 | { | - |
207 | real_engine->compositionModeChanged(); | - |
208 | } | 0 |
209 | | - |
210 | void QEmulationPaintEngine::renderHintsChanged() | - |
211 | { | - |
212 | real_engine->renderHintsChanged(); | - |
213 | } executed: } Execution Count:6 | 6 |
214 | | - |
215 | void QEmulationPaintEngine::transformChanged() | - |
216 | { | - |
217 | real_engine->transformChanged(); | - |
218 | } executed: } Execution Count:3 | 3 |
219 | | - |
220 | void QEmulationPaintEngine::setState(QPainterState *s) | - |
221 | { | - |
222 | QPaintEngine::state = s; | - |
223 | real_engine->setState(s); | - |
224 | } executed: } Execution Count:2966 | 2966 |
225 | | - |
226 | void QEmulationPaintEngine::beginNativePainting() | - |
227 | { | - |
228 | real_engine->beginNativePainting(); | - |
229 | } | 0 |
230 | | - |
231 | void QEmulationPaintEngine::endNativePainting() | - |
232 | { | - |
233 | real_engine->endNativePainting(); | - |
234 | } | 0 |
235 | | - |
236 | void QEmulationPaintEngine::fillBGRect(const QRectF &r) | - |
237 | { | - |
238 | qreal pts[] = { r.x(), r.y(), r.x() + r.width(), r.y(), | - |
239 | r.x() + r.width(), r.y() + r.height(), r.x(), r.y() + r.height() }; | - |
240 | QVectorPath vp(pts, 4, 0, QVectorPath::RectangleHint); | - |
241 | real_engine->fill(vp, state()->bgBrush); | - |
242 | } | 0 |
243 | | - |
244 | | - |
245 | | - |
| | |