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