| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/painting/qpaintengineex.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | - | |||||||||||||
| 5 | QVectorPath::~QVectorPath() | - | ||||||||||||
| 6 | { | - | ||||||||||||
| 7 | if (m_hints & ShouldUseCacheHint) { | - | ||||||||||||
| 8 | CacheEntry *e = m_cache; | - | ||||||||||||
| 9 | while (e) { | - | ||||||||||||
| 10 | if (e->data) | - | ||||||||||||
| 11 | e->cleanup(e->engine, e->data); | - | ||||||||||||
| 12 | CacheEntry *n = e->next; | - | ||||||||||||
| 13 | delete e; | - | ||||||||||||
| 14 | e = n; | - | ||||||||||||
| 15 | } | - | ||||||||||||
| 16 | } | - | ||||||||||||
| 17 | } | - | ||||||||||||
| 18 | - | |||||||||||||
| 19 | - | |||||||||||||
| 20 | QRectF QVectorPath::controlPointRect() const | - | ||||||||||||
| 21 | { | - | ||||||||||||
| 22 | if (m_hints & ControlPointRect) | - | ||||||||||||
| 23 | return QRectF(QPointF(m_cp_rect.x1, m_cp_rect.y1), QPointF(m_cp_rect.x2, m_cp_rect.y2)); | - | ||||||||||||
| 24 | - | |||||||||||||
| 25 | if (m_count == 0) { | - | ||||||||||||
| 26 | m_cp_rect.x1 = m_cp_rect.x2 = m_cp_rect.y1 = m_cp_rect.y2 = 0; | - | ||||||||||||
| 27 | m_hints |= ControlPointRect; | - | ||||||||||||
| 28 | return QRectF(QPointF(m_cp_rect.x1, m_cp_rect.y1), QPointF(m_cp_rect.x2, m_cp_rect.y2)); | - | ||||||||||||
| 29 | } | - | ||||||||||||
| 30 | ((!(m_points && m_count > 0)) ? qt_assert("m_points && m_count > 0",__FILE__,8288) : qt_noop()); | - | ||||||||||||
| 31 | - | |||||||||||||
| 32 | const qreal *pts = m_points; | - | ||||||||||||
| 33 | m_cp_rect.x1 = m_cp_rect.x2 = *pts; | - | ||||||||||||
| 34 | ++pts; | - | ||||||||||||
| 35 | m_cp_rect.y1 = m_cp_rect.y2 = *pts; | - | ||||||||||||
| 36 | ++pts; | - | ||||||||||||
| 37 | - | |||||||||||||
| 38 | const qreal *epts = m_points + (m_count << 1); | - | ||||||||||||
| 39 | while (pts < epts) { | - | ||||||||||||
| 40 | qreal x = *pts; | - | ||||||||||||
| 41 | if (x < m_cp_rect.x1) m_cp_rect.x1 = x; | - | ||||||||||||
| 42 | else if (x > m_cp_rect.x2) m_cp_rect.x2 = x; | - | ||||||||||||
| 43 | ++pts; | - | ||||||||||||
| 44 | - | |||||||||||||
| 45 | qreal y = *pts; | - | ||||||||||||
| 46 | if (y < m_cp_rect.y1) m_cp_rect.y1 = y; | - | ||||||||||||
| 47 | else if (y > m_cp_rect.y2) m_cp_rect.y2 = y; | - | ||||||||||||
| 48 | ++pts; | - | ||||||||||||
| 49 | } | - | ||||||||||||
| 50 | - | |||||||||||||
| 51 | m_hints |= ControlPointRect; | - | ||||||||||||
| 52 | return QRectF(QPointF(m_cp_rect.x1, m_cp_rect.y1), QPointF(m_cp_rect.x2, m_cp_rect.y2)); | - | ||||||||||||
| 53 | } | - | ||||||||||||
| 54 | - | |||||||||||||
| 55 | - | |||||||||||||
| 56 | QVectorPath::CacheEntry *QVectorPath::addCacheData(QPaintEngineEx *engine, void *data, | - | ||||||||||||
| 57 | qvectorpath_cache_cleanup cleanup) const{ | - | ||||||||||||
| 58 | ((!(!lookupCacheData(engine))) ? qt_assert("!lookupCacheData(engine)",__FILE__,110116) : qt_noop()); | - | ||||||||||||
| 59 | if ((m_hints & IsCachedHint) == 0) { | - | ||||||||||||
| 60 | m_cache = 0; | - | ||||||||||||
| 61 | m_hints |= IsCachedHint; | - | ||||||||||||
| 62 | } | - | ||||||||||||
| 63 | CacheEntry *e = new CacheEntry; | - | ||||||||||||
| 64 | e->engine = engine; | - | ||||||||||||
| 65 | e->data = data; | - | ||||||||||||
| 66 | e->cleanup = cleanup; | - | ||||||||||||
| 67 | e->next = m_cache; | - | ||||||||||||
| 68 | m_cache = e; | - | ||||||||||||
| 69 | return m_cache; | - | ||||||||||||
| 70 | } | - | ||||||||||||
| 71 | - | |||||||||||||
| 72 | - | |||||||||||||
| 73 | const QVectorPath &qtVectorPathForPath(const QPainterPath &path) | - | ||||||||||||
| 74 | { | - | ||||||||||||
| 75 | ((!(path.d_func())) ? qt_assert("path.d_func()",__FILE__,127133) : qt_noop()); | - | ||||||||||||
| 76 | return path.d_func()->vectorPath(); | - | ||||||||||||
| 77 | } | - | ||||||||||||
| 78 | - | |||||||||||||
| 79 | - | |||||||||||||
| 80 | QDebug __attribute__((visibility("default"))) &operator<<(QDebug &s, const QVectorPath &path) | - | ||||||||||||
| 81 | { | - | ||||||||||||
| 82 | QRectF rf = path.controlPointRect(); | - | ||||||||||||
| 83 | s << "QVectorPath(size:" << path.elementCount() | - | ||||||||||||
| 84 | << " hints:" << hex << path.hints() | - | ||||||||||||
| 85 | << rf << ')'; | - | ||||||||||||
| 86 | return s; | - | ||||||||||||
| 87 | } | - | ||||||||||||
| 88 | struct StrokeHandler { | - | ||||||||||||
| 89 | StrokeHandler(int reserve) : pts(reserve), types(reserve) {} | - | ||||||||||||
| 90 | QDataBuffer<qreal> pts; | - | ||||||||||||
| 91 | QDataBuffer<QPainterPath::ElementType> types; | - | ||||||||||||
| 92 | }; | - | ||||||||||||
| 93 | - | |||||||||||||
| 94 | - | |||||||||||||
| 95 | QPaintEngineExPrivate::QPaintEngineExPrivate() | - | ||||||||||||
| 96 | : dasher(&stroker), | - | ||||||||||||
| 97 | strokeHandler(0), | - | ||||||||||||
| 98 | activeStroker(0), | - | ||||||||||||
| 99 | strokerPen(Qt::NoPen) | - | ||||||||||||
| 100 | { | - | ||||||||||||
| 101 | } | - | ||||||||||||
| 102 | - | |||||||||||||
| 103 | - | |||||||||||||
| 104 | QPaintEngineExPrivate::~QPaintEngineExPrivate() | - | ||||||||||||
| 105 | { | - | ||||||||||||
| 106 | delete strokeHandler; | - | ||||||||||||
| 107 | } | - | ||||||||||||
| 108 | - | |||||||||||||
| 109 | - | |||||||||||||
| 110 | void QPaintEngineExPrivate::replayClipOperations() | - | ||||||||||||
| 111 | { | - | ||||||||||||
| 112 | QPaintEngineEx * const q = q_func(); | - | ||||||||||||
| 113 | - | |||||||||||||
| 114 | QPainter *p = q->painter(); | - | ||||||||||||
| 115 | if (!p
| 0 | ||||||||||||
| 116 | return; never executed: return; | 0 | ||||||||||||
| 117 | - | |||||||||||||
| 118 | QListconst QVector<QPainterClipInfo> clipInfo&clipInfo = p->d_ptr->state->clipInfo; | - | ||||||||||||
| 119 | - | |||||||||||||
| 120 | QTransform transform = q->state()->matrix; | - | ||||||||||||
| 121 | - | |||||||||||||
| 122 | for (int i = 0; i < clipInfo.size(); ++i) {const QPainterClipInfo &info =: clipInfo.at(i);) { | - | ||||||||||||
| 123 | - | |||||||||||||
| 124 | if (info.matrix != q->state()->matrix
| 0 | ||||||||||||
| 125 | q->state()->matrix = info.matrix; | - | ||||||||||||
| 126 | q->transformChanged(); | - | ||||||||||||
| 127 | } never executed: end of block | 0 | ||||||||||||
| 128 | - | |||||||||||||
| 129 | switch (info.clipType) { | - | ||||||||||||
| 130 | case never executed: QPainterClipInfo::RegionClip:case QPainterClipInfo::RegionClip:never executed: case QPainterClipInfo::RegionClip: | 0 | ||||||||||||
| 131 | q->clip(info.region, info.operation); | - | ||||||||||||
| 132 | break; never executed: break; | 0 | ||||||||||||
| 133 | case never executed: QPainterClipInfo::PathClip:case QPainterClipInfo::PathClip:never executed: case QPainterClipInfo::PathClip: | 0 | ||||||||||||
| 134 | q->clip(info.path, info.operation); | - | ||||||||||||
| 135 | break; never executed: break; | 0 | ||||||||||||
| 136 | case never executed: QPainterClipInfo::RectClip:case QPainterClipInfo::RectClip:never executed: case QPainterClipInfo::RectClip: | 0 | ||||||||||||
| 137 | q->clip(info.rect, info.operation); | - | ||||||||||||
| 138 | break; never executed: break; | 0 | ||||||||||||
| 139 | case never executed: QPainterClipInfo::RectFClip:case QPainterClipInfo::RectFClip:never executed: {case QPainterClipInfo::RectFClip: | 0 | ||||||||||||
| 140 | qreal right = info.rectf.x() + info.rectf.width(); | - | ||||||||||||
| 141 | qreal bottom = info.rectf.y() + info.rectf.height(); | - | ||||||||||||
| 142 | qreal pts[] = { info.rectf.x(), info.rectf.y(), | - | ||||||||||||
| 143 | right, info.rectf.y(), | - | ||||||||||||
| 144 | right, bottom, | - | ||||||||||||
| 145 | info.rectf.x(), bottom }; | - | ||||||||||||
| 146 | QVectorPath vp(pts, 4, 0, QVectorPath::RectangleHint); | - | ||||||||||||
| 147 | q->clip(vp, info.operation); | - | ||||||||||||
| 148 | break; never executed: break; | 0 | ||||||||||||
| 149 | } | - | ||||||||||||
| 150 | } | - | ||||||||||||
| 151 | } never executed: end of block | 0 | ||||||||||||
| 152 | - | |||||||||||||
| 153 | if (transform != q->state()->matrix
| 0 | ||||||||||||
| 154 | q->state()->matrix = transform; | - | ||||||||||||
| 155 | q->transformChanged(); | - | ||||||||||||
| 156 | } never executed: end of block | 0 | ||||||||||||
| 157 | } never executed: end of block | 0 | ||||||||||||
| 158 | - | |||||||||||||
| 159 | - | |||||||||||||
| 160 | bool QPaintEngineExPrivate::hasClipOperations() const | - | ||||||||||||
| 161 | { | - | ||||||||||||
| 162 | const QPaintEngineEx * const q = q_func(); | - | ||||||||||||
| 163 | - | |||||||||||||
| 164 | QPainter *p = q->painter(); | - | ||||||||||||
| 165 | if (!p
| 0 | ||||||||||||
| 166 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||
| 167 | - | |||||||||||||
| 168 | QList<QPainterClipInfo> clipInfo =return never executed: return !p->d_ptr->state->clipInfo.isEmpty();never executed: !p->d_ptr->state->clipInfo;return !p->d_ptr->state->clipInfo.isEmpty();never executed: return !p->d_ptr->state->clipInfo.isEmpty(); | 0 | ||||||||||||
| return ! never executed: return !p->d_ptr->state->clipInfo.isEmpty();never executed: clipInfo.isEmpty();return !p->d_ptr->state->clipInfo.isEmpty();never executed: return !p->d_ptr->state->clipInfo.isEmpty(); | ||||||||||||||
| 169 | } | - | ||||||||||||
| 170 | - | |||||||||||||
| 171 | - | |||||||||||||
| 172 | - | |||||||||||||
| 173 | - | |||||||||||||
| 174 | - | |||||||||||||
| 175 | - | |||||||||||||
| 176 | - | |||||||||||||
| 177 | static const QPainterPath::ElementType qpaintengineex_ellipse_types[] = { | - | ||||||||||||
| 178 | QPainterPath::MoveToElement, | - | ||||||||||||
| 179 | QPainterPath::CurveToElement, | - | ||||||||||||
| 180 | QPainterPath::CurveToDataElement, | - | ||||||||||||
| 181 | QPainterPath::CurveToDataElement, | - | ||||||||||||
| 182 | - | |||||||||||||
| 183 | QPainterPath::CurveToElement, | - | ||||||||||||
| 184 | QPainterPath::CurveToDataElement, | - | ||||||||||||
| 185 | QPainterPath::CurveToDataElement, | - | ||||||||||||
| 186 | - | |||||||||||||
| 187 | QPainterPath::CurveToElement, | - | ||||||||||||
| 188 | QPainterPath::CurveToDataElement, | - | ||||||||||||
| 189 | QPainterPath::CurveToDataElement, | - | ||||||||||||
| 190 | - | |||||||||||||
| 191 | QPainterPath::CurveToElement, | - | ||||||||||||
| 192 | QPainterPath::CurveToDataElement, | - | ||||||||||||
| 193 | QPainterPath::CurveToDataElement | - | ||||||||||||
| 194 | }; | - | ||||||||||||
| 195 | - | |||||||||||||
| 196 | static const QPainterPath::ElementType qpaintengineex_line_types_16[] = { | - | ||||||||||||
| 197 | QPainterPath::MoveToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 198 | QPainterPath::MoveToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 199 | QPainterPath::MoveToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 200 | QPainterPath::MoveToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 201 | QPainterPath::MoveToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 202 | QPainterPath::MoveToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 203 | QPainterPath::MoveToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 204 | QPainterPath::MoveToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 205 | QPainterPath::MoveToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 206 | QPainterPath::MoveToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 207 | QPainterPath::MoveToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 208 | QPainterPath::MoveToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 209 | QPainterPath::MoveToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 210 | QPainterPath::MoveToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 211 | QPainterPath::MoveToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 212 | QPainterPath::MoveToElement, QPainterPath::LineToElement | - | ||||||||||||
| 213 | }; | - | ||||||||||||
| 214 | - | |||||||||||||
| 215 | static const QPainterPath::ElementType qpaintengineex_rect4_types_32[] = { | - | ||||||||||||
| 216 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 217 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 218 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 219 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 220 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 221 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 222 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 223 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 224 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 225 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 226 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 227 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 228 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 229 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 230 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 231 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 232 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 233 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 234 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 235 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 236 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 237 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 238 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 239 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 240 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 241 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 242 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 243 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 244 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 245 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 246 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 247 | QPainterPath::MoveToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, QPainterPath::LineToElement, | - | ||||||||||||
| 248 | }; | - | ||||||||||||
| 249 | - | |||||||||||||
| 250 | - | |||||||||||||
| 251 | static const QPainterPath::ElementType qpaintengineex_roundedrect_types[] = { | - | ||||||||||||
| 252 | QPainterPath::MoveToElement, | - | ||||||||||||
| 253 | QPainterPath::LineToElement, | - | ||||||||||||
| 254 | QPainterPath::CurveToElement, | - | ||||||||||||
| 255 | QPainterPath::CurveToDataElement, | - | ||||||||||||
| 256 | QPainterPath::CurveToDataElement, | - | ||||||||||||
| 257 | QPainterPath::LineToElement, | - | ||||||||||||
| 258 | QPainterPath::CurveToElement, | - | ||||||||||||
| 259 | QPainterPath::CurveToDataElement, | - | ||||||||||||
| 260 | QPainterPath::CurveToDataElement, | - | ||||||||||||
| 261 | QPainterPath::LineToElement, | - | ||||||||||||
| 262 | QPainterPath::CurveToElement, | - | ||||||||||||
| 263 | QPainterPath::CurveToDataElement, | - | ||||||||||||
| 264 | QPainterPath::CurveToDataElement, | - | ||||||||||||
| 265 | QPainterPath::LineToElement, | - | ||||||||||||
| 266 | QPainterPath::CurveToElement, | - | ||||||||||||
| 267 | QPainterPath::CurveToDataElement, | - | ||||||||||||
| 268 | QPainterPath::CurveToDataElement | - | ||||||||||||
| 269 | }; | - | ||||||||||||
| 270 | - | |||||||||||||
| 271 | - | |||||||||||||
| 272 | - | |||||||||||||
| 273 | static void qpaintengineex_moveTo(qreal x, qreal y, void *data) { | - | ||||||||||||
| 274 | ((StrokeHandler *) data)->pts.add(x); | - | ||||||||||||
| 275 | ((StrokeHandler *) data)->pts.add(y); | - | ||||||||||||
| 276 | ((StrokeHandler *) data)->types.add(QPainterPath::MoveToElement); | - | ||||||||||||
| 277 | } | - | ||||||||||||
| 278 | - | |||||||||||||
| 279 | static void qpaintengineex_lineTo(qreal x, qreal y, void *data) { | - | ||||||||||||
| 280 | ((StrokeHandler *) data)->pts.add(x); | - | ||||||||||||
| 281 | ((StrokeHandler *) data)->pts.add(y); | - | ||||||||||||
| 282 | ((StrokeHandler *) data)->types.add(QPainterPath::LineToElement); | - | ||||||||||||
| 283 | } | - | ||||||||||||
| 284 | - | |||||||||||||
| 285 | static void qpaintengineex_cubicTo(qreal c1x, qreal c1y, qreal c2x, qreal c2y, qreal ex, qreal ey, void *data) { | - | ||||||||||||
| 286 | ((StrokeHandler *) data)->pts.add(c1x); | - | ||||||||||||
| 287 | ((StrokeHandler *) data)->pts.add(c1y); | - | ||||||||||||
| 288 | ((StrokeHandler *) data)->types.add(QPainterPath::CurveToElement); | - | ||||||||||||
| 289 | - | |||||||||||||
| 290 | ((StrokeHandler *) data)->pts.add(c2x); | - | ||||||||||||
| 291 | ((StrokeHandler *) data)->pts.add(c2y); | - | ||||||||||||
| 292 | ((StrokeHandler *) data)->types.add(QPainterPath::CurveToDataElement); | - | ||||||||||||
| 293 | - | |||||||||||||
| 294 | ((StrokeHandler *) data)->pts.add(ex); | - | ||||||||||||
| 295 | ((StrokeHandler *) data)->pts.add(ey); | - | ||||||||||||
| 296 | ((StrokeHandler *) data)->types.add(QPainterPath::CurveToDataElement); | - | ||||||||||||
| 297 | } | - | ||||||||||||
| 298 | - | |||||||||||||
| 299 | QPaintEngineEx::QPaintEngineEx() | - | ||||||||||||
| 300 | : QPaintEngine(*new QPaintEngineExPrivate, AllFeatures) | - | ||||||||||||
| 301 | { | - | ||||||||||||
| 302 | extended = true; | - | ||||||||||||
| 303 | } | - | ||||||||||||
| 304 | - | |||||||||||||
| 305 | QPaintEngineEx::QPaintEngineEx(QPaintEngineExPrivate &data) | - | ||||||||||||
| 306 | : QPaintEngine(data, AllFeatures) | - | ||||||||||||
| 307 | { | - | ||||||||||||
| 308 | extended = true; | - | ||||||||||||
| 309 | } | - | ||||||||||||
| 310 | - | |||||||||||||
| 311 | QPainterState *QPaintEngineEx::createState(QPainterState *orig) const | - | ||||||||||||
| 312 | { | - | ||||||||||||
| 313 | if (!orig) | - | ||||||||||||
| 314 | return new QPainterState; | - | ||||||||||||
| 315 | return new QPainterState(orig); | - | ||||||||||||
| 316 | } | - | ||||||||||||
| 317 | - | |||||||||||||
| 318 | __attribute__((visibility("default"))) extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale); | - | ||||||||||||
| 319 | - | |||||||||||||
| 320 | void QPaintEngineEx::stroke(const QVectorPath &path, const QPen &pen) | - | ||||||||||||
| 321 | { | - | ||||||||||||
| 322 | - | |||||||||||||
| 323 | - | |||||||||||||
| 324 | - | |||||||||||||
| 325 | - | |||||||||||||
| 326 | QPaintEngineExPrivate * const d = d_func(); | - | ||||||||||||
| 327 | - | |||||||||||||
| 328 | if (path.isEmpty()) | - | ||||||||||||
| 329 | return; | - | ||||||||||||
| 330 | - | |||||||||||||
| 331 | if (!d->strokeHandler) { | - | ||||||||||||
| 332 | d->strokeHandler = new StrokeHandler(path.elementCount()+4); | - | ||||||||||||
| 333 | d->stroker.setMoveToHook(qpaintengineex_moveTo); | - | ||||||||||||
| 334 | d->stroker.setLineToHook(qpaintengineex_lineTo); | - | ||||||||||||
| 335 | d->stroker.setCubicToHook(qpaintengineex_cubicTo); | - | ||||||||||||
| 336 | } | - | ||||||||||||
| 337 | - | |||||||||||||
| 338 | if (!qpen_fast_equals(pen, d->strokerPen)) { | - | ||||||||||||
| 339 | d->strokerPen = pen; | - | ||||||||||||
| 340 | d->stroker.setJoinStyle(pen.joinStyle()); | - | ||||||||||||
| 341 | d->stroker.setCapStyle(pen.capStyle()); | - | ||||||||||||
| 342 | d->stroker.setMiterLimit(pen.miterLimit()); | - | ||||||||||||
| 343 | qreal penWidth = pen.widthF(); | - | ||||||||||||
| 344 | if (penWidth == 0) | - | ||||||||||||
| 345 | d->stroker.setStrokeWidth(1); | - | ||||||||||||
| 346 | else | - | ||||||||||||
| 347 | d->stroker.setStrokeWidth(penWidth); | - | ||||||||||||
| 348 | - | |||||||||||||
| 349 | Qt::PenStyle style = pen.style(); | - | ||||||||||||
| 350 | if (style == Qt::SolidLine) { | - | ||||||||||||
| 351 | d->activeStroker = &d->stroker; | - | ||||||||||||
| 352 | } else if (style == Qt::NoPen) { | - | ||||||||||||
| 353 | d->activeStroker = 0; | - | ||||||||||||
| 354 | } else { | - | ||||||||||||
| 355 | d->dasher.setDashPattern(pen.dashPattern()); | - | ||||||||||||
| 356 | d->dasher.setDashOffset(pen.dashOffset()); | - | ||||||||||||
| 357 | d->activeStroker = &d->dasher; | - | ||||||||||||
| 358 | } | - | ||||||||||||
| 359 | } | - | ||||||||||||
| 360 | - | |||||||||||||
| 361 | if (!d->activeStroker) { | - | ||||||||||||
| 362 | return; | - | ||||||||||||
| 363 | } | - | ||||||||||||
| 364 | - | |||||||||||||
| 365 | if (pen.style() > Qt::SolidLine) { | - | ||||||||||||
| 366 | if (qt_pen_is_cosmetic(pen, state()->renderHints)){ | - | ||||||||||||
| 367 | d->activeStroker->setClipRect(d->exDeviceRect); | - | ||||||||||||
| 368 | } else { | - | ||||||||||||
| 369 | QRectF clipRect = state()->matrix.inverted().mapRect(QRectF(d->exDeviceRect)); | - | ||||||||||||
| 370 | d->activeStroker->setClipRect(clipRect); | - | ||||||||||||
| 371 | } | - | ||||||||||||
| 372 | } | - | ||||||||||||
| 373 | - | |||||||||||||
| 374 | const QPainterPath::ElementType *types = path.elements(); | - | ||||||||||||
| 375 | const qreal *points = path.points(); | - | ||||||||||||
| 376 | int pointCount = path.elementCount(); | - | ||||||||||||
| 377 | - | |||||||||||||
| 378 | const qreal *lastPoint = points + (pointCount<<1); | - | ||||||||||||
| 379 | - | |||||||||||||
| 380 | d->strokeHandler->types.reset(); | - | ||||||||||||
| 381 | d->strokeHandler->pts.reset(); | - | ||||||||||||
| 382 | - | |||||||||||||
| 383 | - | |||||||||||||
| 384 | uint flags = QVectorPath::WindingFill; | - | ||||||||||||
| 385 | - | |||||||||||||
| 386 | if (path.elementCount() > 2) | - | ||||||||||||
| 387 | flags |= QVectorPath::NonConvexShapeMask; | - | ||||||||||||
| 388 | - | |||||||||||||
| 389 | if (d->stroker.capStyle() == Qt::RoundCap || d->stroker.joinStyle() == Qt::RoundJoin) | - | ||||||||||||
| 390 | flags |= QVectorPath::CurvedShapeMask; | - | ||||||||||||
| 391 | - | |||||||||||||
| 392 | - | |||||||||||||
| 393 | if (!qt_pen_is_cosmetic(pen, state()->renderHints)) { | - | ||||||||||||
| 394 | - | |||||||||||||
| 395 | - | |||||||||||||
| 396 | - | |||||||||||||
| 397 | - | |||||||||||||
| 398 | d->activeStroker->setCurveThresholdFromTransform(state()->matrix); | - | ||||||||||||
| 399 | d->activeStroker->begin(d->strokeHandler); | - | ||||||||||||
| 400 | if (types) { | - | ||||||||||||
| 401 | while (points < lastPoint) { | - | ||||||||||||
| 402 | switch (*types) { | - | ||||||||||||
| 403 | case QPainterPath::MoveToElement: | - | ||||||||||||
| 404 | d->activeStroker->moveTo(points[0], points[1]); | - | ||||||||||||
| 405 | points += 2; | - | ||||||||||||
| 406 | ++types; | - | ||||||||||||
| 407 | break; | - | ||||||||||||
| 408 | case QPainterPath::LineToElement: | - | ||||||||||||
| 409 | d->activeStroker->lineTo(points[0], points[1]); | - | ||||||||||||
| 410 | points += 2; | - | ||||||||||||
| 411 | ++types; | - | ||||||||||||
| 412 | break; | - | ||||||||||||
| 413 | case QPainterPath::CurveToElement: | - | ||||||||||||
| 414 | d->activeStroker->cubicTo(points[0], points[1], | - | ||||||||||||
| 415 | points[2], points[3], | - | ||||||||||||
| 416 | points[4], points[5]); | - | ||||||||||||
| 417 | points += 6; | - | ||||||||||||
| 418 | types += 3; | - | ||||||||||||
| 419 | flags |= QVectorPath::CurvedShapeMask; | - | ||||||||||||
| 420 | break; | - | ||||||||||||
| 421 | default: | - | ||||||||||||
| 422 | break; | - | ||||||||||||
| 423 | } | - | ||||||||||||
| 424 | } | - | ||||||||||||
| 425 | if (path.hasImplicitClose()) | - | ||||||||||||
| 426 | d->activeStroker->lineTo(path.points()[0], path.points()[1]); | - | ||||||||||||
| 427 | - | |||||||||||||
| 428 | } else { | - | ||||||||||||
| 429 | d->activeStroker->moveTo(points[0], points[1]); | - | ||||||||||||
| 430 | points += 2; | - | ||||||||||||
| 431 | while (points < lastPoint) { | - | ||||||||||||
| 432 | d->activeStroker->lineTo(points[0], points[1]); | - | ||||||||||||
| 433 | points += 2; | - | ||||||||||||
| 434 | } | - | ||||||||||||
| 435 | if (path.hasImplicitClose()) | - | ||||||||||||
| 436 | d->activeStroker->lineTo(path.points()[0], path.points()[1]); | - | ||||||||||||
| 437 | } | - | ||||||||||||
| 438 | d->activeStroker->end(); | - | ||||||||||||
| 439 | - | |||||||||||||
| 440 | if (!d->strokeHandler->types.size()) | - | ||||||||||||
| 441 | return; | - | ||||||||||||
| 442 | - | |||||||||||||
| 443 | QVectorPath strokePath(d->strokeHandler->pts.data(), | - | ||||||||||||
| 444 | d->strokeHandler->types.size(), | - | ||||||||||||
| 445 | d->strokeHandler->types.data(), | - | ||||||||||||
| 446 | flags); | - | ||||||||||||
| 447 | fill(strokePath, pen.brush()); | - | ||||||||||||
| 448 | } else { | - | ||||||||||||
| 449 | - | |||||||||||||
| 450 | if (state()->matrix.type() >= QTransform::TxProject) { | - | ||||||||||||
| 451 | QPainterPath painterPath = state()->matrix.map(path.convertToPainterPath()); | - | ||||||||||||
| 452 | d->activeStroker->strokePath(painterPath, d->strokeHandler, QTransform()); | - | ||||||||||||
| 453 | } else { | - | ||||||||||||
| 454 | d->activeStroker->setCurveThresholdFromTransform(QTransform()); | - | ||||||||||||
| 455 | d->activeStroker->begin(d->strokeHandler); | - | ||||||||||||
| 456 | if (types) { | - | ||||||||||||
| 457 | while (points < lastPoint) { | - | ||||||||||||
| 458 | switch (*types) { | - | ||||||||||||
| 459 | case QPainterPath::MoveToElement: { | - | ||||||||||||
| 460 | QPointF pt = (*(const QPointF *) points) * state()->matrix; | - | ||||||||||||
| 461 | d->activeStroker->moveTo(pt.x(), pt.y()); | - | ||||||||||||
| 462 | points += 2; | - | ||||||||||||
| 463 | ++types; | - | ||||||||||||
| 464 | break; | - | ||||||||||||
| 465 | } | - | ||||||||||||
| 466 | case QPainterPath::LineToElement: { | - | ||||||||||||
| 467 | QPointF pt = (*(const QPointF *) points) * state()->matrix; | - | ||||||||||||
| 468 | d->activeStroker->lineTo(pt.x(), pt.y()); | - | ||||||||||||
| 469 | points += 2; | - | ||||||||||||
| 470 | ++types; | - | ||||||||||||
| 471 | break; | - | ||||||||||||
| 472 | } | - | ||||||||||||
| 473 | case QPainterPath::CurveToElement: { | - | ||||||||||||
| 474 | QPointF c1 = ((const QPointF *) points)[0] * state()->matrix; | - | ||||||||||||
| 475 | QPointF c2 = ((const QPointF *) points)[1] * state()->matrix; | - | ||||||||||||
| 476 | QPointF e = ((const QPointF *) points)[2] * state()->matrix; | - | ||||||||||||
| 477 | d->activeStroker->cubicTo(c1.x(), c1.y(), c2.x(), c2.y(), e.x(), e.y()); | - | ||||||||||||
| 478 | points += 6; | - | ||||||||||||
| 479 | types += 3; | - | ||||||||||||
| 480 | flags |= QVectorPath::CurvedShapeMask; | - | ||||||||||||
| 481 | break; | - | ||||||||||||
| 482 | } | - | ||||||||||||
| 483 | default: | - | ||||||||||||
| 484 | break; | - | ||||||||||||
| 485 | } | - | ||||||||||||
| 486 | } | - | ||||||||||||
| 487 | if (path.hasImplicitClose()) { | - | ||||||||||||
| 488 | QPointF pt = * ((const QPointF *) path.points()) * state()->matrix; | - | ||||||||||||
| 489 | d->activeStroker->lineTo(pt.x(), pt.y()); | - | ||||||||||||
| 490 | } | - | ||||||||||||
| 491 | - | |||||||||||||
| 492 | } else { | - | ||||||||||||
| 493 | QPointF p = ((const QPointF *)points)[0] * state()->matrix; | - | ||||||||||||
| 494 | d->activeStroker->moveTo(p.x(), p.y()); | - | ||||||||||||
| 495 | points += 2; | - | ||||||||||||
| 496 | while (points < lastPoint) { | - | ||||||||||||
| 497 | QPointF p = ((const QPointF *)points)[0] * state()->matrix; | - | ||||||||||||
| 498 | d->activeStroker->lineTo(p.x(), p.y()); | - | ||||||||||||
| 499 | points += 2; | - | ||||||||||||
| 500 | } | - | ||||||||||||
| 501 | if (path.hasImplicitClose()) | - | ||||||||||||
| 502 | d->activeStroker->lineTo(p.x(), p.y()); | - | ||||||||||||
| 503 | } | - | ||||||||||||
| 504 | d->activeStroker->end(); | - | ||||||||||||
| 505 | } | - | ||||||||||||
| 506 | - | |||||||||||||
| 507 | QVectorPath strokePath(d->strokeHandler->pts.data(), | - | ||||||||||||
| 508 | d->strokeHandler->types.size(), | - | ||||||||||||
| 509 | d->strokeHandler->types.data(), | - | ||||||||||||
| 510 | flags); | - | ||||||||||||
| 511 | - | |||||||||||||
| 512 | QTransform xform = state()->matrix; | - | ||||||||||||
| 513 | state()->matrix = QTransform(); | - | ||||||||||||
| 514 | transformChanged(); | - | ||||||||||||
| 515 | - | |||||||||||||
| 516 | QBrush brush = pen.brush(); | - | ||||||||||||
| 517 | if (qbrush_style(brush) != Qt::SolidPattern) | - | ||||||||||||
| 518 | brush.setTransform(brush.transform() * xform); | - | ||||||||||||
| 519 | - | |||||||||||||
| 520 | fill(strokePath, brush); | - | ||||||||||||
| 521 | - | |||||||||||||
| 522 | state()->matrix = xform; | - | ||||||||||||
| 523 | transformChanged(); | - | ||||||||||||
| 524 | } | - | ||||||||||||
| 525 | } | - | ||||||||||||
| 526 | - | |||||||||||||
| 527 | void QPaintEngineEx::draw(const QVectorPath &path) | - | ||||||||||||
| 528 | { | - | ||||||||||||
| 529 | const QBrush &brush = state()->brush; | - | ||||||||||||
| 530 | if (qbrush_style(brush) != Qt::NoBrush) | - | ||||||||||||
| 531 | fill(path, brush); | - | ||||||||||||
| 532 | - | |||||||||||||
| 533 | const QPen &pen = state()->pen; | - | ||||||||||||
| 534 | if (qpen_style(pen) != Qt::NoPen && qbrush_style(qpen_brush(pen)) != Qt::NoBrush) | - | ||||||||||||
| 535 | stroke(path, pen); | - | ||||||||||||
| 536 | } | - | ||||||||||||
| 537 | - | |||||||||||||
| 538 | - | |||||||||||||
| 539 | void QPaintEngineEx::clip(const QRect &r, Qt::ClipOperation op) | - | ||||||||||||
| 540 | { | - | ||||||||||||
| 541 | qreal right = r.x() + r.width(); | - | ||||||||||||
| 542 | qreal bottom = r.y() + r.height(); | - | ||||||||||||
| 543 | qreal pts[] = { qreal(r.x()), qreal(r.y()), | - | ||||||||||||
| 544 | right, qreal(r.y()), | - | ||||||||||||
| 545 | right, bottom, | - | ||||||||||||
| 546 | qreal(r.x()), bottom, | - | ||||||||||||
| 547 | qreal(r.x()), qreal(r.y()) }; | - | ||||||||||||
| 548 | QVectorPath vp(pts, 5, 0, QVectorPath::RectangleHint); | - | ||||||||||||
| 549 | clip(vp, op); | - | ||||||||||||
| 550 | } | - | ||||||||||||
| 551 | - | |||||||||||||
| 552 | void QPaintEngineEx::clip(const QRegion ®ion, Qt::ClipOperation op) | - | ||||||||||||
| 553 | { | - | ||||||||||||
| 554 | if (region.rectCount() == 1) | - | ||||||||||||
| 555 | clip(region.boundingRect(), op); | - | ||||||||||||
| 556 | - | |||||||||||||
| 557 | QVector<QRect> rects = region.rects(); | - | ||||||||||||
| 558 | if (rects.size() <= 32) { | - | ||||||||||||
| 559 | qreal pts[2*32*4]; | - | ||||||||||||
| 560 | int pos = 0; | - | ||||||||||||
| 561 | for (QVector<QRect>::const_iterator i = rects.constBegin(); i != rects.constEnd(); ++i) { | - | ||||||||||||
| 562 | qreal x1 = i->x(); | - | ||||||||||||
| 563 | qreal y1 = i->y(); | - | ||||||||||||
| 564 | qreal x2 = i->x() + i->width(); | - | ||||||||||||
| 565 | qreal y2 = i->y() + i->height(); | - | ||||||||||||
| 566 | - | |||||||||||||
| 567 | pts[pos++] = x1; | - | ||||||||||||
| 568 | pts[pos++] = y1; | - | ||||||||||||
| 569 | - | |||||||||||||
| 570 | pts[pos++] = x2; | - | ||||||||||||
| 571 | pts[pos++] = y1; | - | ||||||||||||
| 572 | - | |||||||||||||
| 573 | pts[pos++] = x2; | - | ||||||||||||
| 574 | pts[pos++] = y2; | - | ||||||||||||
| 575 | - | |||||||||||||
| 576 | pts[pos++] = x1; | - | ||||||||||||
| 577 | pts[pos++] = y2; | - | ||||||||||||
| 578 | } | - | ||||||||||||
| 579 | QVectorPath vp(pts, rects.size() * 4, qpaintengineex_rect4_types_32); | - | ||||||||||||
| 580 | clip(vp, op); | - | ||||||||||||
| 581 | } else { | - | ||||||||||||
| 582 | QVarLengthArray<qreal> pts(rects.size() * 2 * 4); | - | ||||||||||||
| 583 | QVarLengthArray<QPainterPath::ElementType> types(rects.size() * 4); | - | ||||||||||||
| 584 | int ppos = 0; | - | ||||||||||||
| 585 | int tpos = 0; | - | ||||||||||||
| 586 | - | |||||||||||||
| 587 | for (QVector<QRect>::const_iterator i = rects.constBegin(); i != rects.constEnd(); ++i) { | - | ||||||||||||
| 588 | qreal x1 = i->x(); | - | ||||||||||||
| 589 | qreal y1 = i->y(); | - | ||||||||||||
| 590 | qreal x2 = i->x() + i->width(); | - | ||||||||||||
| 591 | qreal y2 = i->y() + i->height(); | - | ||||||||||||
| 592 | - | |||||||||||||
| 593 | pts[ppos++] = x1; | - | ||||||||||||
| 594 | pts[ppos++] = y1; | - | ||||||||||||
| 595 | - | |||||||||||||
| 596 | pts[ppos++] = x2; | - | ||||||||||||
| 597 | pts[ppos++] = y1; | - | ||||||||||||
| 598 | - | |||||||||||||
| 599 | pts[ppos++] = x2; | - | ||||||||||||
| 600 | pts[ppos++] = y2; | - | ||||||||||||
| 601 | - | |||||||||||||
| 602 | pts[ppos++] = x1; | - | ||||||||||||
| 603 | pts[ppos++] = y2; | - | ||||||||||||
| 604 | - | |||||||||||||
| 605 | types[tpos++] = QPainterPath::MoveToElement; | - | ||||||||||||
| 606 | types[tpos++] = QPainterPath::LineToElement; | - | ||||||||||||
| 607 | types[tpos++] = QPainterPath::LineToElement; | - | ||||||||||||
| 608 | types[tpos++] = QPainterPath::LineToElement; | - | ||||||||||||
| 609 | } | - | ||||||||||||
| 610 | - | |||||||||||||
| 611 | QVectorPath vp(pts.data(), rects.size() * 4, types.data()); | - | ||||||||||||
| 612 | clip(vp, op); | - | ||||||||||||
| 613 | } | - | ||||||||||||
| 614 | - | |||||||||||||
| 615 | } | - | ||||||||||||
| 616 | - | |||||||||||||
| 617 | void QPaintEngineEx::clip(const QPainterPath &path, Qt::ClipOperation op) | - | ||||||||||||
| 618 | { | - | ||||||||||||
| 619 | if (path.isEmpty()) { | - | ||||||||||||
| 620 | QVectorPath vp(0, 0); | - | ||||||||||||
| 621 | clip(vp, op); | - | ||||||||||||
| 622 | } else { | - | ||||||||||||
| 623 | clip(qtVectorPathForPath(path), op); | - | ||||||||||||
| 624 | } | - | ||||||||||||
| 625 | } | - | ||||||||||||
| 626 | - | |||||||||||||
| 627 | void QPaintEngineEx::fillRect(const QRectF &r, const QBrush &brush) | - | ||||||||||||
| 628 | { | - | ||||||||||||
| 629 | qreal pts[] = { r.x(), r.y(), r.x() + r.width(), r.y(), | - | ||||||||||||
| 630 | r.x() + r.width(), r.y() + r.height(), r.x(), r.y() + r.height() }; | - | ||||||||||||
| 631 | QVectorPath vp(pts, 4, 0, QVectorPath::RectangleHint); | - | ||||||||||||
| 632 | fill(vp, brush); | - | ||||||||||||
| 633 | } | - | ||||||||||||
| 634 | - | |||||||||||||
| 635 | void QPaintEngineEx::fillRect(const QRectF &r, const QColor &color) | - | ||||||||||||
| 636 | { | - | ||||||||||||
| 637 | fillRect(r, QBrush(color)); | - | ||||||||||||
| 638 | } | - | ||||||||||||
| 639 | - | |||||||||||||
| 640 | void QPaintEngineEx::drawRects(const QRect *rects, int rectCount) | - | ||||||||||||
| 641 | { | - | ||||||||||||
| 642 | for (int i=0; i<rectCount; ++i) { | - | ||||||||||||
| 643 | const QRect &r = rects[i]; | - | ||||||||||||
| 644 | - | |||||||||||||
| 645 | qreal right = r.x() + r.width(); | - | ||||||||||||
| 646 | qreal bottom = r.y() + r.height(); | - | ||||||||||||
| 647 | qreal pts[] = { qreal(r.x()), qreal(r.y()), | - | ||||||||||||
| 648 | right, qreal(r.y()), | - | ||||||||||||
| 649 | right, bottom, | - | ||||||||||||
| 650 | qreal(r.x()), bottom, | - | ||||||||||||
| 651 | qreal(r.x()), qreal(r.y()) }; | - | ||||||||||||
| 652 | QVectorPath vp(pts, 5, 0, QVectorPath::RectangleHint); | - | ||||||||||||
| 653 | draw(vp); | - | ||||||||||||
| 654 | } | - | ||||||||||||
| 655 | } | - | ||||||||||||
| 656 | - | |||||||||||||
| 657 | void QPaintEngineEx::drawRects(const QRectF *rects, int rectCount) | - | ||||||||||||
| 658 | { | - | ||||||||||||
| 659 | for (int i=0; i<rectCount; ++i) { | - | ||||||||||||
| 660 | const QRectF &r = rects[i]; | - | ||||||||||||
| 661 | qreal right = r.x() + r.width(); | - | ||||||||||||
| 662 | qreal bottom = r.y() + r.height(); | - | ||||||||||||
| 663 | qreal pts[] = { r.x(), r.y(), | - | ||||||||||||
| 664 | right, r.y(), | - | ||||||||||||
| 665 | right, bottom, | - | ||||||||||||
| 666 | r.x(), bottom, | - | ||||||||||||
| 667 | r.x(), r.y() }; | - | ||||||||||||
| 668 | QVectorPath vp(pts, 5, 0, QVectorPath::RectangleHint); | - | ||||||||||||
| 669 | draw(vp); | - | ||||||||||||
| 670 | } | - | ||||||||||||
| 671 | } | - | ||||||||||||
| 672 | - | |||||||||||||
| 673 | - | |||||||||||||
| 674 | void QPaintEngineEx::drawRoundedRect(const QRectF &rect, qreal xRadius, qreal yRadius, | - | ||||||||||||
| 675 | Qt::SizeMode mode) | - | ||||||||||||
| 676 | { | - | ||||||||||||
| 677 | qreal x1 = rect.left(); | - | ||||||||||||
| 678 | qreal x2 = rect.right(); | - | ||||||||||||
| 679 | qreal y1 = rect.top(); | - | ||||||||||||
| 680 | qreal y2 = rect.bottom(); | - | ||||||||||||
| 681 | - | |||||||||||||
| 682 | if (mode == Qt::RelativeSize) { | - | ||||||||||||
| 683 | xRadius = xRadius * rect.width() / 200.; | - | ||||||||||||
| 684 | yRadius = yRadius * rect.height() / 200.; | - | ||||||||||||
| 685 | } | - | ||||||||||||
| 686 | - | |||||||||||||
| 687 | xRadius = qMin(xRadius, rect.width() / 2); | - | ||||||||||||
| 688 | yRadius = qMin(yRadius, rect.height() / 2); | - | ||||||||||||
| 689 | - | |||||||||||||
| 690 | qreal pts[] = { | - | ||||||||||||
| 691 | x1 + xRadius, y1, | - | ||||||||||||
| 692 | x2 - xRadius, y1, | - | ||||||||||||
| 693 | x2 - (1 - qreal(0.5522847498)) * xRadius, y1, | - | ||||||||||||
| 694 | x2, y1 + (1 - qreal(0.5522847498)) * yRadius, | - | ||||||||||||
| 695 | x2, y1 + yRadius, | - | ||||||||||||
| 696 | x2, y2 - yRadius, | - | ||||||||||||
| 697 | x2, y2 - (1 - qreal(0.5522847498)) * yRadius, | - | ||||||||||||
| 698 | x2 - (1 - qreal(0.5522847498)) * xRadius, y2, | - | ||||||||||||
| 699 | x2 - xRadius, y2, | - | ||||||||||||
| 700 | x1 + xRadius, y2, | - | ||||||||||||
| 701 | x1 + (1 - qreal(0.5522847498)) * xRadius, y2, | - | ||||||||||||
| 702 | x1, y2 - (1 - qreal(0.5522847498)) * yRadius, | - | ||||||||||||
| 703 | x1, y2 - yRadius, | - | ||||||||||||
| 704 | x1, y1 + yRadius, | - | ||||||||||||
| 705 | x1, y1 + (1 - qreal(0.5522847498)) * yRadius, | - | ||||||||||||
| 706 | x1 + (1 - qreal(0.5522847498)) * xRadius, y1, | - | ||||||||||||
| 707 | x1 + xRadius, y1 | - | ||||||||||||
| 708 | }; | - | ||||||||||||
| 709 | - | |||||||||||||
| 710 | QVectorPath path(pts, 17, qpaintengineex_roundedrect_types, QVectorPath::RoundedRectHint); | - | ||||||||||||
| 711 | draw(path); | - | ||||||||||||
| 712 | } | - | ||||||||||||
| 713 | - | |||||||||||||
| 714 | - | |||||||||||||
| 715 | - | |||||||||||||
| 716 | void QPaintEngineEx::drawLines(const QLine *lines, int lineCount) | - | ||||||||||||
| 717 | { | - | ||||||||||||
| 718 | int elementCount = lineCount << 1; | - | ||||||||||||
| 719 | while (elementCount > 0) { | - | ||||||||||||
| 720 | int count = qMin(elementCount, 32); | - | ||||||||||||
| 721 | - | |||||||||||||
| 722 | qreal pts[64]; | - | ||||||||||||
| 723 | int count2 = count<<1; | - | ||||||||||||
| 724 | for (int i=0; i<count2; ++i) | - | ||||||||||||
| 725 | pts[i] = ((const int *) lines)[i]; | - | ||||||||||||
| 726 | - | |||||||||||||
| 727 | QVectorPath path(pts, count, qpaintengineex_line_types_16, QVectorPath::LinesHint); | - | ||||||||||||
| 728 | stroke(path, state()->pen); | - | ||||||||||||
| 729 | - | |||||||||||||
| 730 | elementCount -= 32; | - | ||||||||||||
| 731 | lines += 16; | - | ||||||||||||
| 732 | } | - | ||||||||||||
| 733 | } | - | ||||||||||||
| 734 | - | |||||||||||||
| 735 | void QPaintEngineEx::drawLines(const QLineF *lines, int lineCount) | - | ||||||||||||
| 736 | { | - | ||||||||||||
| 737 | int elementCount = lineCount << 1; | - | ||||||||||||
| 738 | while (elementCount > 0) { | - | ||||||||||||
| 739 | int count = qMin(elementCount, 32); | - | ||||||||||||
| 740 | - | |||||||||||||
| 741 | QVectorPath path((const qreal *) lines, count, qpaintengineex_line_types_16, | - | ||||||||||||
| 742 | QVectorPath::LinesHint); | - | ||||||||||||
| 743 | stroke(path, state()->pen); | - | ||||||||||||
| 744 | - | |||||||||||||
| 745 | elementCount -= 32; | - | ||||||||||||
| 746 | lines += 16; | - | ||||||||||||
| 747 | } | - | ||||||||||||
| 748 | } | - | ||||||||||||
| 749 | - | |||||||||||||
| 750 | void QPaintEngineEx::drawEllipse(const QRectF &r) | - | ||||||||||||
| 751 | { | - | ||||||||||||
| 752 | qreal pts[26]; | - | ||||||||||||
| 753 | union { | - | ||||||||||||
| 754 | qreal *ptr; | - | ||||||||||||
| 755 | QPointF *points; | - | ||||||||||||
| 756 | } x; | - | ||||||||||||
| 757 | x.ptr = pts; | - | ||||||||||||
| 758 | - | |||||||||||||
| 759 | int point_count = 0; | - | ||||||||||||
| 760 | x.points[0] = qt_curves_for_arc(r, 0, -360, x.points + 1, &point_count); | - | ||||||||||||
| 761 | if (point_count == 0) | - | ||||||||||||
| 762 | return; | - | ||||||||||||
| 763 | QVectorPath vp((qreal *) pts, point_count + 1, qpaintengineex_ellipse_types, QVectorPath::EllipseHint); | - | ||||||||||||
| 764 | draw(vp); | - | ||||||||||||
| 765 | } | - | ||||||||||||
| 766 | - | |||||||||||||
| 767 | void QPaintEngineEx::drawEllipse(const QRect &r) | - | ||||||||||||
| 768 | { | - | ||||||||||||
| 769 | drawEllipse(QRectF(r)); | - | ||||||||||||
| 770 | } | - | ||||||||||||
| 771 | - | |||||||||||||
| 772 | void QPaintEngineEx::drawPath(const QPainterPath &path) | - | ||||||||||||
| 773 | { | - | ||||||||||||
| 774 | if (!path.isEmpty()) | - | ||||||||||||
| 775 | draw(qtVectorPathForPath(path)); | - | ||||||||||||
| 776 | } | - | ||||||||||||
| 777 | - | |||||||||||||
| 778 | - | |||||||||||||
| 779 | void QPaintEngineEx::drawPoints(const QPointF *points, int pointCount) | - | ||||||||||||
| 780 | { | - | ||||||||||||
| 781 | QPen pen = state()->pen; | - | ||||||||||||
| 782 | if (pen.capStyle() == Qt::FlatCap) | - | ||||||||||||
| 783 | pen.setCapStyle(Qt::SquareCap); | - | ||||||||||||
| 784 | - | |||||||||||||
| 785 | if (pen.brush().isOpaque()) { | - | ||||||||||||
| 786 | while (pointCount > 0) { | - | ||||||||||||
| 787 | int count = qMin(pointCount, 16); | - | ||||||||||||
| 788 | qreal pts[64]; | - | ||||||||||||
| 789 | int oset = -1; | - | ||||||||||||
| 790 | for (int i=0; i<count; ++i) { | - | ||||||||||||
| 791 | pts[++oset] = points[i].x(); | - | ||||||||||||
| 792 | pts[++oset] = points[i].y(); | - | ||||||||||||
| 793 | pts[++oset] = points[i].x() + 1/63.; | - | ||||||||||||
| 794 | pts[++oset] = points[i].y(); | - | ||||||||||||
| 795 | } | - | ||||||||||||
| 796 | QVectorPath path(pts, count * 2, qpaintengineex_line_types_16, QVectorPath::LinesHint); | - | ||||||||||||
| 797 | stroke(path, pen); | - | ||||||||||||
| 798 | pointCount -= 16; | - | ||||||||||||
| 799 | points += 16; | - | ||||||||||||
| 800 | } | - | ||||||||||||
| 801 | } else { | - | ||||||||||||
| 802 | for (int i=0; i<pointCount; ++i) { | - | ||||||||||||
| 803 | qreal pts[] = { points[i].x(), points[i].y(), points[i].x() + qreal(1/63.), points[i].y() }; | - | ||||||||||||
| 804 | QVectorPath path(pts, 2, 0); | - | ||||||||||||
| 805 | stroke(path, pen); | - | ||||||||||||
| 806 | } | - | ||||||||||||
| 807 | } | - | ||||||||||||
| 808 | } | - | ||||||||||||
| 809 | - | |||||||||||||
| 810 | void QPaintEngineEx::drawPoints(const QPoint *points, int pointCount) | - | ||||||||||||
| 811 | { | - | ||||||||||||
| 812 | QPen pen = state()->pen; | - | ||||||||||||
| 813 | if (pen.capStyle() == Qt::FlatCap) | - | ||||||||||||
| 814 | pen.setCapStyle(Qt::SquareCap); | - | ||||||||||||
| 815 | - | |||||||||||||
| 816 | if (pen.brush().isOpaque()) { | - | ||||||||||||
| 817 | while (pointCount > 0) { | - | ||||||||||||
| 818 | int count = qMin(pointCount, 16); | - | ||||||||||||
| 819 | qreal pts[64]; | - | ||||||||||||
| 820 | int oset = -1; | - | ||||||||||||
| 821 | for (int i=0; i<count; ++i) { | - | ||||||||||||
| 822 | pts[++oset] = points[i].x(); | - | ||||||||||||
| 823 | pts[++oset] = points[i].y(); | - | ||||||||||||
| 824 | pts[++oset] = points[i].x() + 1/63.; | - | ||||||||||||
| 825 | pts[++oset] = points[i].y(); | - | ||||||||||||
| 826 | } | - | ||||||||||||
| 827 | QVectorPath path(pts, count * 2, qpaintengineex_line_types_16, QVectorPath::LinesHint); | - | ||||||||||||
| 828 | stroke(path, pen); | - | ||||||||||||
| 829 | pointCount -= 16; | - | ||||||||||||
| 830 | points += 16; | - | ||||||||||||
| 831 | } | - | ||||||||||||
| 832 | } else { | - | ||||||||||||
| 833 | for (int i=0; i<pointCount; ++i) { | - | ||||||||||||
| 834 | qreal pts[] = { qreal(points[i].x()), qreal(points[i].y()), | - | ||||||||||||
| 835 | qreal(points[i].x() +1/63.), qreal(points[i].y()) }; | - | ||||||||||||
| 836 | QVectorPath path(pts, 2, 0); | - | ||||||||||||
| 837 | stroke(path, pen); | - | ||||||||||||
| 838 | } | - | ||||||||||||
| 839 | } | - | ||||||||||||
| 840 | } | - | ||||||||||||
| 841 | - | |||||||||||||
| 842 | - | |||||||||||||
| 843 | void QPaintEngineEx::drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) | - | ||||||||||||
| 844 | { | - | ||||||||||||
| 845 | QVectorPath path((const qreal *) points, pointCount, 0, QVectorPath::polygonFlags(mode)); | - | ||||||||||||
| 846 | - | |||||||||||||
| 847 | if (mode == PolylineMode) | - | ||||||||||||
| 848 | stroke(path, state()->pen); | - | ||||||||||||
| 849 | else | - | ||||||||||||
| 850 | draw(path); | - | ||||||||||||
| 851 | } | - | ||||||||||||
| 852 | - | |||||||||||||
| 853 | void QPaintEngineEx::drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) | - | ||||||||||||
| 854 | { | - | ||||||||||||
| 855 | int count = pointCount<<1; | - | ||||||||||||
| 856 | QVarLengthArray<qreal> pts(count); | - | ||||||||||||
| 857 | - | |||||||||||||
| 858 | for (int i=0; i<count; ++i) | - | ||||||||||||
| 859 | pts[i] = ((const int *) points)[i]; | - | ||||||||||||
| 860 | - | |||||||||||||
| 861 | QVectorPath path(pts.data(), pointCount, 0, QVectorPath::polygonFlags(mode)); | - | ||||||||||||
| 862 | - | |||||||||||||
| 863 | if (mode == PolylineMode) | - | ||||||||||||
| 864 | stroke(path, state()->pen); | - | ||||||||||||
| 865 | else | - | ||||||||||||
| 866 | draw(path); | - | ||||||||||||
| 867 | - | |||||||||||||
| 868 | } | - | ||||||||||||
| 869 | - | |||||||||||||
| 870 | void QPaintEngineEx::drawPixmap(const QPointF &pos, const QPixmap &pm) | - | ||||||||||||
| 871 | { | - | ||||||||||||
| 872 | drawPixmap(QRectF(pos, pm.size() / pm.devicePixelRatio()), pm, pm.rect()); | - | ||||||||||||
| 873 | } | - | ||||||||||||
| 874 | - | |||||||||||||
| 875 | void QPaintEngineEx::drawImage(const QPointF &pos, const QImage &image) | - | ||||||||||||
| 876 | { | - | ||||||||||||
| 877 | drawImage(QRectF(pos, image.size() / image.devicePixelRatio()), image, image.rect()); | - | ||||||||||||
| 878 | } | - | ||||||||||||
| 879 | - | |||||||||||||
| 880 | void QPaintEngineEx::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) | - | ||||||||||||
| 881 | { | - | ||||||||||||
| 882 | QBrush brush(state()->pen.color(), pixmap); | - | ||||||||||||
| 883 | QTransform xform = QTransform::fromTranslate(r.x() - s.x(), r.y() - s.y()); | - | ||||||||||||
| 884 | brush.setTransform(xform); | - | ||||||||||||
| 885 | - | |||||||||||||
| 886 | qreal pts[] = { r.x(), r.y(), | - | ||||||||||||
| 887 | r.x() + r.width(), r.y(), | - | ||||||||||||
| 888 | r.x() + r.width(), r.y() + r.height(), | - | ||||||||||||
| 889 | r.x(), r.y() + r.height() }; | - | ||||||||||||
| 890 | - | |||||||||||||
| 891 | QVectorPath path(pts, 4, 0, QVectorPath::RectangleHint); | - | ||||||||||||
| 892 | fill(path, brush); | - | ||||||||||||
| 893 | } | - | ||||||||||||
| 894 | - | |||||||||||||
| 895 | void QPaintEngineEx::drawPixmapFragments(const QPainter::PixmapFragment *fragments, int fragmentCount, | - | ||||||||||||
| 896 | const QPixmap &pixmap, QPainter::PixmapFragmentHints ) | - | ||||||||||||
| 897 | { | - | ||||||||||||
| 898 | if (pixmap.isNull()) | - | ||||||||||||
| 899 | return; | - | ||||||||||||
| 900 | - | |||||||||||||
| 901 | qreal oldOpacity = state()->opacity; | - | ||||||||||||
| 902 | QTransform oldTransform = state()->matrix; | - | ||||||||||||
| 903 | - | |||||||||||||
| 904 | for (int i = 0; i < fragmentCount; ++i) { | - | ||||||||||||
| 905 | QTransform transform = oldTransform; | - | ||||||||||||
| 906 | transform.translate(fragments[i].x, fragments[i].y); | - | ||||||||||||
| 907 | transform.rotate(fragments[i].rotation); | - | ||||||||||||
| 908 | state()->opacity = oldOpacity * fragments[i].opacity; | - | ||||||||||||
| 909 | state()->matrix = transform; | - | ||||||||||||
| 910 | opacityChanged(); | - | ||||||||||||
| 911 | transformChanged(); | - | ||||||||||||
| 912 | - | |||||||||||||
| 913 | qreal w = fragments[i].scaleX * fragments[i].width; | - | ||||||||||||
| 914 | qreal h = fragments[i].scaleY * fragments[i].height; | - | ||||||||||||
| 915 | QRectF sourceRect(fragments[i].sourceLeft, fragments[i].sourceTop, | - | ||||||||||||
| 916 | fragments[i].width, fragments[i].height); | - | ||||||||||||
| 917 | drawPixmap(QRectF(-0.5 * w, -0.5 * h, w, h), pixmap, sourceRect); | - | ||||||||||||
| 918 | } | - | ||||||||||||
| 919 | - | |||||||||||||
| 920 | state()->opacity = oldOpacity; | - | ||||||||||||
| 921 | state()->matrix = oldTransform; | - | ||||||||||||
| 922 | opacityChanged(); | - | ||||||||||||
| 923 | transformChanged(); | - | ||||||||||||
| 924 | } | - | ||||||||||||
| 925 | - | |||||||||||||
| 926 | void QPaintEngineEx::setState(QPainterState *s) | - | ||||||||||||
| 927 | { | - | ||||||||||||
| 928 | QPaintEngine::state = s; | - | ||||||||||||
| 929 | } | - | ||||||||||||
| 930 | - | |||||||||||||
| 931 | - | |||||||||||||
| 932 | void QPaintEngineEx::updateState(const QPaintEngineState &) | - | ||||||||||||
| 933 | { | - | ||||||||||||
| 934 | - | |||||||||||||
| 935 | } | - | ||||||||||||
| 936 | - | |||||||||||||
| 937 | __attribute__((visibility("default"))) QPainterPath qt_painterPathFromVectorPath(const QVectorPath &path) | - | ||||||||||||
| 938 | { | - | ||||||||||||
| 939 | const qreal *points = path.points(); | - | ||||||||||||
| 940 | const QPainterPath::ElementType *types = path.elements(); | - | ||||||||||||
| 941 | - | |||||||||||||
| 942 | QPainterPath p; | - | ||||||||||||
| 943 | if (types) { | - | ||||||||||||
| 944 | int id = 0; | - | ||||||||||||
| 945 | for (int i=0; i<path.elementCount(); ++i) { | - | ||||||||||||
| 946 | switch(types[i]) { | - | ||||||||||||
| 947 | case QPainterPath::MoveToElement: | - | ||||||||||||
| 948 | p.moveTo(QPointF(points[id], points[id+1])); | - | ||||||||||||
| 949 | id+=2; | - | ||||||||||||
| 950 | break; | - | ||||||||||||
| 951 | case QPainterPath::LineToElement: | - | ||||||||||||
| 952 | p.lineTo(QPointF(points[id], points[id+1])); | - | ||||||||||||
| 953 | id+=2; | - | ||||||||||||
| 954 | break; | - | ||||||||||||
| 955 | case QPainterPath::CurveToElement: { | - | ||||||||||||
| 956 | QPointF p1(points[id], points[id+1]); | - | ||||||||||||
| 957 | QPointF p2(points[id+2], points[id+3]); | - | ||||||||||||
| 958 | QPointF p3(points[id+4], points[id+5]); | - | ||||||||||||
| 959 | p.cubicTo(p1, p2, p3); | - | ||||||||||||
| 960 | id+=6; | - | ||||||||||||
| 961 | break; | - | ||||||||||||
| 962 | } | - | ||||||||||||
| 963 | case QPainterPath::CurveToDataElement: | - | ||||||||||||
| 964 | ; | - | ||||||||||||
| 965 | break; | - | ||||||||||||
| 966 | } | - | ||||||||||||
| 967 | } | - | ||||||||||||
| 968 | } else { | - | ||||||||||||
| 969 | p.moveTo(QPointF(points[0], points[1])); | - | ||||||||||||
| 970 | int id = 2; | - | ||||||||||||
| 971 | for (int i=1; i<path.elementCount(); ++i) { | - | ||||||||||||
| 972 | p.lineTo(QPointF(points[id], points[id+1])); | - | ||||||||||||
| 973 | id+=2; | - | ||||||||||||
| 974 | } | - | ||||||||||||
| 975 | } | - | ||||||||||||
| 976 | if (path.hints() & QVectorPath::WindingFill) | - | ||||||||||||
| 977 | p.setFillRule(Qt::WindingFill); | - | ||||||||||||
| 978 | - | |||||||||||||
| 979 | return p; | - | ||||||||||||
| 980 | } | - | ||||||||||||
| 981 | - | |||||||||||||
| 982 | void QPaintEngineEx::drawStaticTextItem(QStaticTextItem *staticTextItem) | - | ||||||||||||
| 983 | { | - | ||||||||||||
| 984 | QPainterPath path; | - | ||||||||||||
| 985 | path.setFillRule(Qt::WindingFill); | - | ||||||||||||
| 986 | - | |||||||||||||
| 987 | if (staticTextItem->numGlyphs == 0) | - | ||||||||||||
| 988 | return; | - | ||||||||||||
| 989 | - | |||||||||||||
| 990 | QFontEngine *fontEngine = staticTextItem->fontEngine(); | - | ||||||||||||
| 991 | fontEngine->addGlyphsToPath(staticTextItem->glyphs, staticTextItem->glyphPositions, | - | ||||||||||||
| 992 | staticTextItem->numGlyphs, &path, 0); | - | ||||||||||||
| 993 | if (!path.isEmpty()) { | - | ||||||||||||
| 994 | QPainterState *s = state(); | - | ||||||||||||
| 995 | QPainter::RenderHints oldHints = s->renderHints; | - | ||||||||||||
| 996 | bool changedHints = false; | - | ||||||||||||
| 997 | if (bool(oldHints & QPainter::TextAntialiasing) | - | ||||||||||||
| 998 | && !bool(fontEngine->fontDef.styleStrategy & QFont::NoAntialias) | - | ||||||||||||
| 999 | && !bool(oldHints & QPainter::Antialiasing)) { | - | ||||||||||||
| 1000 | s->renderHints |= QPainter::Antialiasing; | - | ||||||||||||
| 1001 | renderHintsChanged(); | - | ||||||||||||
| 1002 | changedHints = true; | - | ||||||||||||
| 1003 | } | - | ||||||||||||
| 1004 | - | |||||||||||||
| 1005 | fill(qtVectorPathForPath(path), s->pen.brush()); | - | ||||||||||||
| 1006 | - | |||||||||||||
| 1007 | if (changedHints) { | - | ||||||||||||
| 1008 | s->renderHints = oldHints; | - | ||||||||||||
| 1009 | renderHintsChanged(); | - | ||||||||||||
| 1010 | } | - | ||||||||||||
| 1011 | } | - | ||||||||||||
| 1012 | } | - | ||||||||||||
| 1013 | - | |||||||||||||
| 1014 | bool QPaintEngineEx::requiresPretransformedGlyphPositions(QFontEngine *, const QTransform &) const | - | ||||||||||||
| 1015 | { | - | ||||||||||||
| 1016 | return false; | - | ||||||||||||
| 1017 | } | - | ||||||||||||
| 1018 | - | |||||||||||||
| 1019 | bool QPaintEngineEx::shouldDrawCachedGlyphs(QFontEngine *fontEngine, const QTransform &m) const | - | ||||||||||||
| 1020 | { | - | ||||||||||||
| 1021 | if (fontEngine->glyphFormat == QFontEngine::Format_ARGB) | - | ||||||||||||
| 1022 | return true; | - | ||||||||||||
| 1023 | - | |||||||||||||
| 1024 | qreal pixelSize = fontEngine->fontDef.pixelSize; | - | ||||||||||||
| 1025 | return (pixelSize * pixelSize * qAbs(m.determinant())) < | - | ||||||||||||
| 1026 | 64 * 64; | - | ||||||||||||
| 1027 | } | - | ||||||||||||
| 1028 | - | |||||||||||||
| 1029 | - | |||||||||||||
| Switch to Source code | Preprocessed file |