| Line | Source Code | Coverage |
|---|
| 1 | | - |
| 2 | | - |
| 3 | | - |
| 4 | QMatrix::QMatrix() | - |
| 5 | : _m11(1.) | - |
| 6 | , _m12(0.) | - |
| 7 | , _m21(0.) | - |
| 8 | , _m22(1.) | - |
| 9 | , _dx(0.) | - |
| 10 | , _dy(0.) | - |
| 11 | { | - |
| 12 | } executed: }Execution Count:1575 | 1575 |
| 13 | QMatrix::QMatrix(qreal m11, qreal m12, qreal m21, qreal m22, qreal dx, qreal dy) | - |
| 14 | : _m11(m11) | - |
| 15 | , _m12(m12) | - |
| 16 | , _m21(m21) | - |
| 17 | , _m22(m22) | - |
| 18 | , _dx(dx) | - |
| 19 | , _dy(dy) | - |
| 20 | { | - |
| 21 | } executed: }Execution Count:49 | 49 |
| 22 | | - |
| 23 | | - |
| 24 | | - |
| 25 | | - |
| 26 | | - |
| 27 | QMatrix::QMatrix(const QMatrix &matrix) | - |
| 28 | : _m11(matrix._m11) | - |
| 29 | , _m12(matrix._m12) | - |
| 30 | , _m21(matrix._m21) | - |
| 31 | , _m22(matrix._m22) | - |
| 32 | , _dx(matrix._dx) | - |
| 33 | , _dy(matrix._dy) | - |
| 34 | { | - |
| 35 | } executed: }Execution Count:650929 | 650929 |
| 36 | void QMatrix::setMatrix(qreal m11, qreal m12, qreal m21, qreal m22, qreal dx, qreal dy) | - |
| 37 | { | - |
| 38 | _m11 = m11; | - |
| 39 | _m12 = m12; | - |
| 40 | _m21 = m21; | - |
| 41 | _m22 = m22; | - |
| 42 | _dx = dx; | - |
| 43 | _dy = dy; | - |
| 44 | } executed: }Execution Count:2 | 2 |
| 45 | void QMatrix::map(qreal x, qreal y, qreal *tx, qreal *ty) const | - |
| 46 | { | - |
| 47 | { qreal fx = x; qreal fy = y; *tx = _m11*fx + _m21*fy + _dx; *ty = _m12*fx + _m22*fy + _dy; }; | - |
| 48 | } | 0 |
| 49 | void QMatrix::map(int x, int y, int *tx, int *ty) const | - |
| 50 | { | - |
| 51 | { qreal fx = x; qreal fy = y; *tx = qRound(_m11*fx + _m21*fy + _dx); *ty = qRound(_m12*fx + _m22*fy + _dy); }; | - |
| 52 | } | 0 |
| 53 | | - |
| 54 | QRect QMatrix::mapRect(const QRect &rect) const | - |
| 55 | { | - |
| 56 | QRect result; | - |
| 57 | if (_m12 == 0.0F && _m21 == 0.0F) { evaluated: _m12 == 0.0F| yes Evaluation Count:15 | yes Evaluation Count:2 |
partially evaluated: _m21 == 0.0F| yes Evaluation Count:15 | no Evaluation Count:0 |
| 0-15 |
| 58 | int x = qRound(_m11*rect.x() + _dx); | - |
| 59 | int y = qRound(_m22*rect.y() + _dy); | - |
| 60 | int w = qRound(_m11*rect.width()); | - |
| 61 | int h = qRound(_m22*rect.height()); | - |
| 62 | if (w < 0) { evaluated: w < 0| yes Evaluation Count:8 | yes Evaluation Count:7 |
| 7-8 |
| 63 | w = -w; | - |
| 64 | x -= w; | - |
| 65 | } executed: }Execution Count:8 | 8 |
| 66 | if (h < 0) { evaluated: h < 0| yes Evaluation Count:8 | yes Evaluation Count:7 |
| 7-8 |
| 67 | h = -h; | - |
| 68 | y -= h; | - |
| 69 | } executed: }Execution Count:8 | 8 |
| 70 | result = QRect(x, y, w, h); | - |
| 71 | } else { executed: }Execution Count:15 | 15 |
| 72 | | - |
| 73 | qreal x0, y0; | - |
| 74 | qreal x, y; | - |
| 75 | { qreal fx = rect.left(); qreal fy = rect.top(); x0 = _m11*fx + _m21*fy + _dx; y0 = _m12*fx + _m22*fy + _dy; }; | - |
| 76 | qreal xmin = x0; | - |
| 77 | qreal ymin = y0; | - |
| 78 | qreal xmax = x0; | - |
| 79 | qreal ymax = y0; | - |
| 80 | { qreal fx = rect.right() + 1; qreal fy = rect.top(); x = _m11*fx + _m21*fy + _dx; y = _m12*fx + _m22*fy + _dy; }; | - |
| 81 | xmin = qMin(xmin, x); | - |
| 82 | ymin = qMin(ymin, y); | - |
| 83 | xmax = qMax(xmax, x); | - |
| 84 | ymax = qMax(ymax, y); | - |
| 85 | { qreal fx = rect.right() + 1; qreal fy = rect.bottom() + 1; x = _m11*fx + _m21*fy + _dx; y = _m12*fx + _m22*fy + _dy; }; | - |
| 86 | xmin = qMin(xmin, x); | - |
| 87 | ymin = qMin(ymin, y); | - |
| 88 | xmax = qMax(xmax, x); | - |
| 89 | ymax = qMax(ymax, y); | - |
| 90 | { qreal fx = rect.left(); qreal fy = rect.bottom() + 1; x = _m11*fx + _m21*fy + _dx; y = _m12*fx + _m22*fy + _dy; }; | - |
| 91 | xmin = qMin(xmin, x); | - |
| 92 | ymin = qMin(ymin, y); | - |
| 93 | xmax = qMax(xmax, x); | - |
| 94 | ymax = qMax(ymax, y); | - |
| 95 | result = QRect(qRound(xmin), qRound(ymin), qRound(xmax)-qRound(xmin), qRound(ymax)-qRound(ymin)); | - |
| 96 | } executed: }Execution Count:2 | 2 |
| 97 | return result; executed: return result;Execution Count:17 | 17 |
| 98 | } | - |
| 99 | QRectF QMatrix::mapRect(const QRectF &rect) const | - |
| 100 | { | - |
| 101 | QRectF result; | - |
| 102 | if (_m12 == 0.0F && _m21 == 0.0F) { partially evaluated: _m12 == 0.0F| yes Evaluation Count:301 | no Evaluation Count:0 |
partially evaluated: _m21 == 0.0F| yes Evaluation Count:301 | no Evaluation Count:0 |
| 0-301 |
| 103 | qreal x = _m11*rect.x() + _dx; | - |
| 104 | qreal y = _m22*rect.y() + _dy; | - |
| 105 | qreal w = _m11*rect.width(); | - |
| 106 | qreal h = _m22*rect.height(); | - |
| 107 | if (w < 0) { partially evaluated: w < 0| no Evaluation Count:0 | yes Evaluation Count:301 |
| 0-301 |
| 108 | w = -w; | - |
| 109 | x -= w; | - |
| 110 | } | 0 |
| 111 | if (h < 0) { partially evaluated: h < 0| no Evaluation Count:0 | yes Evaluation Count:301 |
| 0-301 |
| 112 | h = -h; | - |
| 113 | y -= h; | - |
| 114 | } | 0 |
| 115 | result = QRectF(x, y, w, h); | - |
| 116 | } else { executed: }Execution Count:301 | 301 |
| 117 | qreal x0, y0; | - |
| 118 | qreal x, y; | - |
| 119 | { qreal fx = rect.x(); qreal fy = rect.y(); x0 = _m11*fx + _m21*fy + _dx; y0 = _m12*fx + _m22*fy + _dy; }; | - |
| 120 | qreal xmin = x0; | - |
| 121 | qreal ymin = y0; | - |
| 122 | qreal xmax = x0; | - |
| 123 | qreal ymax = y0; | - |
| 124 | { qreal fx = rect.x() + rect.width(); qreal fy = rect.y(); x = _m11*fx + _m21*fy + _dx; y = _m12*fx + _m22*fy + _dy; }; | - |
| 125 | xmin = qMin(xmin, x); | - |
| 126 | ymin = qMin(ymin, y); | - |
| 127 | xmax = qMax(xmax, x); | - |
| 128 | ymax = qMax(ymax, y); | - |
| 129 | { qreal fx = rect.x() + rect.width(); qreal fy = rect.y() + rect.height(); x = _m11*fx + _m21*fy + _dx; y = _m12*fx + _m22*fy + _dy; }; | - |
| 130 | xmin = qMin(xmin, x); | - |
| 131 | ymin = qMin(ymin, y); | - |
| 132 | xmax = qMax(xmax, x); | - |
| 133 | ymax = qMax(ymax, y); | - |
| 134 | { qreal fx = rect.x(); qreal fy = rect.y() + rect.height(); x = _m11*fx + _m21*fy + _dx; y = _m12*fx + _m22*fy + _dy; }; | - |
| 135 | xmin = qMin(xmin, x); | - |
| 136 | ymin = qMin(ymin, y); | - |
| 137 | xmax = qMax(xmax, x); | - |
| 138 | ymax = qMax(ymax, y); | - |
| 139 | result = QRectF(xmin, ymin, xmax-xmin, ymax - ymin); | - |
| 140 | } | 0 |
| 141 | return result; executed: return result;Execution Count:301 | 301 |
| 142 | } | - |
| 143 | QPoint QMatrix::map(const QPoint &p) const | - |
| 144 | { | - |
| 145 | qreal fx = p.x(); | - |
| 146 | qreal fy = p.y(); | - |
| 147 | return QPoint(qRound(_m11*fx + _m21*fy + _dx), | 17 |
| 148 | qRound(_m12*fx + _m22*fy + _dy)); executed: return QPoint(qRound(_m11*fx + _m21*fy + _dx), qRound(_m12*fx + _m22*fy + _dy));Execution Count:17 | 17 |
| 149 | } | - |
| 150 | QPointF QMatrix::map(const QPointF &point) const | - |
| 151 | { | - |
| 152 | qreal fx = point.x(); | - |
| 153 | qreal fy = point.y(); | - |
| 154 | return QPointF(_m11*fx + _m21*fy + _dx, _m12*fx + _m22*fy + _dy); executed: return QPointF(_m11*fx + _m21*fy + _dx, _m12*fx + _m22*fy + _dy);Execution Count:4 | 4 |
| 155 | } | - |
| 156 | QLineF QMatrix::map(const QLineF &line) const | - |
| 157 | { | - |
| 158 | return QLineF(map(line.p1()), map(line.p2())); never executed: return QLineF(map(line.p1()), map(line.p2())); | 0 |
| 159 | } | - |
| 160 | QLine QMatrix::map(const QLine &line) const | - |
| 161 | { | - |
| 162 | return QLine(map(line.p1()), map(line.p2())); never executed: return QLine(map(line.p1()), map(line.p2())); | 0 |
| 163 | } | - |
| 164 | QPolygon QMatrix::map(const QPolygon &a) const | - |
| 165 | { | - |
| 166 | int size = a.size(); | - |
| 167 | int i; | - |
| 168 | QPolygon p(size); | - |
| 169 | const QPoint *da = a.constData(); | - |
| 170 | QPoint *dp = p.data(); | - |
| 171 | for(i = 0; i < size; i++) { evaluated: i < size| yes Evaluation Count:42 | yes Evaluation Count:7 |
| 7-42 |
| 172 | { qreal fx = da[i].x(); qreal fy = da[i].y(); dp[i].rx() = qRound(_m11*fx + _m21*fy + _dx); dp[i].ry() = qRound(_m12*fx + _m22*fy + _dy); }; | - |
| 173 | } executed: }Execution Count:42 | 42 |
| 174 | return p; executed: return p;Execution Count:7 | 7 |
| 175 | } | - |
| 176 | QPolygonF QMatrix::map(const QPolygonF &a) const | - |
| 177 | { | - |
| 178 | int size = a.size(); | - |
| 179 | int i; | - |
| 180 | QPolygonF p(size); | - |
| 181 | const QPointF *da = a.constData(); | - |
| 182 | QPointF *dp = p.data(); | - |
| 183 | for(i = 0; i < size; i++) { never evaluated: i < size | 0 |
| 184 | { qreal fx = da[i].xp; qreal fy = da[i].yp; dp[i].xp = _m11*fx + _m21*fy + _dx; dp[i].yp = _m12*fx + _m22*fy + _dy; }; | - |
| 185 | } | 0 |
| 186 | return p; never executed: return p; | 0 |
| 187 | } | - |
| 188 | extern QPainterPath qt_regionToPath(const QRegion ®ion); | - |
| 189 | QRegion QMatrix::map(const QRegion &r) const | - |
| 190 | { | - |
| 191 | if (_m11 == 1.0 && _m22 == 1.0 && _m12 == 0.0 && _m21 == 0.0) { never evaluated: _m11 == 1.0 never evaluated: _m22 == 1.0 never evaluated: _m12 == 0.0 never evaluated: _m21 == 0.0 | 0 |
| 192 | if (_dx == 0.0 && _dy == 0.0) never evaluated: _dx == 0.0 never evaluated: _dy == 0.0 | 0 |
| 193 | return r; never executed: return r; | 0 |
| 194 | QRegion copy(r); | - |
| 195 | copy.translate(qRound(_dx), qRound(_dy)); | - |
| 196 | return copy; never executed: return copy; | 0 |
| 197 | } | - |
| 198 | | - |
| 199 | QPainterPath p = map(qt_regionToPath(r)); | - |
| 200 | return p.toFillPolygon().toPolygon(); never executed: return p.toFillPolygon().toPolygon(); | 0 |
| 201 | } | - |
| 202 | QPainterPath QMatrix::map(const QPainterPath &path) const | - |
| 203 | { | - |
| 204 | if (path.isEmpty()) partially evaluated: path.isEmpty()| no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
| 205 | return QPainterPath(); never executed: return QPainterPath(); | 0 |
| 206 | | - |
| 207 | QPainterPath copy = path; | - |
| 208 | | - |
| 209 | | - |
| 210 | if (_m11 == 1.0 && _m22 == 1.0 && _m12 == 0.0 && _m21 == 0.0) { partially evaluated: _m11 == 1.0| no Evaluation Count:0 | yes Evaluation Count:1 |
never evaluated: _m22 == 1.0 never evaluated: _m12 == 0.0 never evaluated: _m21 == 0.0 | 0-1 |
| 211 | | - |
| 212 | | - |
| 213 | if (_dx != 0.0 || _dy != 0.0) { never evaluated: _dx != 0.0 never evaluated: _dy != 0.0 | 0 |
| 214 | copy.detach(); | - |
| 215 | for (int i=0; i<path.elementCount(); ++i) { never evaluated: i<path.elementCount() | 0 |
| 216 | QPainterPath::Element &e = copy.d_ptr->elements[i]; | - |
| 217 | e.x += _dx; | - |
| 218 | e.y += _dy; | - |
| 219 | } | 0 |
| 220 | } | 0 |
| 221 | | - |
| 222 | | - |
| 223 | } else { | 0 |
| 224 | copy.detach(); | - |
| 225 | for (int i=0; i<path.elementCount(); ++i) { evaluated: i<path.elementCount()| yes Evaluation Count:6 | yes Evaluation Count:1 |
| 1-6 |
| 226 | QPainterPath::Element &e = copy.d_ptr->elements[i]; | - |
| 227 | qreal fx = e.x, fy = e.y; | - |
| 228 | e.x = _m11*fx + _m21*fy + _dx; | - |
| 229 | e.y = _m12*fx + _m22*fy + _dy; | - |
| 230 | } executed: }Execution Count:6 | 6 |
| 231 | } executed: }Execution Count:1 | 1 |
| 232 | | - |
| 233 | return copy; executed: return copy;Execution Count:1 | 1 |
| 234 | } | - |
| 235 | QPolygon QMatrix::mapToPolygon(const QRect &rect) const | - |
| 236 | { | - |
| 237 | QPolygon a(4); | - |
| 238 | qreal x[4], y[4]; | - |
| 239 | if (_m12 == 0.0F && _m21 == 0.0F) { partially evaluated: _m21 == 0.0F| yes Evaluation Count:15 | no Evaluation Count:0 |
evaluated: _m12 == 0.0F| yes Evaluation Count:15 | yes Evaluation Count:2 |
| 0-15 |
| 240 | x[0] = _m11*rect.x() + _dx; | - |
| 241 | y[0] = _m22*rect.y() + _dy; | - |
| 242 | qreal w = _m11*rect.width(); | - |
| 243 | qreal h = _m22*rect.height(); | - |
| 244 | if (w < 0) { evaluated: w < 0| yes Evaluation Count:8 | yes Evaluation Count:7 |
| 7-8 |
| 245 | w = -w; | - |
| 246 | x[0] -= w; | - |
| 247 | } executed: }Execution Count:8 | 8 |
| 248 | if (h < 0) { evaluated: h < 0| yes Evaluation Count:8 | yes Evaluation Count:7 |
| 7-8 |
| 249 | h = -h; | - |
| 250 | y[0] -= h; | - |
| 251 | } executed: }Execution Count:8 | 8 |
| 252 | x[1] = x[0]+w; | - |
| 253 | x[2] = x[1]; | - |
| 254 | x[3] = x[0]; | - |
| 255 | y[1] = y[0]; | - |
| 256 | y[2] = y[0]+h; | - |
| 257 | y[3] = y[2]; | - |
| 258 | } else { executed: }Execution Count:15 | 15 |
| 259 | qreal right = rect.x() + rect.width(); | - |
| 260 | qreal bottom = rect.y() + rect.height(); | - |
| 261 | { qreal fx = rect.x(); qreal fy = rect.y(); x[0] = _m11*fx + _m21*fy + _dx; y[0] = _m12*fx + _m22*fy + _dy; }; | - |
| 262 | { qreal fx = right; qreal fy = rect.y(); x[1] = _m11*fx + _m21*fy + _dx; y[1] = _m12*fx + _m22*fy + _dy; }; | - |
| 263 | { qreal fx = right; qreal fy = bottom; x[2] = _m11*fx + _m21*fy + _dx; y[2] = _m12*fx + _m22*fy + _dy; }; | - |
| 264 | { qreal fx = rect.x(); qreal fy = bottom; x[3] = _m11*fx + _m21*fy + _dx; y[3] = _m12*fx + _m22*fy + _dy; }; | - |
| 265 | } executed: }Execution Count:2 | 2 |
| 266 | a.setPoints(4, qRound(x[0]), qRound(y[0]), | - |
| 267 | qRound(x[1]), qRound(y[1]), | - |
| 268 | qRound(x[2]), qRound(y[2]), | - |
| 269 | qRound(x[3]), qRound(y[3])); | - |
| 270 | return a; executed: return a;Execution Count:17 | 17 |
| 271 | } | - |
| 272 | void QMatrix::reset() | - |
| 273 | { | - |
| 274 | _m11 = _m22 = 1.0; | - |
| 275 | _m12 = _m21 = _dx = _dy = 0.0; | - |
| 276 | } | 0 |
| 277 | QMatrix &QMatrix::translate(qreal dx, qreal dy) | - |
| 278 | { | - |
| 279 | _dx += dx*_m11 + dy*_m21; | - |
| 280 | _dy += dy*_m22 + dx*_m12; | - |
| 281 | return *this; executed: return *this;Execution Count:503 | 503 |
| 282 | } | - |
| 283 | QMatrix &QMatrix::scale(qreal sx, qreal sy) | - |
| 284 | { | - |
| 285 | _m11 *= sx; | - |
| 286 | _m12 *= sx; | - |
| 287 | _m21 *= sy; | - |
| 288 | _m22 *= sy; | - |
| 289 | return *this; executed: return *this;Execution Count:14 | 14 |
| 290 | } | - |
| 291 | QMatrix &QMatrix::shear(qreal sh, qreal sv) | - |
| 292 | { | - |
| 293 | qreal tm11 = sv*_m21; | - |
| 294 | qreal tm12 = sv*_m22; | - |
| 295 | qreal tm21 = sh*_m11; | - |
| 296 | qreal tm22 = sh*_m12; | - |
| 297 | _m11 += tm11; | - |
| 298 | _m12 += tm12; | - |
| 299 | _m21 += tm21; | - |
| 300 | _m22 += tm22; | - |
| 301 | return *this; executed: return *this;Execution Count:3 | 3 |
| 302 | } | - |
| 303 | | - |
| 304 | const qreal deg2rad = qreal(0.017453292519943295769); | - |
| 305 | QMatrix &QMatrix::rotate(qreal a) | - |
| 306 | { | - |
| 307 | qreal sina = 0; | - |
| 308 | qreal cosa = 0; | - |
| 309 | if (a == 90. || a == -270.) evaluated: a == 90.| yes Evaluation Count:39 | yes Evaluation Count:64 |
partially evaluated: a == -270.| no Evaluation Count:0 | yes Evaluation Count:64 |
| 0-64 |
| 310 | sina = 1.; executed: sina = 1.;Execution Count:39 | 39 |
| 311 | else if (a == 270. || a == -90.) evaluated: a == 270.| yes Evaluation Count:20 | yes Evaluation Count:44 |
partially evaluated: a == -90.| no Evaluation Count:0 | yes Evaluation Count:44 |
| 0-44 |
| 312 | sina = -1.; executed: sina = -1.;Execution Count:20 | 20 |
| 313 | else if (a == 180.) evaluated: a == 180.| yes Evaluation Count:20 | yes Evaluation Count:24 |
| 20-24 |
| 314 | cosa = -1.; executed: cosa = -1.;Execution Count:20 | 20 |
| 315 | else{ | - |
| 316 | qreal b = deg2rad*a; | - |
| 317 | sina = qSin(b); | - |
| 318 | cosa = qCos(b); | - |
| 319 | } executed: }Execution Count:24 | 24 |
| 320 | qreal tm11 = cosa*_m11 + sina*_m21; | - |
| 321 | qreal tm12 = cosa*_m12 + sina*_m22; | - |
| 322 | qreal tm21 = -sina*_m11 + cosa*_m21; | - |
| 323 | qreal tm22 = -sina*_m12 + cosa*_m22; | - |
| 324 | _m11 = tm11; _m12 = tm12; | - |
| 325 | _m21 = tm21; _m22 = tm22; | - |
| 326 | return *this; executed: return *this;Execution Count:103 | 103 |
| 327 | } | - |
| 328 | QMatrix QMatrix::inverted(bool *invertible) const | - |
| 329 | { | - |
| 330 | qreal dtr = determinant(); | - |
| 331 | if (dtr == 0.0) { partially evaluated: dtr == 0.0| no Evaluation Count:0 | yes Evaluation Count:3295 |
| 0-3295 |
| 332 | if (invertible) never evaluated: invertible | 0 |
| 333 | *invertible = false; never executed: *invertible = false; | 0 |
| 334 | return QMatrix(true); never executed: return QMatrix(true); | 0 |
| 335 | } | - |
| 336 | else { | - |
| 337 | if (invertible) evaluated: invertible| yes Evaluation Count:3292 | yes Evaluation Count:3 |
| 3-3292 |
| 338 | *invertible = true; executed: *invertible = true;Execution Count:3292 | 3292 |
| 339 | qreal dinv = 1.0/dtr; | - |
| 340 | return QMatrix((_m22*dinv), (-_m12*dinv), | 3295 |
| 341 | (-_m21*dinv), (_m11*dinv), | 3295 |
| 342 | ((_m21*_dy - _m22*_dx)*dinv), | 3295 |
| 343 | ((_m12*_dx - _m11*_dy)*dinv), | 3295 |
| 344 | true); executed: return QMatrix((_m22*dinv), (-_m12*dinv), (-_m21*dinv), (_m11*dinv), ((_m21*_dy - _m22*_dx)*dinv), ((_m12*_dx - _m11*_dy)*dinv), true);Execution Count:3295 | 3295 |
| 345 | } | - |
| 346 | } | - |
| 347 | bool QMatrix::operator==(const QMatrix &m) const | - |
| 348 | { | - |
| 349 | return _m11 == m._m11 && | 32 |
| 350 | _m12 == m._m12 && | 32 |
| 351 | _m21 == m._m21 && | 32 |
| 352 | _m22 == m._m22 && | 32 |
| 353 | _dx == m._dx && | 32 |
| 354 | _dy == m._dy; executed: return _m11 == m._m11 && _m12 == m._m12 && _m21 == m._m21 && _m22 == m._m22 && _dx == m._dx && _dy == m._dy;Execution Count:32 | 32 |
| 355 | } | - |
| 356 | bool QMatrix::operator!=(const QMatrix &m) const | - |
| 357 | { | - |
| 358 | return _m11 != m._m11 || | 0 |
| 359 | _m12 != m._m12 || | 0 |
| 360 | _m21 != m._m21 || | 0 |
| 361 | _m22 != m._m22 || | 0 |
| 362 | _dx != m._dx || | 0 |
| 363 | _dy != m._dy; never executed: return _m11 != m._m11 || _m12 != m._m12 || _m21 != m._m21 || _m22 != m._m22 || _dx != m._dx || _dy != m._dy; | 0 |
| 364 | } | - |
| 365 | QMatrix &QMatrix::operator *=(const QMatrix &m) | - |
| 366 | { | - |
| 367 | qreal tm11 = _m11*m._m11 + _m12*m._m21; | - |
| 368 | qreal tm12 = _m11*m._m12 + _m12*m._m22; | - |
| 369 | qreal tm21 = _m21*m._m11 + _m22*m._m21; | - |
| 370 | qreal tm22 = _m21*m._m12 + _m22*m._m22; | - |
| 371 | | - |
| 372 | qreal tdx = _dx*m._m11 + _dy*m._m21 + m._dx; | - |
| 373 | qreal tdy = _dx*m._m12 + _dy*m._m22 + m._dy; | - |
| 374 | | - |
| 375 | _m11 = tm11; _m12 = tm12; | - |
| 376 | _m21 = tm21; _m22 = tm22; | - |
| 377 | _dx = tdx; _dy = tdy; | - |
| 378 | return *this; never executed: return *this; | 0 |
| 379 | } | - |
| 380 | QMatrix QMatrix::operator *(const QMatrix &m) const | - |
| 381 | { | - |
| 382 | qreal tm11 = _m11*m._m11 + _m12*m._m21; | - |
| 383 | qreal tm12 = _m11*m._m12 + _m12*m._m22; | - |
| 384 | qreal tm21 = _m21*m._m11 + _m22*m._m21; | - |
| 385 | qreal tm22 = _m21*m._m12 + _m22*m._m22; | - |
| 386 | | - |
| 387 | qreal tdx = _dx*m._m11 + _dy*m._m21 + m._dx; | - |
| 388 | qreal tdy = _dx*m._m12 + _dy*m._m22 + m._dy; | - |
| 389 | return QMatrix(tm11, tm12, tm21, tm22, tdx, tdy, true); executed: return QMatrix(tm11, tm12, tm21, tm22, tdx, tdy, true);Execution Count:9 | 9 |
| 390 | } | - |
| 391 | | - |
| 392 | | - |
| 393 | | - |
| 394 | | - |
| 395 | QMatrix &QMatrix::operator=(const QMatrix &matrix) | - |
| 396 | { | - |
| 397 | _m11 = matrix._m11; | - |
| 398 | _m12 = matrix._m12; | - |
| 399 | _m21 = matrix._m21; | - |
| 400 | _m22 = matrix._m22; | - |
| 401 | _dx = matrix._dx; | - |
| 402 | _dy = matrix._dy; | - |
| 403 | return *this; executed: return *this;Execution Count:3702 | 3702 |
| 404 | } | - |
| 405 | | - |
| 406 | | - |
| 407 | | - |
| 408 | | - |
| 409 | | - |
| 410 | | - |
| 411 | QMatrix::operator QVariant() const | - |
| 412 | { | - |
| 413 | return QVariant(QVariant::Matrix, this); executed: return QVariant(QVariant::Matrix, this);Execution Count:1 | 1 |
| 414 | } | - |
| 415 | | - |
| 416 | __attribute__((visibility("default"))) QPainterPath operator *(const QPainterPath &p, const QMatrix &m) | - |
| 417 | { | - |
| 418 | return m.map(p); never executed: return m.map(p); | 0 |
| 419 | } | - |
| 420 | QDataStream &operator<<(QDataStream &s, const QMatrix &m) | - |
| 421 | { | - |
| 422 | if (s.version() == 1) { partially evaluated: s.version() == 1| no Evaluation Count:0 | yes Evaluation Count:1 |
| 0-1 |
| 423 | s << (float)m.m11() << (float)m.m12() << (float)m.m21() | - |
| 424 | << (float)m.m22() << (float)m.dx() << (float)m.dy(); | - |
| 425 | } else { | 0 |
| 426 | s << double(m.m11()) | - |
| 427 | << double(m.m12()) | - |
| 428 | << double(m.m21()) | - |
| 429 | << double(m.m22()) | - |
| 430 | << double(m.dx()) | - |
| 431 | << double(m.dy()); | - |
| 432 | } executed: }Execution Count:1 | 1 |
| 433 | return s; executed: return s;Execution Count:1 | 1 |
| 434 | } | - |
| 435 | QDataStream &operator>>(QDataStream &s, QMatrix &m) | - |
| 436 | { | - |
| 437 | if (s.version() == 1) { partially evaluated: s.version() == 1| no Evaluation Count:0 | yes Evaluation Count:2 |
| 0-2 |
| 438 | float m11, m12, m21, m22, dx, dy; | - |
| 439 | s >> m11; s >> m12; s >> m21; s >> m22; | - |
| 440 | s >> dx; s >> dy; | - |
| 441 | m.setMatrix(m11, m12, m21, m22, dx, dy); | - |
| 442 | } | 0 |
| 443 | else { | - |
| 444 | double m11, m12, m21, m22, dx, dy; | - |
| 445 | s >> m11; | - |
| 446 | s >> m12; | - |
| 447 | s >> m21; | - |
| 448 | s >> m22; | - |
| 449 | s >> dx; | - |
| 450 | s >> dy; | - |
| 451 | m.setMatrix(m11, m12, m21, m22, dx, dy); | - |
| 452 | } executed: }Execution Count:2 | 2 |
| 453 | return s; executed: return s;Execution Count:2 | 2 |
| 454 | } | - |
| 455 | | - |
| 456 | | - |
| 457 | | - |
| 458 | QDebug operator<<(QDebug dbg, const QMatrix &m) | - |
| 459 | { | - |
| 460 | dbg.nospace() << "QMatrix(" | - |
| 461 | << "11=" << m.m11() | - |
| 462 | << " 12=" << m.m12() | - |
| 463 | << " 21=" << m.m21() | - |
| 464 | << " 22=" << m.m22() | - |
| 465 | << " dx=" << m.dx() | - |
| 466 | << " dy=" << m.dy() | - |
| 467 | << ')'; | - |
| 468 | return dbg.space(); executed: return dbg.space();Execution Count:1 | 1 |
| 469 | } | - |
| 470 | | - |
| 471 | | - |
| | |