| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/image/qpaintengine_pic.cpp | 
| Switch to Source code | Preprocessed file | 
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | - | |||||||||||||
| 5 | - | |||||||||||||
| 6 | - | |||||||||||||
| 7 | - | |||||||||||||
| 8 | - | |||||||||||||
| 9 | - | |||||||||||||
| 10 | class QPicturePaintEnginePrivate : public QPaintEnginePrivate | - | ||||||||||||
| 11 | { | - | ||||||||||||
| 12 | inline QPicturePaintEngine* q_func() { return static_cast<QPicturePaintEngine *>(q_ptr); } inline const QPicturePaintEngine* q_func() const { return static_cast<const QPicturePaintEngine *>(q_ptr); } friend class QPicturePaintEngine; | - | ||||||||||||
| 13 | public: | - | ||||||||||||
| 14 | QDataStream s; | - | ||||||||||||
| 15 | QPainter *pt; | - | ||||||||||||
| 16 | QPicturePrivate *pic_d; | - | ||||||||||||
| 17 | }; | - | ||||||||||||
| 18 | - | |||||||||||||
| 19 | QPicturePaintEngine::QPicturePaintEngine() | - | ||||||||||||
| 20 | : QPaintEngine(*(new QPicturePaintEnginePrivate), AllFeatures) | - | ||||||||||||
| 21 | { | - | ||||||||||||
| 22 | QPicturePaintEnginePrivate * const d = d_func(); | - | ||||||||||||
| 23 | d->pt = 0; | - | ||||||||||||
| 24 | } never executed:  end of block | 0 | ||||||||||||
| 25 | - | |||||||||||||
| 26 | QPicturePaintEngine::QPicturePaintEngine(QPaintEnginePrivate &dptr) | - | ||||||||||||
| 27 | : QPaintEngine(dptr, AllFeatures) | - | ||||||||||||
| 28 | { | - | ||||||||||||
| 29 | QPicturePaintEnginePrivate * const d = d_func(); | - | ||||||||||||
| 30 | d->pt = 0; | - | ||||||||||||
| 31 | } never executed:  end of block | 0 | ||||||||||||
| 32 | - | |||||||||||||
| 33 | QPicturePaintEngine::~QPicturePaintEngine() | - | ||||||||||||
| 34 | { | - | ||||||||||||
| 35 | } | - | ||||||||||||
| 36 | - | |||||||||||||
| 37 | bool QPicturePaintEngine::begin(QPaintDevice *pd) | - | ||||||||||||
| 38 | { | - | ||||||||||||
| 39 | QPicturePaintEnginePrivate * const d = d_func(); | - | ||||||||||||
| 40 | - | |||||||||||||
| 41 | - | |||||||||||||
| 42 | - | |||||||||||||
| 43 | ((!(pd)) ? qt_assert("pd",__FILE__,90) : qt_noop()); | - | ||||||||||||
| 44 | QPicture *pic = static_cast<QPicture *>(pd); | - | ||||||||||||
| 45 | - | |||||||||||||
| 46 | d->pdev = pd; | - | ||||||||||||
| 47 | d->pic_d = pic->d_func(); | - | ||||||||||||
| 48 | ((!(d->pic_d)) ? qt_assert("d->pic_d",__FILE__,95) : qt_noop()); | - | ||||||||||||
| 49 | - | |||||||||||||
| 50 | d->s.setDevice(&d->pic_d->pictb); | - | ||||||||||||
| 51 | d->s.setVersion(d->pic_d->formatMajor); | - | ||||||||||||
| 52 | - | |||||||||||||
| 53 | d->pic_d->pictb.open(QIODevice::WriteOnly | QIODevice::Truncate); | - | ||||||||||||
| 54 | d->s.writeRawData(qt_mfhdr_tag, 4); | - | ||||||||||||
| 55 | d->s << (quint16) 0 << (quint16) d->pic_d->formatMajor << (quint16) d->pic_d->formatMinor; | - | ||||||||||||
| 56 | d->s << (quint8) QPicturePrivate::PdcBegin << (quint8) sizeof(qint32); | - | ||||||||||||
| 57 | d->pic_d->brect = QRect(); | - | ||||||||||||
| 58 |     if (d->pic_d->formatMajor >= 4
  | 0 | ||||||||||||
| 59 | QRect r = pic->boundingRect(); | - | ||||||||||||
| 60 | d->s << (qint32) r.left() << (qint32) r.top() << (qint32) r.width() | - | ||||||||||||
| 61 | << (qint32) r.height(); | - | ||||||||||||
| 62 |     } never executed:  end of block | 0 | ||||||||||||
| 63 | d->pic_d->trecs = 0; | - | ||||||||||||
| 64 | d->s << (quint32)d->pic_d->trecs; | - | ||||||||||||
| 65 | d->pic_d->formatOk = false; | - | ||||||||||||
| 66 | setActive(true); | - | ||||||||||||
| 67 |     return never executed:   true;return true;never executed:  return true; | 0 | ||||||||||||
| 68 | } | - | ||||||||||||
| 69 | - | |||||||||||||
| 70 | bool QPicturePaintEngine::end() | - | ||||||||||||
| 71 | { | - | ||||||||||||
| 72 | QPicturePaintEnginePrivate * const d = d_func(); | - | ||||||||||||
| 73 | - | |||||||||||||
| 74 | - | |||||||||||||
| 75 | - | |||||||||||||
| 76 | d->pic_d->trecs++; | - | ||||||||||||
| 77 | d->s << (quint8) QPicturePrivate::PdcEnd << (quint8) 0; | - | ||||||||||||
| 78 | int cs_start = sizeof(quint32); | - | ||||||||||||
| 79 | int data_start = cs_start + sizeof(quint16); | - | ||||||||||||
| 80 | int brect_start = data_start + 2*sizeof(qint16) + 2*sizeof(quint8); | - | ||||||||||||
| 81 | int pos = d->pic_d->pictb.pos(); | - | ||||||||||||
| 82 | d->pic_d->pictb.seek(brect_start); | - | ||||||||||||
| 83 |     if (d->pic_d->formatMajor >= 4
  | 0 | ||||||||||||
| 84 | QRect r = static_cast<QPicture *>(d->pdev)->boundingRect(); | - | ||||||||||||
| 85 | d->s << (qint32) r.left() << (qint32) r.top() << (qint32) r.width() | - | ||||||||||||
| 86 | << (qint32) r.height(); | - | ||||||||||||
| 87 |     } never executed:  end of block | 0 | ||||||||||||
| 88 | d->s << (quint32) d->pic_d->trecs; | - | ||||||||||||
| 89 | d->pic_d->pictb.seek(cs_start); | - | ||||||||||||
| 90 | QByteArray buf = d->pic_d->pictb.buffer(); | - | ||||||||||||
| 91 | quint16 cs = (quint16) qChecksum(buf.constData() + data_start, pos - data_start); | - | ||||||||||||
| 92 | d->s << cs; | - | ||||||||||||
| 93 | d->pic_d->pictb.close(); | - | ||||||||||||
| 94 | setActive(false); | - | ||||||||||||
| 95 |     return never executed:   true;return true;never executed:  return true; | 0 | ||||||||||||
| 96 | } | - | ||||||||||||
| 97 | - | |||||||||||||
| 98 | - | |||||||||||||
| 99 | - | |||||||||||||
| 100 | - | |||||||||||||
| 101 | - | |||||||||||||
| 102 | - | |||||||||||||
| 103 | - | |||||||||||||
| 104 | void QPicturePaintEngine::updatePen(const QPen &pen) | - | ||||||||||||
| 105 | { | - | ||||||||||||
| 106 | QPicturePaintEnginePrivate * const d = d_func(); | - | ||||||||||||
| 107 | - | |||||||||||||
| 108 | - | |||||||||||||
| 109 | - | |||||||||||||
| 110 | - | |||||||||||||
| 111 | int pos; | - | ||||||||||||
| 112 | d->pic_d->trecs++; d->s << (quint8) QPicturePrivate::PdcSetPen; d->s << (quint8) 0; pos = d->pic_d->pictb.pos(); | - | ||||||||||||
| 113 |     if (d->pic_d->in_memory_only
  | 0 | ||||||||||||
| 114 | int index = d->pic_d->pen_list.size(); | - | ||||||||||||
| 115 | d->pic_d->pen_list.append(pen); | - | ||||||||||||
| 116 | d->s << index; | - | ||||||||||||
| 117 |     } never executed:   else {end of block | 0 | ||||||||||||
| 118 | d->s << pen; | - | ||||||||||||
| 119 |     } never executed:  end of block | 0 | ||||||||||||
| 120 | writeCmdLength(pos, QRect(), false); | - | ||||||||||||
| 121 | } never executed:  end of block | 0 | ||||||||||||
| 122 | - | |||||||||||||
| 123 | void QPicturePaintEngine::updateCompositionMode(QPainter::CompositionMode cmode) | - | ||||||||||||
| 124 | { | - | ||||||||||||
| 125 | QPicturePaintEnginePrivate * const d = d_func(); | - | ||||||||||||
| 126 | - | |||||||||||||
| 127 | - | |||||||||||||
| 128 | - | |||||||||||||
| 129 | int pos; | - | ||||||||||||
| 130 | d->pic_d->trecs++; d->s << (quint8) QPicturePrivate::PdcSetCompositionMode; d->s << (quint8) 0; pos = d->pic_d->pictb.pos(); | - | ||||||||||||
| 131 | d->s << (qint32)cmode; | - | ||||||||||||
| 132 | writeCmdLength(pos, QRectF(), false); | - | ||||||||||||
| 133 | } never executed:  end of block | 0 | ||||||||||||
| 134 | - | |||||||||||||
| 135 | void QPicturePaintEngine::updateClipEnabled(bool enabled) | - | ||||||||||||
| 136 | { | - | ||||||||||||
| 137 | QPicturePaintEnginePrivate * const d = d_func(); | - | ||||||||||||
| 138 | - | |||||||||||||
| 139 | - | |||||||||||||
| 140 | - | |||||||||||||
| 141 | int pos; | - | ||||||||||||
| 142 | d->pic_d->trecs++; d->s << (quint8) QPicturePrivate::PdcSetClipEnabled; d->s << (quint8) 0; pos = d->pic_d->pictb.pos(); | - | ||||||||||||
| 143 | d->s << enabled; | - | ||||||||||||
| 144 | writeCmdLength(pos, QRectF(), false); | - | ||||||||||||
| 145 | } never executed:  end of block | 0 | ||||||||||||
| 146 | - | |||||||||||||
| 147 | void QPicturePaintEngine::updateOpacity(qreal opacity) | - | ||||||||||||
| 148 | { | - | ||||||||||||
| 149 | QPicturePaintEnginePrivate * const d = d_func(); | - | ||||||||||||
| 150 | - | |||||||||||||
| 151 | - | |||||||||||||
| 152 | - | |||||||||||||
| 153 | int pos; | - | ||||||||||||
| 154 | d->pic_d->trecs++; d->s << (quint8) QPicturePrivate::PdcSetOpacity; d->s << (quint8) 0; pos = d->pic_d->pictb.pos(); | - | ||||||||||||
| 155 | d->s << double(opacity); | - | ||||||||||||
| 156 | writeCmdLength(pos, QRectF(), false); | - | ||||||||||||
| 157 | } never executed:  end of block | 0 | ||||||||||||
| 158 | - | |||||||||||||
| 159 | void QPicturePaintEngine::updateBrush(const QBrush &brush) | - | ||||||||||||
| 160 | { | - | ||||||||||||
| 161 | QPicturePaintEnginePrivate * const d = d_func(); | - | ||||||||||||
| 162 | - | |||||||||||||
| 163 | - | |||||||||||||
| 164 | - | |||||||||||||
| 165 | int pos; | - | ||||||||||||
| 166 | d->pic_d->trecs++; d->s << (quint8) QPicturePrivate::PdcSetBrush; d->s << (quint8) 0; pos = d->pic_d->pictb.pos(); | - | ||||||||||||
| 167 |     if (d->pic_d->in_memory_only
  | 0 | ||||||||||||
| 168 | int index = d->pic_d->brush_list.size(); | - | ||||||||||||
| 169 | d->pic_d->brush_list.append(brush); | - | ||||||||||||
| 170 | d->s << index; | - | ||||||||||||
| 171 |     } never executed:   else {end of block | 0 | ||||||||||||
| 172 | d->s << brush; | - | ||||||||||||
| 173 |     } never executed:  end of block | 0 | ||||||||||||
| 174 | writeCmdLength(pos, QRect(), false); | - | ||||||||||||
| 175 | } never executed:  end of block | 0 | ||||||||||||
| 176 | - | |||||||||||||
| 177 | void QPicturePaintEngine::updateBrushOrigin(const QPointF &p) | - | ||||||||||||
| 178 | { | - | ||||||||||||
| 179 | QPicturePaintEnginePrivate * const d = d_func(); | - | ||||||||||||
| 180 | - | |||||||||||||
| 181 | - | |||||||||||||
| 182 | - | |||||||||||||
| 183 | int pos; | - | ||||||||||||
| 184 | d->pic_d->trecs++; d->s << (quint8) QPicturePrivate::PdcSetBrushOrigin; d->s << (quint8) 0; pos = d->pic_d->pictb.pos(); | - | ||||||||||||
| 185 | d->s << p; | - | ||||||||||||
| 186 | writeCmdLength(pos, QRect(), false); | - | ||||||||||||
| 187 | } never executed:  end of block | 0 | ||||||||||||
| 188 | - | |||||||||||||
| 189 | void QPicturePaintEngine::updateFont(const QFont &font) | - | ||||||||||||
| 190 | { | - | ||||||||||||
| 191 | QPicturePaintEnginePrivate * const d = d_func(); | - | ||||||||||||
| 192 | - | |||||||||||||
| 193 | - | |||||||||||||
| 194 | - | |||||||||||||
| 195 | int pos; | - | ||||||||||||
| 196 | d->pic_d->trecs++; d->s << (quint8) QPicturePrivate::PdcSetFont; d->s << (quint8) 0; pos = d->pic_d->pictb.pos(); | - | ||||||||||||
| 197 | QFont fnt = font; | - | ||||||||||||
| 198 | d->s << fnt; | - | ||||||||||||
| 199 | writeCmdLength(pos, QRectF(), false); | - | ||||||||||||
| 200 | } never executed:  end of block | 0 | ||||||||||||
| 201 | - | |||||||||||||
| 202 | void QPicturePaintEngine::updateBackground(Qt::BGMode bgMode, const QBrush &bgBrush) | - | ||||||||||||
| 203 | { | - | ||||||||||||
| 204 | QPicturePaintEnginePrivate * const d = d_func(); | - | ||||||||||||
| 205 | - | |||||||||||||
| 206 | - | |||||||||||||
| 207 | - | |||||||||||||
| 208 | int pos; | - | ||||||||||||
| 209 | d->pic_d->trecs++; d->s << (quint8) QPicturePrivate::PdcSetBkColor; d->s << (quint8) 0; pos = d->pic_d->pictb.pos(); | - | ||||||||||||
| 210 | d->s << bgBrush.color(); | - | ||||||||||||
| 211 | writeCmdLength(pos, QRect(), false); | - | ||||||||||||
| 212 | - | |||||||||||||
| 213 | d->pic_d->trecs++; d->s << (quint8) QPicturePrivate::PdcSetBkMode; d->s << (quint8) 0; pos = d->pic_d->pictb.pos(); | - | ||||||||||||
| 214 | d->s << (qint8) bgMode; | - | ||||||||||||
| 215 | writeCmdLength(pos, QRectF(), false); | - | ||||||||||||
| 216 | } never executed:  end of block | 0 | ||||||||||||
| 217 | - | |||||||||||||
| 218 | void QPicturePaintEngine::updateMatrix(const QTransform &matrix) | - | ||||||||||||
| 219 | { | - | ||||||||||||
| 220 | QPicturePaintEnginePrivate * const d = d_func(); | - | ||||||||||||
| 221 | - | |||||||||||||
| 222 | - | |||||||||||||
| 223 | - | |||||||||||||
| 224 | int pos; | - | ||||||||||||
| 225 | d->pic_d->trecs++; d->s << (quint8) QPicturePrivate::PdcSetWMatrix; d->s << (quint8) 0; pos = d->pic_d->pictb.pos(); | - | ||||||||||||
| 226 | d->s << matrix << (qint8) false; | - | ||||||||||||
| 227 | writeCmdLength(pos, QRectF(), false); | - | ||||||||||||
| 228 | } never executed:  end of block | 0 | ||||||||||||
| 229 | - | |||||||||||||
| 230 | void QPicturePaintEngine::updateClipRegion(const QRegion ®ion, Qt::ClipOperation op) | - | ||||||||||||
| 231 | { | - | ||||||||||||
| 232 | QPicturePaintEnginePrivate * const d = d_func(); | - | ||||||||||||
| 233 | - | |||||||||||||
| 234 | - | |||||||||||||
| 235 | - | |||||||||||||
| 236 | - | |||||||||||||
| 237 | int pos; | - | ||||||||||||
| 238 | d->pic_d->trecs++; d->s << (quint8) QPicturePrivate::PdcSetClipRegion; d->s << (quint8) 0; pos = d->pic_d->pictb.pos(); | - | ||||||||||||
| 239 | d->s << region << qint8(op); | - | ||||||||||||
| 240 | writeCmdLength(pos, QRectF(), false); | - | ||||||||||||
| 241 | } never executed:  end of block | 0 | ||||||||||||
| 242 | - | |||||||||||||
| 243 | void QPicturePaintEngine::updateClipPath(const QPainterPath &path, Qt::ClipOperation op) | - | ||||||||||||
| 244 | { | - | ||||||||||||
| 245 | QPicturePaintEnginePrivate * const d = d_func(); | - | ||||||||||||
| 246 | - | |||||||||||||
| 247 | - | |||||||||||||
| 248 | - | |||||||||||||
| 249 | - | |||||||||||||
| 250 | int pos; | - | ||||||||||||
| 251 | - | |||||||||||||
| 252 | d->pic_d->trecs++; d->s << (quint8) QPicturePrivate::PdcSetClipPath; d->s << (quint8) 0; pos = d->pic_d->pictb.pos(); | - | ||||||||||||
| 253 | d->s << path << qint8(op); | - | ||||||||||||
| 254 | writeCmdLength(pos, QRectF(), false); | - | ||||||||||||
| 255 | } never executed:  end of block | 0 | ||||||||||||
| 256 | - | |||||||||||||
| 257 | void QPicturePaintEngine::updateRenderHints(QPainter::RenderHints hints) | - | ||||||||||||
| 258 | { | - | ||||||||||||
| 259 | QPicturePaintEnginePrivate * const d = d_func(); | - | ||||||||||||
| 260 | - | |||||||||||||
| 261 | - | |||||||||||||
| 262 | - | |||||||||||||
| 263 | int pos; | - | ||||||||||||
| 264 | d->pic_d->trecs++; d->s << (quint8) QPicturePrivate::PdcSetRenderHint; d->s << (quint8) 0; pos = d->pic_d->pictb.pos(); | - | ||||||||||||
| 265 | d->s << (quint32) hints; | - | ||||||||||||
| 266 | writeCmdLength(pos, QRect(), false); | - | ||||||||||||
| 267 | } never executed:  end of block | 0 | ||||||||||||
| 268 | - | |||||||||||||
| 269 | void QPicturePaintEngine::writeCmdLength(int pos, const QRectF &r, bool corr) | - | ||||||||||||
| 270 | { | - | ||||||||||||
| 271 | QPicturePaintEnginePrivate * const d = d_func(); | - | ||||||||||||
| 272 | int newpos = d->pic_d->pictb.pos(); | - | ||||||||||||
| 273 | int length = newpos - pos; | - | ||||||||||||
| 274 | QRectF br(r); | - | ||||||||||||
| 275 | - | |||||||||||||
| 276 |     if (length < 255
  | 0 | ||||||||||||
| 277 | d->pic_d->pictb.seek(pos - 1); | - | ||||||||||||
| 278 | d->s << (quint8)length; | - | ||||||||||||
| 279 |     } never executed:   else {end of block | 0 | ||||||||||||
| 280 | d->s << (quint32)0; | - | ||||||||||||
| 281 | d->pic_d->pictb.seek(pos - 1); | - | ||||||||||||
| 282 | d->s << (quint8)255; | - | ||||||||||||
| 283 | char *p = d->pic_d->pictb.buffer().data(); | - | ||||||||||||
| 284 | memmove(p+pos+4, p+pos, length); | - | ||||||||||||
| 285 | d->s << (quint32)length; | - | ||||||||||||
| 286 | newpos += 4; | - | ||||||||||||
| 287 |     } never executed:  end of block | 0 | ||||||||||||
| 288 | d->pic_d->pictb.seek(newpos); | - | ||||||||||||
| 289 | - | |||||||||||||
| 290 |     if (br.width() > 0.0
 
  | 0 | ||||||||||||
| 291 |         if (corr
  | 0 | ||||||||||||
| 292 | int w2 = painter()->pen().width() / 2; | - | ||||||||||||
| 293 | br.setCoords(br.left() - w2, br.top() - w2, | - | ||||||||||||
| 294 | br.right() + w2, br.bottom() + w2); | - | ||||||||||||
| 295 |         } never executed:  end of block | 0 | ||||||||||||
| 296 | br = painter()->transform().mapRect(br); | - | ||||||||||||
| 297 |         if (painter()->hasClipping()
  | 0 | ||||||||||||
| 298 | QRectF cr = painter()->clipBoundingRect(); | - | ||||||||||||
| 299 | br &= cr; | - | ||||||||||||
| 300 |         } never executed:  end of block | 0 | ||||||||||||
| 301 | - | |||||||||||||
| 302 |         if (br.width() > 0.0
 
  | 0 | ||||||||||||
| 303 | int minx = qFloor(br.left()); | - | ||||||||||||
| 304 | int miny = qFloor(br.top()); | - | ||||||||||||
| 305 | int maxx = qCeil(br.right()); | - | ||||||||||||
| 306 | int maxy = qCeil(br.bottom()); | - | ||||||||||||
| 307 | - | |||||||||||||
| 308 |             if (d->pic_d->brect.width() > 0
 
  | 0 | ||||||||||||
| 309 | minx = qMin(minx, d->pic_d->brect.left()); | - | ||||||||||||
| 310 | miny = qMin(miny, d->pic_d->brect.top()); | - | ||||||||||||
| 311 | maxx = qMax(maxx, d->pic_d->brect.x() + d->pic_d->brect.width()); | - | ||||||||||||
| 312 | maxy = qMax(maxy, d->pic_d->brect.y() + d->pic_d->brect.height()); | - | ||||||||||||
| 313 | d->pic_d->brect = QRect(minx, miny, maxx - minx, maxy - miny); | - | ||||||||||||
| 314 |             } never executed:   else {end of block | 0 | ||||||||||||
| 315 | d->pic_d->brect = QRect(minx, miny, maxx - minx, maxy - miny); | - | ||||||||||||
| 316 |             } never executed:  end of block | 0 | ||||||||||||
| 317 | } | - | ||||||||||||
| 318 |     } never executed:  end of block | 0 | ||||||||||||
| 319 | } never executed:  end of block | 0 | ||||||||||||
| 320 | - | |||||||||||||
| 321 | void QPicturePaintEngine::drawEllipse(const QRectF &rect) | - | ||||||||||||
| 322 | { | - | ||||||||||||
| 323 | QPicturePaintEnginePrivate * const d = d_func(); | - | ||||||||||||
| 324 | - | |||||||||||||
| 325 | - | |||||||||||||
| 326 | - | |||||||||||||
| 327 | int pos; | - | ||||||||||||
| 328 | d->pic_d->trecs++; d->s << (quint8) QPicturePrivate::PdcDrawEllipse; d->s << (quint8) 0; pos = d->pic_d->pictb.pos(); | - | ||||||||||||
| 329 | d->s << rect; | - | ||||||||||||
| 330 | writeCmdLength(pos, rect, true); | - | ||||||||||||
| 331 | } never executed:  end of block | 0 | ||||||||||||
| 332 | - | |||||||||||||
| 333 | void QPicturePaintEngine::drawPath(const QPainterPath &path) | - | ||||||||||||
| 334 | { | - | ||||||||||||
| 335 | QPicturePaintEnginePrivate * const d = d_func(); | - | ||||||||||||
| 336 | - | |||||||||||||
| 337 | - | |||||||||||||
| 338 | - | |||||||||||||
| 339 | int pos; | - | ||||||||||||
| 340 | d->pic_d->trecs++; d->s << (quint8) QPicturePrivate::PdcDrawPath; d->s << (quint8) 0; pos = d->pic_d->pictb.pos(); | - | ||||||||||||
| 341 | d->s << path; | - | ||||||||||||
| 342 | writeCmdLength(pos, path.boundingRect(), true); | - | ||||||||||||
| 343 | } never executed:  end of block | 0 | ||||||||||||
| 344 | - | |||||||||||||
| 345 | void QPicturePaintEngine::drawPolygon(const QPointF *points, int numPoints, PolygonDrawMode mode) | - | ||||||||||||
| 346 | { | - | ||||||||||||
| 347 | QPicturePaintEnginePrivate * const d = d_func(); | - | ||||||||||||
| 348 | - | |||||||||||||
| 349 | - | |||||||||||||
| 350 | - | |||||||||||||
| 351 | int pos; | - | ||||||||||||
| 352 | - | |||||||||||||
| 353 | QPolygonF polygon; | - | ||||||||||||
| 354 | polygon.reserve(numPoints); | - | ||||||||||||
| 355 |     for (int i=0; i<numPoints
  | 0 | ||||||||||||
| 356 |         polygon << points[i]; never executed:  polygon << points[i]; | 0 | ||||||||||||
| 357 | - | |||||||||||||
| 358 |     if (mode == PolylineMode
  | 0 | ||||||||||||
| 359 | d->pic_d->trecs++; d->s << (quint8) QPicturePrivate::PdcDrawPolyline; d->s << (quint8) 0; pos = d->pic_d->pictb.pos(); | - | ||||||||||||
| 360 | d->s << polygon; | - | ||||||||||||
| 361 |     } never executed:   else {end of block | 0 | ||||||||||||
| 362 | d->pic_d->trecs++; d->s << (quint8) QPicturePrivate::PdcDrawPolygon; d->s << (quint8) 0; pos = d->pic_d->pictb.pos(); | - | ||||||||||||
| 363 | d->s << polygon; | - | ||||||||||||
| 364 | d->s << (qint8)(mode == OddEvenMode ? 0 : 1); | - | ||||||||||||
| 365 |     } never executed:  end of block | 0 | ||||||||||||
| 366 | - | |||||||||||||
| 367 | writeCmdLength(pos, polygon.boundingRect(), true); | - | ||||||||||||
| 368 | } never executed:  end of block | 0 | ||||||||||||
| 369 | - | |||||||||||||
| 370 | void QPicturePaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) | - | ||||||||||||
| 371 | { | - | ||||||||||||
| 372 | QPicturePaintEnginePrivate * const d = d_func(); | - | ||||||||||||
| 373 | - | |||||||||||||
| 374 | - | |||||||||||||
| 375 | - | |||||||||||||
| 376 | int pos; | - | ||||||||||||
| 377 | d->pic_d->trecs++; d->s << (quint8) QPicturePrivate::PdcDrawPixmap; d->s << (quint8) 0; pos = d->pic_d->pictb.pos(); | - | ||||||||||||
| 378 | - | |||||||||||||
| 379 |     if (d->pic_d->in_memory_only
  | 0 | ||||||||||||
| 380 | int index = d->pic_d->pixmap_list.size(); | - | ||||||||||||
| 381 | d->pic_d->pixmap_list.append(pm); | - | ||||||||||||
| 382 | d->s << r << index << sr; | - | ||||||||||||
| 383 |     } never executed:   else {end of block | 0 | ||||||||||||
| 384 | d->s << r << pm << sr; | - | ||||||||||||
| 385 |     } never executed:  end of block | 0 | ||||||||||||
| 386 | writeCmdLength(pos, r, false); | - | ||||||||||||
| 387 | } never executed:  end of block | 0 | ||||||||||||
| 388 | - | |||||||||||||
| 389 | void QPicturePaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pixmap, const QPointF &s) | - | ||||||||||||
| 390 | { | - | ||||||||||||
| 391 | QPicturePaintEnginePrivate * const d = d_func(); | - | ||||||||||||
| 392 | - | |||||||||||||
| 393 | - | |||||||||||||
| 394 | - | |||||||||||||
| 395 | int pos; | - | ||||||||||||
| 396 | d->pic_d->trecs++; d->s << (quint8) QPicturePrivate::PdcDrawTiledPixmap; d->s << (quint8) 0; pos = d->pic_d->pictb.pos(); | - | ||||||||||||
| 397 |     if (d->pic_d->in_memory_only
  | 0 | ||||||||||||
| 398 | int index = d->pic_d->pixmap_list.size(); | - | ||||||||||||
| 399 | d->pic_d->pixmap_list.append(pixmap); | - | ||||||||||||
| 400 | d->s << r << index << s; | - | ||||||||||||
| 401 |     } never executed:   else {end of block | 0 | ||||||||||||
| 402 | d->s << r << pixmap << s; | - | ||||||||||||
| 403 |     } never executed:  end of block | 0 | ||||||||||||
| 404 | writeCmdLength(pos, r, false); | - | ||||||||||||
| 405 | } never executed:  end of block | 0 | ||||||||||||
| 406 | - | |||||||||||||
| 407 | void QPicturePaintEngine::drawImage(const QRectF &r, const QImage &image, const QRectF &sr, | - | ||||||||||||
| 408 | Qt::ImageConversionFlags flags) | - | ||||||||||||
| 409 | { | - | ||||||||||||
| 410 | QPicturePaintEnginePrivate * const d = d_func(); | - | ||||||||||||
| 411 | - | |||||||||||||
| 412 | - | |||||||||||||
| 413 | - | |||||||||||||
| 414 | int pos; | - | ||||||||||||
| 415 | d->pic_d->trecs++; d->s << (quint8) QPicturePrivate::PdcDrawImage; d->s << (quint8) 0; pos = d->pic_d->pictb.pos(); | - | ||||||||||||
| 416 |     if (d->pic_d->in_memory_only
  | 0 | ||||||||||||
| 417 | int index = d->pic_d->image_list.size(); | - | ||||||||||||
| 418 | d->pic_d->image_list.append(image); | - | ||||||||||||
| 419 | d->s << r << index << sr << (quint32) flags; | - | ||||||||||||
| 420 |     } never executed:   else {end of block | 0 | ||||||||||||
| 421 | d->s << r << image << sr << (quint32) flags; | - | ||||||||||||
| 422 |     } never executed:  end of block | 0 | ||||||||||||
| 423 | writeCmdLength(pos, r, false); | - | ||||||||||||
| 424 | } never executed:  end of block | 0 | ||||||||||||
| 425 | - | |||||||||||||
| 426 | void QPicturePaintEngine::drawTextItem(const QPointF &p , const QTextItem &ti) | - | ||||||||||||
| 427 | { | - | ||||||||||||
| 428 | QPicturePaintEnginePrivate * const d = d_func(); | - | ||||||||||||
| 429 | - | |||||||||||||
| 430 | - | |||||||||||||
| 431 | - | |||||||||||||
| 432 | - | |||||||||||||
| 433 | const QTextItemInt &si = static_cast<const QTextItemInt &>(ti); | - | ||||||||||||
| 434 |     if (si.chars == 0
  | 0 | ||||||||||||
| 435 |         QPaintEngine::drawTextItem(p, ti); never executed:  QPaintEngine::drawTextItem(p, ti); | 0 | ||||||||||||
| 436 | - | |||||||||||||
| 437 |     if (d->pic_d->formatMajor >= 9
  | 0 | ||||||||||||
| 438 | int pos; | - | ||||||||||||
| 439 | d->pic_d->trecs++; d->s << (quint8) QPicturePrivate::PdcDrawTextItem; d->s << (quint8) 0; pos = d->pic_d->pictb.pos(); | - | ||||||||||||
| 440 | QFont fnt = ti.font(); | - | ||||||||||||
| 441 | fnt.setUnderline(false); | - | ||||||||||||
| 442 | fnt.setStrikeOut(false); | - | ||||||||||||
| 443 | fnt.setOverline(false); | - | ||||||||||||
| 444 | - | |||||||||||||
| 445 | qreal justificationWidth = 0; | - | ||||||||||||
| 446 |         if (si.justified
  | 0 | ||||||||||||
| 447 |             justificationWidth = si.width.toReal(); never executed:  justificationWidth = si.width.toReal(); | 0 | ||||||||||||
| 448 | - | |||||||||||||
| 449 | d->s << p << ti.text() << fnt << ti.renderFlags() << double(fnt.d->dpi)/qt_defaultDpi() << justificationWidth; | - | ||||||||||||
| 450 | writeCmdLength(pos, QRectF(), false); | - | ||||||||||||
| 451 |     } never executed:   else if (d->pic_d->formatMajor >= 8end of block
  | 0 | ||||||||||||
| 452 | - | |||||||||||||
| 453 | int pos; | - | ||||||||||||
| 454 | d->pic_d->trecs++; d->s << (quint8) QPicturePrivate::PdcDrawTextItem; d->s << (quint8) 0; pos = d->pic_d->pictb.pos(); | - | ||||||||||||
| 455 | d->s << QPointF(p.x(), p.y() - ti.ascent()) << ti.text() << ti.font() << ti.renderFlags(); | - | ||||||||||||
| 456 | writeCmdLength(pos, QRectF(), false); | - | ||||||||||||
| 457 |     } never executed:   else {end of block | 0 | ||||||||||||
| 458 | - | |||||||||||||
| 459 | int pos; | - | ||||||||||||
| 460 | d->pic_d->trecs++; d->s << (quint8) QPicturePrivate::PdcDrawText2; d->s << (quint8) 0; pos = d->pic_d->pictb.pos(); | - | ||||||||||||
| 461 | d->s << p << ti.text(); | - | ||||||||||||
| 462 | writeCmdLength(pos, QRectF(p, QSizeF(1,1)), true); | - | ||||||||||||
| 463 |     } never executed:  end of block | 0 | ||||||||||||
| 464 | } | - | ||||||||||||
| 465 | - | |||||||||||||
| 466 | void QPicturePaintEngine::updateState(const QPaintEngineState &state) | - | ||||||||||||
| 467 | { | - | ||||||||||||
| 468 | QPaintEngine::DirtyFlags flags = state.state(); | - | ||||||||||||
| 469 |     if (flags & DirtyPen
 never executed:  updatePen(state.pen()); | 0 | ||||||||||||
| 470 |     if (flags & DirtyBrush
 never executed:  updateBrush(state.brush()); | 0 | ||||||||||||
| 471 |     if (flags & DirtyBrushOrigin
 never executed:  updateBrushOrigin(state.brushOrigin()); | 0 | ||||||||||||
| 472 |     if (flags & DirtyFont
 never executed:  updateFont(state.font()); | 0 | ||||||||||||
| 473 |     if (flags & DirtyBackground
 never executed:  updateBackground(state.backgroundMode(), state.backgroundBrush()); | 0 | ||||||||||||
| 474 |     if (flags & DirtyTransform
 never executed:  updateMatrix(state.transform()); | 0 | ||||||||||||
| 475 |     if (flags & DirtyClipEnabled
 never executed:  updateClipEnabled(state.isClipEnabled()); | 0 | ||||||||||||
| 476 |     if (flags & DirtyClipRegion
 never executed:  updateClipRegion(state.clipRegion(), state.clipOperation()); | 0 | ||||||||||||
| 477 |     if (flags & DirtyClipPath
 never executed:  updateClipPath(state.clipPath(), state.clipOperation()); | 0 | ||||||||||||
| 478 |     if (flags & DirtyHints
 never executed:  updateRenderHints(state.renderHints()); | 0 | ||||||||||||
| 479 |     if (flags & DirtyCompositionMode
 never executed:  updateCompositionMode(state.compositionMode()); | 0 | ||||||||||||
| 480 |     if (flags & DirtyOpacity
 never executed:  updateOpacity(state.opacity()); | 0 | ||||||||||||
| 481 | } never executed:  end of block | 0 | ||||||||||||
| 482 | - | |||||||||||||
| 483 | - | |||||||||||||
| Switch to Source code | Preprocessed file |