| Line | Source Code | Coverage |
|---|
| 1 | /**************************************************************************** | - |
| 2 | ** | - |
| 3 | ** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). | - |
| 4 | ** Contact: http://www.qt-project.org/legal | - |
| 5 | ** | - |
| 6 | ** This file is part of the QtGui module of the Qt Toolkit. | - |
| 7 | ** | - |
| 8 | ** $QT_BEGIN_LICENSE:LGPL$ | - |
| 9 | ** Commercial License Usage | - |
| 10 | ** Licensees holding valid commercial Qt licenses may use this file in | - |
| 11 | ** accordance with the commercial license agreement provided with the | - |
| 12 | ** Software or, alternatively, in accordance with the terms contained in | - |
| 13 | ** a written agreement between you and Digia. For licensing terms and | - |
| 14 | ** conditions see http://qt.digia.com/licensing. For further information | - |
| 15 | ** use the contact form at http://qt.digia.com/contact-us. | - |
| 16 | ** | - |
| 17 | ** GNU Lesser General Public License Usage | - |
| 18 | ** Alternatively, this file may be used under the terms of the GNU Lesser | - |
| 19 | ** General Public License version 2.1 as published by the Free Software | - |
| 20 | ** Foundation and appearing in the file LICENSE.LGPL included in the | - |
| 21 | ** packaging of this file. Please review the following information to | - |
| 22 | ** ensure the GNU Lesser General Public License version 2.1 requirements | - |
| 23 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. | - |
| 24 | ** | - |
| 25 | ** In addition, as a special exception, Digia gives you certain additional | - |
| 26 | ** rights. These rights are described in the Digia Qt LGPL Exception | - |
| 27 | ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. | - |
| 28 | ** | - |
| 29 | ** GNU General Public License Usage | - |
| 30 | ** Alternatively, this file may be used under the terms of the GNU | - |
| 31 | ** General Public License version 3.0 as published by the Free Software | - |
| 32 | ** Foundation and appearing in the file LICENSE.GPL included in the | - |
| 33 | ** packaging of this file. Please review the following information to | - |
| 34 | ** ensure the GNU General Public License version 3.0 requirements will be | - |
| 35 | ** met: http://www.gnu.org/copyleft/gpl.html. | - |
| 36 | ** | - |
| 37 | ** | - |
| 38 | ** $QT_END_LICENSE$ | - |
| 39 | ** | - |
| 40 | ****************************************************************************/ | - |
| 41 | | - |
| 42 | #include "qcosmeticstroker_p.h" | - |
| 43 | #include "private/qpainterpath_p.h" | - |
| 44 | #include <qdebug.h> | - |
| 45 | #include <math.h> | - |
| 46 | | - |
| 47 | QT_BEGIN_NAMESPACE | - |
| 48 | | - |
| 49 | #if 0 | - |
| 50 | inline QString capString(int caps) | - |
| 51 | { | - |
| 52 | QString str; | - |
| 53 | if (caps & QCosmeticStroker::CapBegin) { | - |
| 54 | str += "CapBegin "; | - |
| 55 | } | - |
| 56 | if (caps & QCosmeticStroker::CapEnd) { | - |
| 57 | str += "CapEnd "; | - |
| 58 | } | - |
| 59 | return str; | - |
| 60 | } | - |
| 61 | #endif | - |
| 62 | | - |
| 63 | #define toF26Dot6(x) ((int)((x)*64.)) | - |
| 64 | | - |
| 65 | static inline uint sourceOver(uint d, uint color) | - |
| 66 | { | - |
| 67 | return color + BYTE_MUL(d, qAlpha(~color)); executed: return color + BYTE_MUL(d, qAlpha(~color));Execution Count:46378 | 46378 |
| 68 | } | - |
| 69 | | - |
| 70 | inline static int F16Dot16FixedDiv(int x, int y) | - |
| 71 | { | - |
| 72 | if (qAbs(x) > 0x7fff) partially evaluated: qAbs(x) > 0x7fff| no Evaluation Count:0 | yes Evaluation Count:152545 |
| 0-152545 |
| 73 | return (((qlonglong)x) << 16) / y; never executed: return (((qlonglong)x) << 16) / y; | 0 |
| 74 | return (x << 16) / y; executed: return (x << 16) / y;Execution Count:152545 | 152545 |
| 75 | } | - |
| 76 | | - |
| 77 | typedef void (*DrawPixel)(QCosmeticStroker *stroker, int x, int y, int coverage); | - |
| 78 | | - |
| 79 | namespace { | - |
| 80 | | - |
| 81 | struct Dasher { | - |
| 82 | QCosmeticStroker *stroker; | - |
| 83 | int *pattern; | - |
| 84 | int offset; | - |
| 85 | int dashIndex; | - |
| 86 | int dashOn; | - |
| 87 | | - |
| 88 | Dasher(QCosmeticStroker *s, bool reverse, int start, int stop) | - |
| 89 | : stroker(s) | - |
| 90 | { | - |
| 91 | int delta = stop - start; executed (the execution status of this line is deduced): int delta = stop - start; | - |
| 92 | if (reverse) { evaluated: reverse| yes Evaluation Count:8 | yes Evaluation Count:10 |
| 8-10 |
| 93 | pattern = stroker->reversePattern; executed (the execution status of this line is deduced): pattern = stroker->reversePattern; | - |
| 94 | offset = stroker->patternLength - stroker->patternOffset - delta - ((start & 63) - 32); executed (the execution status of this line is deduced): offset = stroker->patternLength - stroker->patternOffset - delta - ((start & 63) - 32); | - |
| 95 | dashOn = 0; executed (the execution status of this line is deduced): dashOn = 0; | - |
| 96 | } else { executed: }Execution Count:8 | 8 |
| 97 | pattern = stroker->pattern; executed (the execution status of this line is deduced): pattern = stroker->pattern; | - |
| 98 | offset = stroker->patternOffset - ((start & 63) - 32); executed (the execution status of this line is deduced): offset = stroker->patternOffset - ((start & 63) - 32); | - |
| 99 | dashOn = 1; executed (the execution status of this line is deduced): dashOn = 1; | - |
| 100 | } executed: }Execution Count:10 | 10 |
| 101 | offset %= stroker->patternLength; executed (the execution status of this line is deduced): offset %= stroker->patternLength; | - |
| 102 | if (offset < 0) evaluated: offset < 0| yes Evaluation Count:8 | yes Evaluation Count:10 |
| 8-10 |
| 103 | offset += stroker->patternLength; executed: offset += stroker->patternLength;Execution Count:8 | 8 |
| 104 | | - |
| 105 | dashIndex = 0; executed (the execution status of this line is deduced): dashIndex = 0; | - |
| 106 | while (offset>= pattern[dashIndex]) evaluated: offset>= pattern[dashIndex]| yes Evaluation Count:2 | yes Evaluation Count:18 |
| 2-18 |
| 107 | ++dashIndex; executed: ++dashIndex;Execution Count:2 | 2 |
| 108 | | - |
| 109 | // qDebug() << " dasher" << offset/64. << reverse << dashIndex; | - |
| 110 | stroker->patternOffset += delta; executed (the execution status of this line is deduced): stroker->patternOffset += delta; | - |
| 111 | stroker->patternOffset %= stroker->patternLength; executed (the execution status of this line is deduced): stroker->patternOffset %= stroker->patternLength; | - |
| 112 | } executed: }Execution Count:18 | 18 |
| 113 | | - |
| 114 | bool on() const { | - |
| 115 | return (dashIndex + dashOn) & 1; executed: return (dashIndex + dashOn) & 1;Execution Count:618 | 618 |
| 116 | } | - |
| 117 | void adjust() { | - |
| 118 | offset += 64; executed (the execution status of this line is deduced): offset += 64; | - |
| 119 | if (offset >= pattern[dashIndex]) { evaluated: offset >= pattern[dashIndex]| yes Evaluation Count:202 | yes Evaluation Count:416 |
| 202-416 |
| 120 | ++dashIndex; executed (the execution status of this line is deduced): ++dashIndex; | - |
| 121 | dashIndex %= stroker->patternSize; executed (the execution status of this line is deduced): dashIndex %= stroker->patternSize; | - |
| 122 | } executed: }Execution Count:202 | 202 |
| 123 | offset %= stroker->patternLength; executed (the execution status of this line is deduced): offset %= stroker->patternLength; | - |
| 124 | // qDebug() << "dasher.adjust" << offset/64. << dashIndex; | - |
| 125 | } executed: }Execution Count:618 | 618 |
| 126 | }; | - |
| 127 | | - |
| 128 | struct NoDasher { | - |
| 129 | NoDasher(QCosmeticStroker *, bool, int, int) {} | - |
| 130 | bool on() const { return true; } executed: return true;Execution Count:7493218 | 7493218 |
| 131 | void adjust(int = 0) {} | - |
| 132 | }; | - |
| 133 | | - |
| 134 | }; | - |
| 135 | | - |
| 136 | template<DrawPixel drawPixel, class Dasher> | - |
| 137 | static void drawLine(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); | - |
| 138 | template<DrawPixel drawPixel, class Dasher> | - |
| 139 | static void drawLineAA(QCosmeticStroker *stroker, qreal x1, qreal y1, qreal x2, qreal y2, int caps); | - |
| 140 | | - |
| 141 | inline void drawPixel(QCosmeticStroker *stroker, int x, int y, int coverage) | - |
| 142 | { | - |
| 143 | const QRect &cl = stroker->clip; executed (the execution status of this line is deduced): const QRect &cl = stroker->clip; | - |
| 144 | if (x < cl.x() || x > cl.right() || y < cl.y() || y > cl.bottom()) evaluated: x < cl.x()| yes Evaluation Count:64154 | yes Evaluation Count:7427907 |
evaluated: x > cl.right()| yes Evaluation Count:179541 | yes Evaluation Count:7248366 |
evaluated: y < cl.y()| yes Evaluation Count:33043 | yes Evaluation Count:7215323 |
evaluated: y > cl.bottom()| yes Evaluation Count:98303 | yes Evaluation Count:7117020 |
| 33043-7427907 |
| 145 | return; executed: return;Execution Count:375041 | 375041 |
| 146 | | - |
| 147 | int lastx = stroker->spans[stroker->current_span-1].x + stroker->spans[stroker->current_span-1].len ; executed (the execution status of this line is deduced): int lastx = stroker->spans[stroker->current_span-1].x + stroker->spans[stroker->current_span-1].len ; | - |
| 148 | int lasty = stroker->spans[stroker->current_span-1].y; executed (the execution status of this line is deduced): int lasty = stroker->spans[stroker->current_span-1].y; | - |
| 149 | | - |
| 150 | if (stroker->current_span == QCosmeticStroker::NSPANS || y < lasty || (y == lasty && x < lastx)) { evaluated: stroker->current_span == QCosmeticStroker::NSPANS| yes Evaluation Count:5995 | yes Evaluation Count:7111025 |
evaluated: y < lasty| yes Evaluation Count:101491 | yes Evaluation Count:7009534 |
evaluated: y == lasty| yes Evaluation Count:4441238 | yes Evaluation Count:2568296 |
evaluated: x < lastx| yes Evaluation Count:1378 | yes Evaluation Count:4439860 |
| 1378-7111025 |
| 151 | stroker->blend(stroker->current_span, stroker->spans, &stroker->state->penData); executed (the execution status of this line is deduced): stroker->blend(stroker->current_span, stroker->spans, &stroker->state->penData); | - |
| 152 | stroker->current_span = 0; executed (the execution status of this line is deduced): stroker->current_span = 0; | - |
| 153 | } executed: }Execution Count:108864 | 108864 |
| 154 | | - |
| 155 | stroker->spans[stroker->current_span].x = ushort(x); executed (the execution status of this line is deduced): stroker->spans[stroker->current_span].x = ushort(x); | - |
| 156 | stroker->spans[stroker->current_span].len = 1; executed (the execution status of this line is deduced): stroker->spans[stroker->current_span].len = 1; | - |
| 157 | stroker->spans[stroker->current_span].y = y; executed (the execution status of this line is deduced): stroker->spans[stroker->current_span].y = y; | - |
| 158 | stroker->spans[stroker->current_span].coverage = coverage*stroker->opacity >> 8; executed (the execution status of this line is deduced): stroker->spans[stroker->current_span].coverage = coverage*stroker->opacity >> 8; | - |
| 159 | ++stroker->current_span; executed (the execution status of this line is deduced): ++stroker->current_span; | - |
| 160 | } executed: }Execution Count:7117020 | 7117020 |
| 161 | | - |
| 162 | inline void drawPixelARGB32(QCosmeticStroker *stroker, int x, int y, int coverage) | - |
| 163 | { | - |
| 164 | const QRect &cl = stroker->clip; executed (the execution status of this line is deduced): const QRect &cl = stroker->clip; | - |
| 165 | if (x < cl.x() || x > cl.right() || y < cl.y() || y > cl.bottom()) evaluated: x < cl.x()| yes Evaluation Count:3150 | yes Evaluation Count:33982 |
evaluated: x > cl.right()| yes Evaluation Count:2256 | yes Evaluation Count:31726 |
evaluated: y < cl.y()| yes Evaluation Count:1866 | yes Evaluation Count:29860 |
evaluated: y > cl.bottom()| yes Evaluation Count:2054 | yes Evaluation Count:27806 |
| 1866-33982 |
| 166 | return; executed: return;Execution Count:9326 | 9326 |
| 167 | | - |
| 168 | int offset = x + stroker->ppl*y; executed (the execution status of this line is deduced): int offset = x + stroker->ppl*y; | - |
| 169 | uint c = BYTE_MUL(stroker->color, coverage); executed (the execution status of this line is deduced): uint c = BYTE_MUL(stroker->color, coverage); | - |
| 170 | stroker->pixels[offset] = sourceOver(stroker->pixels[offset], c); executed (the execution status of this line is deduced): stroker->pixels[offset] = sourceOver(stroker->pixels[offset], c); | - |
| 171 | } executed: }Execution Count:27806 | 27806 |
| 172 | | - |
| 173 | inline void drawPixelARGB32Opaque(QCosmeticStroker *stroker, int x, int y, int) | - |
| 174 | { | - |
| 175 | const QRect &cl = stroker->clip; executed (the execution status of this line is deduced): const QRect &cl = stroker->clip; | - |
| 176 | if (x < cl.x() || x > cl.right() || y < cl.y() || y > cl.bottom()) evaluated: x < cl.x()| yes Evaluation Count:76 | yes Evaluation Count:21528 |
evaluated: x > cl.right()| yes Evaluation Count:1528 | yes Evaluation Count:20000 |
evaluated: y < cl.y()| yes Evaluation Count:24 | yes Evaluation Count:19976 |
evaluated: y > cl.bottom()| yes Evaluation Count:1404 | yes Evaluation Count:18572 |
| 24-21528 |
| 177 | return; executed: return;Execution Count:3032 | 3032 |
| 178 | | - |
| 179 | int offset = x + stroker->ppl*y; executed (the execution status of this line is deduced): int offset = x + stroker->ppl*y; | - |
| 180 | stroker->pixels[offset] = sourceOver(stroker->pixels[offset], stroker->color); executed (the execution status of this line is deduced): stroker->pixels[offset] = sourceOver(stroker->pixels[offset], stroker->color); | - |
| 181 | } executed: }Execution Count:18572 | 18572 |
| 182 | | - |
| 183 | enum StrokeSelection { | - |
| 184 | Aliased = 0, | - |
| 185 | AntiAliased = 1, | - |
| 186 | Solid = 0, | - |
| 187 | Dashed = 2, | - |
| 188 | RegularDraw = 0, | - |
| 189 | FastDraw = 4 | - |
| 190 | }; | - |
| 191 | | - |
| 192 | static StrokeLine strokeLine(int strokeSelection) | - |
| 193 | { | - |
| 194 | StrokeLine stroke; executed (the execution status of this line is deduced): StrokeLine stroke; | - |
| 195 | | - |
| 196 | switch (strokeSelection) { | - |
| 197 | case Aliased|Solid|RegularDraw: | - |
| 198 | stroke = &QT_PREPEND_NAMESPACE(drawLine)<drawPixel, NoDasher>; executed (the execution status of this line is deduced): stroke = &::drawLine<drawPixel, NoDasher>; | - |
| 199 | break; executed: break;Execution Count:71033 | 71033 |
| 200 | case Aliased|Solid|FastDraw: | - |
| 201 | stroke = &QT_PREPEND_NAMESPACE(drawLine)<drawPixelARGB32Opaque, NoDasher>; executed (the execution status of this line is deduced): stroke = &::drawLine<drawPixelARGB32Opaque, NoDasher>; | - |
| 202 | break; executed: break;Execution Count:248 | 248 |
| 203 | case Aliased|Dashed|RegularDraw: | - |
| 204 | stroke = &QT_PREPEND_NAMESPACE(drawLine)<drawPixel, Dasher>; executed (the execution status of this line is deduced): stroke = &::drawLine<drawPixel, Dasher>; | - |
| 205 | break; executed: break;Execution Count:19 | 19 |
| 206 | case Aliased|Dashed|FastDraw: | - |
| 207 | stroke = &QT_PREPEND_NAMESPACE(drawLine)<drawPixelARGB32Opaque, Dasher>; executed (the execution status of this line is deduced): stroke = &::drawLine<drawPixelARGB32Opaque, Dasher>; | - |
| 208 | break; executed: break;Execution Count:4 | 4 |
| 209 | case AntiAliased|Solid|RegularDraw: | - |
| 210 | stroke = &QT_PREPEND_NAMESPACE(drawLineAA)<drawPixel, NoDasher>; executed (the execution status of this line is deduced): stroke = &::drawLineAA<drawPixel, NoDasher>; | - |
| 211 | break; executed: break;Execution Count:177 | 177 |
| 212 | case AntiAliased|Solid|FastDraw: | - |
| 213 | stroke = &QT_PREPEND_NAMESPACE(drawLineAA)<drawPixelARGB32, NoDasher>; executed (the execution status of this line is deduced): stroke = &::drawLineAA<drawPixelARGB32, NoDasher>; | - |
| 214 | break; executed: break;Execution Count:219 | 219 |
| 215 | case AntiAliased|Dashed|RegularDraw: | - |
| 216 | stroke = &QT_PREPEND_NAMESPACE(drawLineAA)<drawPixel, Dasher>; never executed (the execution status of this line is deduced): stroke = &::drawLineAA<drawPixel, Dasher>; | - |
| 217 | break; | 0 |
| 218 | case AntiAliased|Dashed|FastDraw: | - |
| 219 | stroke = &QT_PREPEND_NAMESPACE(drawLineAA)<drawPixelARGB32, Dasher>; never executed (the execution status of this line is deduced): stroke = &::drawLineAA<drawPixelARGB32, Dasher>; | - |
| 220 | break; | 0 |
| 221 | default: | - |
| 222 | Q_ASSERT(false); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 223 | stroke = 0; never executed (the execution status of this line is deduced): stroke = 0; | - |
| 224 | } | 0 |
| 225 | return stroke; executed: return stroke;Execution Count:71700 | 71700 |
| 226 | } | - |
| 227 | | - |
| 228 | void QCosmeticStroker::setup() | - |
| 229 | { | - |
| 230 | blend = state->penData.blend; executed (the execution status of this line is deduced): blend = state->penData.blend; | - |
| 231 | if (state->clip && state->clip->enabled && state->clip->hasRectClip && !state->clip->clipRect.isEmpty()) { evaluated: state->clip| yes Evaluation Count:9194 | yes Evaluation Count:62506 |
partially evaluated: state->clip->enabled| yes Evaluation Count:9194 | no Evaluation Count:0 |
evaluated: state->clip->hasRectClip| yes Evaluation Count:8526 | yes Evaluation Count:668 |
partially evaluated: !state->clip->clipRect.isEmpty()| yes Evaluation Count:8526 | no Evaluation Count:0 |
| 0-62506 |
| 232 | clip &= state->clip->clipRect; executed (the execution status of this line is deduced): clip &= state->clip->clipRect; | - |
| 233 | blend = state->penData.unclipped_blend; executed (the execution status of this line is deduced): blend = state->penData.unclipped_blend; | - |
| 234 | } executed: }Execution Count:8526 | 8526 |
| 235 | | - |
| 236 | int strokeSelection = 0; executed (the execution status of this line is deduced): int strokeSelection = 0; | - |
| 237 | if (blend == state->penData.unclipped_blend evaluated: blend == state->penData.unclipped_blend| yes Evaluation Count:8526 | yes Evaluation Count:63174 |
| 8526-63174 |
| 238 | && state->penData.type == QSpanData::Solid evaluated: state->penData.type == QSpanData::Solid| yes Evaluation Count:8520 | yes Evaluation Count:6 |
| 6-8520 |
| 239 | && (state->penData.rasterBuffer->format == QImage::Format_ARGB32_Premultiplied evaluated: state->penData.rasterBuffer->format == QImage::Format_ARGB32_Premultiplied| yes Evaluation Count:442 | yes Evaluation Count:8078 |
| 442-8078 |
| 240 | || state->penData.rasterBuffer->format == QImage::Format_RGB32) evaluated: state->penData.rasterBuffer->format == QImage::Format_RGB32| yes Evaluation Count:29 | yes Evaluation Count:8049 |
| 29-8049 |
| 241 | && state->compositionMode() == QPainter::CompositionMode_SourceOver) partially evaluated: state->compositionMode() == QPainter::CompositionMode_SourceOver| yes Evaluation Count:471 | no Evaluation Count:0 |
| 0-471 |
| 242 | strokeSelection |= FastDraw; executed: strokeSelection |= FastDraw;Execution Count:471 | 471 |
| 243 | | - |
| 244 | if (state->renderHints & QPainter::Antialiasing) evaluated: state->renderHints & QPainter::Antialiasing| yes Evaluation Count:396 | yes Evaluation Count:71304 |
| 396-71304 |
| 245 | strokeSelection |= AntiAliased; executed: strokeSelection |= AntiAliased;Execution Count:396 | 396 |
| 246 | | - |
| 247 | const QVector<qreal> &penPattern = state->lastPen.dashPattern(); executed (the execution status of this line is deduced): const QVector<qreal> &penPattern = state->lastPen.dashPattern(); | - |
| 248 | if (penPattern.isEmpty()) { evaluated: penPattern.isEmpty()| yes Evaluation Count:71677 | yes Evaluation Count:23 |
| 23-71677 |
| 249 | Q_ASSERT(!pattern && !reversePattern); executed (the execution status of this line is deduced): qt_noop(); | - |
| 250 | pattern = 0; executed (the execution status of this line is deduced): pattern = 0; | - |
| 251 | reversePattern = 0; executed (the execution status of this line is deduced): reversePattern = 0; | - |
| 252 | patternLength = 0; executed (the execution status of this line is deduced): patternLength = 0; | - |
| 253 | patternSize = 0; executed (the execution status of this line is deduced): patternSize = 0; | - |
| 254 | } else { executed: }Execution Count:71677 | 71677 |
| 255 | pattern = (int *)malloc(penPattern.size()*sizeof(int)); executed (the execution status of this line is deduced): pattern = (int *)malloc(penPattern.size()*sizeof(int)); | - |
| 256 | reversePattern = (int *)malloc(penPattern.size()*sizeof(int)); executed (the execution status of this line is deduced): reversePattern = (int *)malloc(penPattern.size()*sizeof(int)); | - |
| 257 | patternSize = penPattern.size(); executed (the execution status of this line is deduced): patternSize = penPattern.size(); | - |
| 258 | | - |
| 259 | patternLength = 0; executed (the execution status of this line is deduced): patternLength = 0; | - |
| 260 | for (int i = 0; i < patternSize; ++i) { evaluated: i < patternSize| yes Evaluation Count:46 | yes Evaluation Count:23 |
| 23-46 |
| 261 | patternLength += (int) qMax(1. , penPattern.at(i)*64.); executed (the execution status of this line is deduced): patternLength += (int) qMax(1. , penPattern.at(i)*64.); | - |
| 262 | pattern[i] = patternLength; executed (the execution status of this line is deduced): pattern[i] = patternLength; | - |
| 263 | } executed: }Execution Count:46 | 46 |
| 264 | patternLength = 0; executed (the execution status of this line is deduced): patternLength = 0; | - |
| 265 | for (int i = 0; i < patternSize; ++i) { evaluated: i < patternSize| yes Evaluation Count:46 | yes Evaluation Count:23 |
| 23-46 |
| 266 | patternLength += (int) qMax(1., penPattern.at(patternSize - 1 - i)*64.); executed (the execution status of this line is deduced): patternLength += (int) qMax(1., penPattern.at(patternSize - 1 - i)*64.); | - |
| 267 | reversePattern[i] = patternLength; executed (the execution status of this line is deduced): reversePattern[i] = patternLength; | - |
| 268 | } executed: }Execution Count:46 | 46 |
| 269 | strokeSelection |= Dashed; executed (the execution status of this line is deduced): strokeSelection |= Dashed; | - |
| 270 | // qDebug() << "setup: size=" << patternSize << "length=" << patternLength/64.; | - |
| 271 | } executed: }Execution Count:23 | 23 |
| 272 | | - |
| 273 | stroke = strokeLine(strokeSelection); executed (the execution status of this line is deduced): stroke = strokeLine(strokeSelection); | - |
| 274 | | - |
| 275 | qreal width = state->lastPen.widthF(); executed (the execution status of this line is deduced): qreal width = state->lastPen.widthF(); | - |
| 276 | if (width == 0) evaluated: width == 0| yes Evaluation Count:1879 | yes Evaluation Count:69821 |
| 1879-69821 |
| 277 | opacity = 256; executed: opacity = 256;Execution Count:1879 | 1879 |
| 278 | else if (qt_pen_is_cosmetic(state->lastPen, state->renderHints)) evaluated: qt_pen_is_cosmetic(state->lastPen, state->renderHints)| yes Evaluation Count:990 | yes Evaluation Count:68831 |
| 990-68831 |
| 279 | opacity = (int) 256*width; executed: opacity = (int) 256*width;Execution Count:990 | 990 |
| 280 | else | - |
| 281 | opacity = (int) 256*width*state->txscale; executed: opacity = (int) 256*width*state->txscale;Execution Count:68831 | 68831 |
| 282 | opacity = qBound(0, opacity, 256); executed (the execution status of this line is deduced): opacity = qBound(0, opacity, 256); | - |
| 283 | | - |
| 284 | drawCaps = state->lastPen.capStyle() != Qt::FlatCap; executed (the execution status of this line is deduced): drawCaps = state->lastPen.capStyle() != Qt::FlatCap; | - |
| 285 | | - |
| 286 | if (strokeSelection & FastDraw) { evaluated: strokeSelection & FastDraw| yes Evaluation Count:471 | yes Evaluation Count:71229 |
| 471-71229 |
| 287 | color = INTERPOLATE_PIXEL_256(state->penData.solid.color, opacity, 0, 0); executed (the execution status of this line is deduced): color = INTERPOLATE_PIXEL_256(state->penData.solid.color, opacity, 0, 0); | - |
| 288 | QRasterBuffer *buffer = state->penData.rasterBuffer; executed (the execution status of this line is deduced): QRasterBuffer *buffer = state->penData.rasterBuffer; | - |
| 289 | pixels = (uint *)buffer->buffer(); executed (the execution status of this line is deduced): pixels = (uint *)buffer->buffer(); | - |
| 290 | ppl = buffer->bytesPerLine()>>2; executed (the execution status of this line is deduced): ppl = buffer->bytesPerLine()>>2; | - |
| 291 | } executed: }Execution Count:471 | 471 |
| 292 | | - |
| 293 | // line drawing produces different results with different clips, so | - |
| 294 | // we need to clip consistently when painting to the same device | - |
| 295 | | - |
| 296 | // setup FP clip bounds | - |
| 297 | xmin = deviceRect.left() - 1; executed (the execution status of this line is deduced): xmin = deviceRect.left() - 1; | - |
| 298 | xmax = deviceRect.right() + 2; executed (the execution status of this line is deduced): xmax = deviceRect.right() + 2; | - |
| 299 | ymin = deviceRect.top() - 1; executed (the execution status of this line is deduced): ymin = deviceRect.top() - 1; | - |
| 300 | ymax = deviceRect.bottom() + 2; executed (the execution status of this line is deduced): ymax = deviceRect.bottom() + 2; | - |
| 301 | | - |
| 302 | lastPixel.x = -1; executed (the execution status of this line is deduced): lastPixel.x = -1; | - |
| 303 | } executed: }Execution Count:71700 | 71700 |
| 304 | | - |
| 305 | // returns true if the whole line gets clipped away | - |
| 306 | bool QCosmeticStroker::clipLine(qreal &x1, qreal &y1, qreal &x2, qreal &y2) | - |
| 307 | { | - |
| 308 | // basic/rough clipping is done in floating point coordinates to avoid | - |
| 309 | // integer overflow problems. | - |
| 310 | if (x1 < xmin) { evaluated: x1 < xmin| yes Evaluation Count:141 | yes Evaluation Count:155156 |
| 141-155156 |
| 311 | if (x2 <= xmin) evaluated: x2 <= xmin| yes Evaluation Count:69 | yes Evaluation Count:72 |
| 69-72 |
| 312 | goto clipped; executed: goto clipped;Execution Count:69 | 69 |
| 313 | y1 += (y2 - y1)/(x2 - x1) * (xmin - x1); executed (the execution status of this line is deduced): y1 += (y2 - y1)/(x2 - x1) * (xmin - x1); | - |
| 314 | x1 = xmin; executed (the execution status of this line is deduced): x1 = xmin; | - |
| 315 | } else if (x1 > xmax) { executed: }Execution Count:72 evaluated: x1 > xmax| yes Evaluation Count:1196 | yes Evaluation Count:153960 |
| 72-153960 |
| 316 | if (x2 >= xmax) evaluated: x2 >= xmax| yes Evaluation Count:1177 | yes Evaluation Count:19 |
| 19-1177 |
| 317 | goto clipped; executed: goto clipped;Execution Count:1177 | 1177 |
| 318 | y1 += (y2 - y1)/(x2 - x1) * (xmax - x1); executed (the execution status of this line is deduced): y1 += (y2 - y1)/(x2 - x1) * (xmax - x1); | - |
| 319 | x1 = xmax; executed (the execution status of this line is deduced): x1 = xmax; | - |
| 320 | } executed: }Execution Count:19 | 19 |
| 321 | if (x2 < xmin) { evaluated: x2 < xmin| yes Evaluation Count:23 | yes Evaluation Count:154028 |
| 23-154028 |
| 322 | lastPixel.x = -1; executed (the execution status of this line is deduced): lastPixel.x = -1; | - |
| 323 | y2 += (y2 - y1)/(x2 - x1) * (xmin - x2); executed (the execution status of this line is deduced): y2 += (y2 - y1)/(x2 - x1) * (xmin - x2); | - |
| 324 | x2 = xmin; executed (the execution status of this line is deduced): x2 = xmin; | - |
| 325 | } else if (x2 > xmax) { executed: }Execution Count:23 evaluated: x2 > xmax| yes Evaluation Count:1135 | yes Evaluation Count:152893 |
| 23-152893 |
| 326 | lastPixel.x = -1; executed (the execution status of this line is deduced): lastPixel.x = -1; | - |
| 327 | y2 += (y2 - y1)/(x2 - x1) * (xmax - x2); executed (the execution status of this line is deduced): y2 += (y2 - y1)/(x2 - x1) * (xmax - x2); | - |
| 328 | x2 = xmax; executed (the execution status of this line is deduced): x2 = xmax; | - |
| 329 | } executed: }Execution Count:1135 | 1135 |
| 330 | | - |
| 331 | if (y1 < ymin) { evaluated: y1 < ymin| yes Evaluation Count:138 | yes Evaluation Count:153913 |
| 138-153913 |
| 332 | if (y2 <= ymin) evaluated: y2 <= ymin| yes Evaluation Count:103 | yes Evaluation Count:35 |
| 35-103 |
| 333 | goto clipped; executed: goto clipped;Execution Count:103 | 103 |
| 334 | x1 += (x2 - x1)/(y2 - y1) * (ymin - y1); executed (the execution status of this line is deduced): x1 += (x2 - x1)/(y2 - y1) * (ymin - y1); | - |
| 335 | y1 = ymin; executed (the execution status of this line is deduced): y1 = ymin; | - |
| 336 | } else if (y1 > ymax) { executed: }Execution Count:35 evaluated: y1 > ymax| yes Evaluation Count:2091 | yes Evaluation Count:151822 |
| 35-151822 |
| 337 | if (y2 >= ymax) evaluated: y2 >= ymax| yes Evaluation Count:1173 | yes Evaluation Count:918 |
| 918-1173 |
| 338 | goto clipped; executed: goto clipped;Execution Count:1173 | 1173 |
| 339 | x1 += (x2 - x1)/(y2 - y1) * (ymax - y1); executed (the execution status of this line is deduced): x1 += (x2 - x1)/(y2 - y1) * (ymax - y1); | - |
| 340 | y1 = ymax; executed (the execution status of this line is deduced): y1 = ymax; | - |
| 341 | } executed: }Execution Count:918 | 918 |
| 342 | if (y2 < ymin) { evaluated: y2 < ymin| yes Evaluation Count:70 | yes Evaluation Count:152705 |
| 70-152705 |
| 343 | lastPixel.x = -1; executed (the execution status of this line is deduced): lastPixel.x = -1; | - |
| 344 | x2 += (x2 - x1)/(y2 - y1) * (ymin - y2); executed (the execution status of this line is deduced): x2 += (x2 - x1)/(y2 - y1) * (ymin - y2); | - |
| 345 | y2 = ymin; executed (the execution status of this line is deduced): y2 = ymin; | - |
| 346 | } else if (y2 > ymax) { executed: }Execution Count:70 evaluated: y2 > ymax| yes Evaluation Count:85 | yes Evaluation Count:152620 |
| 70-152620 |
| 347 | lastPixel.x = -1; executed (the execution status of this line is deduced): lastPixel.x = -1; | - |
| 348 | x2 += (x2 - x1)/(y2 - y1) * (ymax - y2); executed (the execution status of this line is deduced): x2 += (x2 - x1)/(y2 - y1) * (ymax - y2); | - |
| 349 | y2 = ymax; executed (the execution status of this line is deduced): y2 = ymax; | - |
| 350 | } executed: }Execution Count:85 | 85 |
| 351 | | - |
| 352 | return false; executed: return false;Execution Count:152775 | 152775 |
| 353 | | - |
| 354 | clipped: | - |
| 355 | lastPixel.x = -1; executed (the execution status of this line is deduced): lastPixel.x = -1; | - |
| 356 | return true; executed: return true;Execution Count:2522 | 2522 |
| 357 | } | - |
| 358 | | - |
| 359 | | - |
| 360 | void QCosmeticStroker::drawLine(const QPointF &p1, const QPointF &p2) | - |
| 361 | { | - |
| 362 | if (p1 == p2) { evaluated: p1 == p2| yes Evaluation Count:81 | yes Evaluation Count:6447 |
| 81-6447 |
| 363 | drawPoints(&p1, 1); executed (the execution status of this line is deduced): drawPoints(&p1, 1); | - |
| 364 | return; executed: return;Execution Count:81 | 81 |
| 365 | } | - |
| 366 | | - |
| 367 | QPointF start = p1 * state->matrix; executed (the execution status of this line is deduced): QPointF start = p1 * state->matrix; | - |
| 368 | QPointF end = p2 * state->matrix; executed (the execution status of this line is deduced): QPointF end = p2 * state->matrix; | - |
| 369 | | - |
| 370 | patternOffset = state->lastPen.dashOffset()*64; executed (the execution status of this line is deduced): patternOffset = state->lastPen.dashOffset()*64; | - |
| 371 | lastPixel.x = -1; executed (the execution status of this line is deduced): lastPixel.x = -1; | - |
| 372 | | - |
| 373 | stroke(this, start.x(), start.y(), end.x(), end.y(), drawCaps ? CapBegin|CapEnd : 0); executed (the execution status of this line is deduced): stroke(this, start.x(), start.y(), end.x(), end.y(), drawCaps ? CapBegin|CapEnd : 0); | - |
| 374 | | - |
| 375 | blend(current_span, spans, &state->penData); executed (the execution status of this line is deduced): blend(current_span, spans, &state->penData); | - |
| 376 | current_span = 0; executed (the execution status of this line is deduced): current_span = 0; | - |
| 377 | } executed: }Execution Count:6447 | 6447 |
| 378 | | - |
| 379 | void QCosmeticStroker::drawPoints(const QPoint *points, int num) | - |
| 380 | { | - |
| 381 | const QPoint *end = points + num; executed (the execution status of this line is deduced): const QPoint *end = points + num; | - |
| 382 | while (points < end) { evaluated: points < end| yes Evaluation Count:143 | yes Evaluation Count:135 |
| 135-143 |
| 383 | QPointF p = QPointF(*points) * state->matrix; executed (the execution status of this line is deduced): QPointF p = QPointF(*points) * state->matrix; | - |
| 384 | drawPixel(this, qRound(p.x()), qRound(p.y()), 255); executed (the execution status of this line is deduced): drawPixel(this, qRound(p.x()), qRound(p.y()), 255); | - |
| 385 | ++points; executed (the execution status of this line is deduced): ++points; | - |
| 386 | } executed: }Execution Count:143 | 143 |
| 387 | | - |
| 388 | blend(current_span, spans, &state->penData); executed (the execution status of this line is deduced): blend(current_span, spans, &state->penData); | - |
| 389 | current_span = 0; executed (the execution status of this line is deduced): current_span = 0; | - |
| 390 | } executed: }Execution Count:135 | 135 |
| 391 | | - |
| 392 | void QCosmeticStroker::drawPoints(const QPointF *points, int num) | - |
| 393 | { | - |
| 394 | const QPointF *end = points + num; executed (the execution status of this line is deduced): const QPointF *end = points + num; | - |
| 395 | while (points < end) { evaluated: points < end| yes Evaluation Count:81 | yes Evaluation Count:81 |
| 81 |
| 396 | QPointF p = (*points) * state->matrix; executed (the execution status of this line is deduced): QPointF p = (*points) * state->matrix; | - |
| 397 | drawPixel(this, qRound(p.x()), qRound(p.y()), 255); executed (the execution status of this line is deduced): drawPixel(this, qRound(p.x()), qRound(p.y()), 255); | - |
| 398 | ++points; executed (the execution status of this line is deduced): ++points; | - |
| 399 | } executed: }Execution Count:81 | 81 |
| 400 | | - |
| 401 | blend(current_span, spans, &state->penData); executed (the execution status of this line is deduced): blend(current_span, spans, &state->penData); | - |
| 402 | current_span = 0; executed (the execution status of this line is deduced): current_span = 0; | - |
| 403 | } executed: }Execution Count:81 | 81 |
| 404 | | - |
| 405 | void QCosmeticStroker::calculateLastPoint(qreal rx1, qreal ry1, qreal rx2, qreal ry2) | - |
| 406 | { | - |
| 407 | // this is basically the same code as used in the aliased stroke method, | - |
| 408 | // but it only determines the direction and last point of a line | - |
| 409 | // | - |
| 410 | // This is being used to have proper dropout control for closed contours | - |
| 411 | // by calculating the direction and last pixel of the last segment in the contour. | - |
| 412 | // the info is then used to perform dropout control when drawing the first line segment | - |
| 413 | // of the contour | - |
| 414 | lastPixel.x = -1; executed (the execution status of this line is deduced): lastPixel.x = -1; | - |
| 415 | lastPixel.y = -1; executed (the execution status of this line is deduced): lastPixel.y = -1; | - |
| 416 | | - |
| 417 | if (clipLine(rx1, ry1, rx2, ry2)) evaluated: clipLine(rx1, ry1, rx2, ry2)| yes Evaluation Count:42 | yes Evaluation Count:4245 |
| 42-4245 |
| 418 | return; executed: return;Execution Count:42 | 42 |
| 419 | | - |
| 420 | const int half = legacyRounding ? 31 : 0; evaluated: legacyRounding| yes Evaluation Count:834 | yes Evaluation Count:3411 |
| 834-3411 |
| 421 | int x1 = toF26Dot6(rx1) + half; executed (the execution status of this line is deduced): int x1 = ((int)((rx1)*64.)) + half; | - |
| 422 | int y1 = toF26Dot6(ry1) + half; executed (the execution status of this line is deduced): int y1 = ((int)((ry1)*64.)) + half; | - |
| 423 | int x2 = toF26Dot6(rx2) + half; executed (the execution status of this line is deduced): int x2 = ((int)((rx2)*64.)) + half; | - |
| 424 | int y2 = toF26Dot6(ry2) + half; executed (the execution status of this line is deduced): int y2 = ((int)((ry2)*64.)) + half; | - |
| 425 | | - |
| 426 | int dx = qAbs(x2 - x1); executed (the execution status of this line is deduced): int dx = qAbs(x2 - x1); | - |
| 427 | int dy = qAbs(y2 - y1); executed (the execution status of this line is deduced): int dy = qAbs(y2 - y1); | - |
| 428 | | - |
| 429 | if (dx < dy) { evaluated: dx < dy| yes Evaluation Count:2891 | yes Evaluation Count:1354 |
| 1354-2891 |
| 430 | // vertical | - |
| 431 | bool swapped = false; executed (the execution status of this line is deduced): bool swapped = false; | - |
| 432 | if (y1 > y2) { evaluated: y1 > y2| yes Evaluation Count:2787 | yes Evaluation Count:104 |
| 104-2787 |
| 433 | swapped = true; executed (the execution status of this line is deduced): swapped = true; | - |
| 434 | qSwap(y1, y2); executed (the execution status of this line is deduced): qSwap(y1, y2); | - |
| 435 | qSwap(x1, x2); executed (the execution status of this line is deduced): qSwap(x1, x2); | - |
| 436 | } executed: }Execution Count:2787 | 2787 |
| 437 | int xinc = F16Dot16FixedDiv(x2 - x1, y2 - y1); executed (the execution status of this line is deduced): int xinc = F16Dot16FixedDiv(x2 - x1, y2 - y1); | - |
| 438 | int x = x1 << 10; executed (the execution status of this line is deduced): int x = x1 << 10; | - |
| 439 | | - |
| 440 | int y = (y1 + 32) >> 6; executed (the execution status of this line is deduced): int y = (y1 + 32) >> 6; | - |
| 441 | int ys = (y2 + 32) >> 6; executed (the execution status of this line is deduced): int ys = (y2 + 32) >> 6; | - |
| 442 | | - |
| 443 | if (y != ys) { evaluated: y != ys| yes Evaluation Count:2890 | yes Evaluation Count:1 |
| 1-2890 |
| 444 | x += ( ((((y << 6) + 32 - y1))) * xinc ) >> 6; executed (the execution status of this line is deduced): x += ( ((((y << 6) + 32 - y1))) * xinc ) >> 6; | - |
| 445 | | - |
| 446 | if (swapped) { evaluated: swapped| yes Evaluation Count:2786 | yes Evaluation Count:104 |
| 104-2786 |
| 447 | lastPixel.x = x >> 16; executed (the execution status of this line is deduced): lastPixel.x = x >> 16; | - |
| 448 | lastPixel.y = y; executed (the execution status of this line is deduced): lastPixel.y = y; | - |
| 449 | lastDir = QCosmeticStroker::BottomToTop; executed (the execution status of this line is deduced): lastDir = QCosmeticStroker::BottomToTop; | - |
| 450 | } else { executed: }Execution Count:2786 | 2786 |
| 451 | lastPixel.x = (x + (ys - y - 1)*xinc) >> 16; executed (the execution status of this line is deduced): lastPixel.x = (x + (ys - y - 1)*xinc) >> 16; | - |
| 452 | lastPixel.y = ys - 1; executed (the execution status of this line is deduced): lastPixel.y = ys - 1; | - |
| 453 | lastDir = QCosmeticStroker::TopToBottom; executed (the execution status of this line is deduced): lastDir = QCosmeticStroker::TopToBottom; | - |
| 454 | } executed: }Execution Count:104 | 104 |
| 455 | lastAxisAligned = qAbs(xinc) < (1 << 14); executed (the execution status of this line is deduced): lastAxisAligned = qAbs(xinc) < (1 << 14); | - |
| 456 | } executed: }Execution Count:2890 | 2890 |
| 457 | } else { executed: }Execution Count:2891 | 2891 |
| 458 | // horizontal | - |
| 459 | if (!dx) evaluated: !dx| yes Evaluation Count:90 | yes Evaluation Count:1264 |
| 90-1264 |
| 460 | return; executed: return;Execution Count:90 | 90 |
| 461 | | - |
| 462 | bool swapped = false; executed (the execution status of this line is deduced): bool swapped = false; | - |
| 463 | if (x1 > x2) { evaluated: x1 > x2| yes Evaluation Count:834 | yes Evaluation Count:430 |
| 430-834 |
| 464 | swapped = true; executed (the execution status of this line is deduced): swapped = true; | - |
| 465 | qSwap(x1, x2); executed (the execution status of this line is deduced): qSwap(x1, x2); | - |
| 466 | qSwap(y1, y2); executed (the execution status of this line is deduced): qSwap(y1, y2); | - |
| 467 | } executed: }Execution Count:834 | 834 |
| 468 | int yinc = F16Dot16FixedDiv(y2 - y1, x2 - x1); executed (the execution status of this line is deduced): int yinc = F16Dot16FixedDiv(y2 - y1, x2 - x1); | - |
| 469 | int y = y1 << 10; executed (the execution status of this line is deduced): int y = y1 << 10; | - |
| 470 | | - |
| 471 | int x = (x1 + 32) >> 6; executed (the execution status of this line is deduced): int x = (x1 + 32) >> 6; | - |
| 472 | int xs = (x2 + 32) >> 6; executed (the execution status of this line is deduced): int xs = (x2 + 32) >> 6; | - |
| 473 | | - |
| 474 | if (x != xs) { evaluated: x != xs| yes Evaluation Count:1150 | yes Evaluation Count:114 |
| 114-1150 |
| 475 | y += ( ((((x << 6) + 32 - x1))) * yinc ) >> 6; executed (the execution status of this line is deduced): y += ( ((((x << 6) + 32 - x1))) * yinc ) >> 6; | - |
| 476 | | - |
| 477 | if (swapped) { evaluated: swapped| yes Evaluation Count:834 | yes Evaluation Count:316 |
| 316-834 |
| 478 | lastPixel.x = x; executed (the execution status of this line is deduced): lastPixel.x = x; | - |
| 479 | lastPixel.y = y >> 16; executed (the execution status of this line is deduced): lastPixel.y = y >> 16; | - |
| 480 | lastDir = QCosmeticStroker::RightToLeft; executed (the execution status of this line is deduced): lastDir = QCosmeticStroker::RightToLeft; | - |
| 481 | } else { executed: }Execution Count:834 | 834 |
| 482 | lastPixel.x = xs - 1; executed (the execution status of this line is deduced): lastPixel.x = xs - 1; | - |
| 483 | lastPixel.y = (y + (xs - x - 1)*yinc) >> 16; executed (the execution status of this line is deduced): lastPixel.y = (y + (xs - x - 1)*yinc) >> 16; | - |
| 484 | lastDir = QCosmeticStroker::LeftToRight; executed (the execution status of this line is deduced): lastDir = QCosmeticStroker::LeftToRight; | - |
| 485 | } executed: }Execution Count:316 | 316 |
| 486 | lastAxisAligned = qAbs(yinc) < (1 << 14); executed (the execution status of this line is deduced): lastAxisAligned = qAbs(yinc) < (1 << 14); | - |
| 487 | } executed: }Execution Count:1150 | 1150 |
| 488 | } executed: }Execution Count:1264 | 1264 |
| 489 | // qDebug() << " moveTo: setting last pixel to x/y dir" << lastPixel.x << lastPixel.y << lastDir; | - |
| 490 | } | - |
| 491 | | - |
| 492 | static inline const QPainterPath::ElementType *subPath(const QPainterPath::ElementType *t, const QPainterPath::ElementType *end, | - |
| 493 | const qreal *points, bool *closed) | - |
| 494 | { | - |
| 495 | const QPainterPath::ElementType *start = t; executed (the execution status of this line is deduced): const QPainterPath::ElementType *start = t; | - |
| 496 | ++t; executed (the execution status of this line is deduced): ++t; | - |
| 497 | | - |
| 498 | // find out if the subpath is closed | - |
| 499 | while (t < end) { evaluated: t < end| yes Evaluation Count:4874 | yes Evaluation Count:345 |
| 345-4874 |
| 500 | if (*t == QPainterPath::MoveToElement) evaluated: *t == QPainterPath::MoveToElement| yes Evaluation Count:30 | yes Evaluation Count:4844 |
| 30-4844 |
| 501 | break; executed: break;Execution Count:30 | 30 |
| 502 | ++t; executed (the execution status of this line is deduced): ++t; | - |
| 503 | } executed: }Execution Count:4844 | 4844 |
| 504 | | - |
| 505 | int offset = t - start - 1; executed (the execution status of this line is deduced): int offset = t - start - 1; | - |
| 506 | // qDebug() << "subpath" << offset << points[0] << points[1] << points[2*offset] << points[2*offset+1]; | - |
| 507 | *closed = (points[0] == points[2*offset] && points[1] == points[2*offset + 1]); evaluated: points[0] == points[2*offset]| yes Evaluation Count:339 | yes Evaluation Count:36 |
evaluated: points[1] == points[2*offset + 1]| yes Evaluation Count:315 | yes Evaluation Count:24 |
| 24-339 |
| 508 | | - |
| 509 | return t; executed: return t;Execution Count:375 | 375 |
| 510 | } | - |
| 511 | | - |
| 512 | void QCosmeticStroker::drawPath(const QVectorPath &path) | - |
| 513 | { | - |
| 514 | // qDebug() << ">>>> drawpath" << path.convertToPainterPath() | - |
| 515 | // << "antialiasing:" << (bool)(state->renderHints & QPainter::Antialiasing) << " implicit close:" << path.hasImplicitClose(); | - |
| 516 | if (path.isEmpty()) partially evaluated: path.isEmpty()| no Evaluation Count:0 | yes Evaluation Count:65526 |
| 0-65526 |
| 517 | return; | 0 |
| 518 | | - |
| 519 | const qreal *points = path.points(); executed (the execution status of this line is deduced): const qreal *points = path.points(); | - |
| 520 | const QPainterPath::ElementType *type = path.elements(); executed (the execution status of this line is deduced): const QPainterPath::ElementType *type = path.elements(); | - |
| 521 | | - |
| 522 | if (type) { evaluated: type| yes Evaluation Count:345 | yes Evaluation Count:65181 |
| 345-65181 |
| 523 | const QPainterPath::ElementType *end = type + path.elementCount(); executed (the execution status of this line is deduced): const QPainterPath::ElementType *end = type + path.elementCount(); | - |
| 524 | | - |
| 525 | while (type < end) { evaluated: type < end| yes Evaluation Count:375 | yes Evaluation Count:345 |
| 345-375 |
| 526 | Q_ASSERT(type == path.elements() || *type == QPainterPath::MoveToElement); executed (the execution status of this line is deduced): qt_noop(); | - |
| 527 | | - |
| 528 | QPointF p = QPointF(points[0], points[1]) * state->matrix; executed (the execution status of this line is deduced): QPointF p = QPointF(points[0], points[1]) * state->matrix; | - |
| 529 | patternOffset = state->lastPen.dashOffset()*64; executed (the execution status of this line is deduced): patternOffset = state->lastPen.dashOffset()*64; | - |
| 530 | lastPixel.x = -1; executed (the execution status of this line is deduced): lastPixel.x = -1; | - |
| 531 | | - |
| 532 | bool closed; executed (the execution status of this line is deduced): bool closed; | - |
| 533 | const QPainterPath::ElementType *e = subPath(type, end, points, &closed); executed (the execution status of this line is deduced): const QPainterPath::ElementType *e = subPath(type, end, points, &closed); | - |
| 534 | if (closed) { evaluated: closed| yes Evaluation Count:315 | yes Evaluation Count:60 |
| 60-315 |
| 535 | const qreal *p = points + 2*(e-type); executed (the execution status of this line is deduced): const qreal *p = points + 2*(e-type); | - |
| 536 | QPointF p1 = QPointF(p[-4], p[-3]) * state->matrix; executed (the execution status of this line is deduced): QPointF p1 = QPointF(p[-4], p[-3]) * state->matrix; | - |
| 537 | QPointF p2 = QPointF(p[-2], p[-1]) * state->matrix; executed (the execution status of this line is deduced): QPointF p2 = QPointF(p[-2], p[-1]) * state->matrix; | - |
| 538 | calculateLastPoint(p1.x(), p1.y(), p2.x(), p2.y()); executed (the execution status of this line is deduced): calculateLastPoint(p1.x(), p1.y(), p2.x(), p2.y()); | - |
| 539 | } executed: }Execution Count:315 | 315 |
| 540 | int caps = (!closed & drawCaps) ? CapBegin : NoCaps; evaluated: (!closed & drawCaps)| yes Evaluation Count:60 | yes Evaluation Count:315 |
| 60-315 |
| 541 | // qDebug() << "closed =" << closed << capString(caps); | - |
| 542 | | - |
| 543 | points += 2; executed (the execution status of this line is deduced): points += 2; | - |
| 544 | ++type; executed (the execution status of this line is deduced): ++type; | - |
| 545 | | - |
| 546 | while (type < e) { evaluated: type < e| yes Evaluation Count:2436 | yes Evaluation Count:375 |
| 375-2436 |
| 547 | QPointF p2 = QPointF(points[0], points[1]) * state->matrix; executed (the execution status of this line is deduced): QPointF p2 = QPointF(points[0], points[1]) * state->matrix; | - |
| 548 | switch (*type) { | - |
| 549 | case QPainterPath::MoveToElement: | - |
| 550 | Q_ASSERT(!"Logic error"); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 551 | break; | 0 |
| 552 | | - |
| 553 | case QPainterPath::LineToElement: | - |
| 554 | if (!closed && drawCaps && type == e - 1) evaluated: !closed| yes Evaluation Count:48 | yes Evaluation Count:1184 |
partially evaluated: drawCaps| yes Evaluation Count:48 | no Evaluation Count:0 |
partially evaluated: type == e - 1| yes Evaluation Count:48 | no Evaluation Count:0 |
| 0-1184 |
| 555 | caps |= CapEnd; executed: caps |= CapEnd;Execution Count:48 | 48 |
| 556 | stroke(this, p.x(), p.y(), p2.x(), p2.y(), caps); executed (the execution status of this line is deduced): stroke(this, p.x(), p.y(), p2.x(), p2.y(), caps); | - |
| 557 | p = p2; executed (the execution status of this line is deduced): p = p2; | - |
| 558 | points += 2; executed (the execution status of this line is deduced): points += 2; | - |
| 559 | ++type; executed (the execution status of this line is deduced): ++type; | - |
| 560 | break; executed: break;Execution Count:1232 | 1232 |
| 561 | | - |
| 562 | case QPainterPath::CurveToElement: { | - |
| 563 | if (!closed && drawCaps && type == e - 3) evaluated: !closed| yes Evaluation Count:36 | yes Evaluation Count:1168 |
partially evaluated: drawCaps| yes Evaluation Count:36 | no Evaluation Count:0 |
evaluated: type == e - 3| yes Evaluation Count:12 | yes Evaluation Count:24 |
| 0-1168 |
| 564 | caps |= CapEnd; executed: caps |= CapEnd;Execution Count:12 | 12 |
| 565 | QPointF p3 = QPointF(points[2], points[3]) * state->matrix; executed (the execution status of this line is deduced): QPointF p3 = QPointF(points[2], points[3]) * state->matrix; | - |
| 566 | QPointF p4 = QPointF(points[4], points[5]) * state->matrix; executed (the execution status of this line is deduced): QPointF p4 = QPointF(points[4], points[5]) * state->matrix; | - |
| 567 | renderCubic(p, p2, p3, p4, caps); executed (the execution status of this line is deduced): renderCubic(p, p2, p3, p4, caps); | - |
| 568 | p = p4; executed (the execution status of this line is deduced): p = p4; | - |
| 569 | type += 3; executed (the execution status of this line is deduced): type += 3; | - |
| 570 | points += 6; executed (the execution status of this line is deduced): points += 6; | - |
| 571 | break; executed: break;Execution Count:1204 | 1204 |
| 572 | } | - |
| 573 | case QPainterPath::CurveToDataElement: | - |
| 574 | Q_ASSERT(!"QPainterPath::toSubpathPolygons(), bad element type"); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 575 | break; | 0 |
| 576 | } | - |
| 577 | caps = NoCaps; executed (the execution status of this line is deduced): caps = NoCaps; | - |
| 578 | } executed: }Execution Count:2436 | 2436 |
| 579 | } executed: }Execution Count:375 | 375 |
| 580 | } else { // !type, simple polygon executed: }Execution Count:345 | 345 |
| 581 | QPointF p = QPointF(points[0], points[1]) * state->matrix; executed (the execution status of this line is deduced): QPointF p = QPointF(points[0], points[1]) * state->matrix; | - |
| 582 | QPointF movedTo = p; executed (the execution status of this line is deduced): QPointF movedTo = p; | - |
| 583 | patternOffset = state->lastPen.dashOffset()*64; executed (the execution status of this line is deduced): patternOffset = state->lastPen.dashOffset()*64; | - |
| 584 | lastPixel.x = -1; executed (the execution status of this line is deduced): lastPixel.x = -1; | - |
| 585 | | - |
| 586 | const qreal *end = points + 2*path.elementCount(); executed (the execution status of this line is deduced): const qreal *end = points + 2*path.elementCount(); | - |
| 587 | // handle closed path case | - |
| 588 | bool closed = path.hasImplicitClose() || (points[0] == end[-2] && points[1] == end[-1]); evaluated: path.hasImplicitClose()| yes Evaluation Count:3967 | yes Evaluation Count:61214 |
evaluated: points[0] == end[-2]| yes Evaluation Count:5 | yes Evaluation Count:61209 |
partially evaluated: points[1] == end[-1]| yes Evaluation Count:5 | no Evaluation Count:0 |
| 0-61214 |
| 589 | int caps = (!closed & drawCaps) ? CapBegin : NoCaps; evaluated: (!closed & drawCaps)| yes Evaluation Count:61209 | yes Evaluation Count:3972 |
| 3972-61209 |
| 590 | if (closed) { evaluated: closed| yes Evaluation Count:3972 | yes Evaluation Count:61209 |
| 3972-61209 |
| 591 | QPointF p2 = QPointF(end[-2], end[-1]) * state->matrix; executed (the execution status of this line is deduced): QPointF p2 = QPointF(end[-2], end[-1]) * state->matrix; | - |
| 592 | calculateLastPoint(p2.x(), p2.y(), p.x(), p.y()); executed (the execution status of this line is deduced): calculateLastPoint(p2.x(), p2.y(), p.x(), p.y()); | - |
| 593 | } executed: }Execution Count:3972 | 3972 |
| 594 | | - |
| 595 | points += 2; executed (the execution status of this line is deduced): points += 2; | - |
| 596 | while (points < end) { evaluated: points < end| yes Evaluation Count:135464 | yes Evaluation Count:65181 |
| 65181-135464 |
| 597 | QPointF p2 = QPointF(points[0], points[1]) * state->matrix; executed (the execution status of this line is deduced): QPointF p2 = QPointF(points[0], points[1]) * state->matrix; | - |
| 598 | | - |
| 599 | if (!closed && drawCaps && points == end - 2) evaluated: !closed| yes Evaluation Count:123250 | yes Evaluation Count:12214 |
partially evaluated: drawCaps| yes Evaluation Count:123250 | no Evaluation Count:0 |
evaluated: points == end - 2| yes Evaluation Count:61209 | yes Evaluation Count:62041 |
| 0-123250 |
| 600 | caps |= CapEnd; executed: caps |= CapEnd;Execution Count:61209 | 61209 |
| 601 | | - |
| 602 | stroke(this, p.x(), p.y(), p2.x(), p2.y(), caps); executed (the execution status of this line is deduced): stroke(this, p.x(), p.y(), p2.x(), p2.y(), caps); | - |
| 603 | | - |
| 604 | p = p2; executed (the execution status of this line is deduced): p = p2; | - |
| 605 | points += 2; executed (the execution status of this line is deduced): points += 2; | - |
| 606 | caps = NoCaps; executed (the execution status of this line is deduced): caps = NoCaps; | - |
| 607 | } executed: }Execution Count:135464 | 135464 |
| 608 | if (path.hasImplicitClose()) evaluated: path.hasImplicitClose()| yes Evaluation Count:3967 | yes Evaluation Count:61214 |
| 3967-61214 |
| 609 | stroke(this, p.x(), p.y(), movedTo.x(), movedTo.y(), NoCaps); executed: stroke(this, p.x(), p.y(), movedTo.x(), movedTo.y(), NoCaps);Execution Count:3967 | 3967 |
| 610 | } executed: }Execution Count:65181 | 65181 |
| 611 | | - |
| 612 | | - |
| 613 | blend(current_span, spans, &state->penData); executed (the execution status of this line is deduced): blend(current_span, spans, &state->penData); | - |
| 614 | current_span = 0; executed (the execution status of this line is deduced): current_span = 0; | - |
| 615 | } executed: }Execution Count:65526 | 65526 |
| 616 | | - |
| 617 | void QCosmeticStroker::renderCubic(const QPointF &p1, const QPointF &p2, const QPointF &p3, const QPointF &p4, int caps) | - |
| 618 | { | - |
| 619 | // qDebug() << ">>>> renderCubic" << p1 << p2 << p3 << p4 << capString(caps); | - |
| 620 | const int maxSubDivisions = 6; executed (the execution status of this line is deduced): const int maxSubDivisions = 6; | - |
| 621 | PointF points[3*maxSubDivisions + 4]; executed (the execution status of this line is deduced): PointF points[3*maxSubDivisions + 4]; | - |
| 622 | | - |
| 623 | points[3].x = p1.x(); executed (the execution status of this line is deduced): points[3].x = p1.x(); | - |
| 624 | points[3].y = p1.y(); executed (the execution status of this line is deduced): points[3].y = p1.y(); | - |
| 625 | points[2].x = p2.x(); executed (the execution status of this line is deduced): points[2].x = p2.x(); | - |
| 626 | points[2].y = p2.y(); executed (the execution status of this line is deduced): points[2].y = p2.y(); | - |
| 627 | points[1].x = p3.x(); executed (the execution status of this line is deduced): points[1].x = p3.x(); | - |
| 628 | points[1].y = p3.y(); executed (the execution status of this line is deduced): points[1].y = p3.y(); | - |
| 629 | points[0].x = p4.x(); executed (the execution status of this line is deduced): points[0].x = p4.x(); | - |
| 630 | points[0].y = p4.y(); executed (the execution status of this line is deduced): points[0].y = p4.y(); | - |
| 631 | | - |
| 632 | PointF *p = points; executed (the execution status of this line is deduced): PointF *p = points; | - |
| 633 | int level = maxSubDivisions; executed (the execution status of this line is deduced): int level = maxSubDivisions; | - |
| 634 | | - |
| 635 | renderCubicSubdivision(p, level, caps); executed (the execution status of this line is deduced): renderCubicSubdivision(p, level, caps); | - |
| 636 | } executed: }Execution Count:1204 | 1204 |
| 637 | | - |
| 638 | static void splitCubic(QCosmeticStroker::PointF *points) | - |
| 639 | { | - |
| 640 | const qreal half = .5; executed (the execution status of this line is deduced): const qreal half = .5; | - |
| 641 | qreal a, b, c, d; executed (the execution status of this line is deduced): qreal a, b, c, d; | - |
| 642 | | - |
| 643 | points[6].x = points[3].x; executed (the execution status of this line is deduced): points[6].x = points[3].x; | - |
| 644 | c = points[1].x; executed (the execution status of this line is deduced): c = points[1].x; | - |
| 645 | d = points[2].x; executed (the execution status of this line is deduced): d = points[2].x; | - |
| 646 | points[1].x = a = ( points[0].x + c ) * half; executed (the execution status of this line is deduced): points[1].x = a = ( points[0].x + c ) * half; | - |
| 647 | points[5].x = b = ( points[3].x + d ) * half; executed (the execution status of this line is deduced): points[5].x = b = ( points[3].x + d ) * half; | - |
| 648 | c = ( c + d ) * half; executed (the execution status of this line is deduced): c = ( c + d ) * half; | - |
| 649 | points[2].x = a = ( a + c ) * half; executed (the execution status of this line is deduced): points[2].x = a = ( a + c ) * half; | - |
| 650 | points[4].x = b = ( b + c ) * half; executed (the execution status of this line is deduced): points[4].x = b = ( b + c ) * half; | - |
| 651 | points[3].x = ( a + b ) * half; executed (the execution status of this line is deduced): points[3].x = ( a + b ) * half; | - |
| 652 | | - |
| 653 | points[6].y = points[3].y; executed (the execution status of this line is deduced): points[6].y = points[3].y; | - |
| 654 | c = points[1].y; executed (the execution status of this line is deduced): c = points[1].y; | - |
| 655 | d = points[2].y; executed (the execution status of this line is deduced): d = points[2].y; | - |
| 656 | points[1].y = a = ( points[0].y + c ) * half; executed (the execution status of this line is deduced): points[1].y = a = ( points[0].y + c ) * half; | - |
| 657 | points[5].y = b = ( points[3].y + d ) * half; executed (the execution status of this line is deduced): points[5].y = b = ( points[3].y + d ) * half; | - |
| 658 | c = ( c + d ) * half; executed (the execution status of this line is deduced): c = ( c + d ) * half; | - |
| 659 | points[2].y = a = ( a + c ) * half; executed (the execution status of this line is deduced): points[2].y = a = ( a + c ) * half; | - |
| 660 | points[4].y = b = ( b + c ) * half; executed (the execution status of this line is deduced): points[4].y = b = ( b + c ) * half; | - |
| 661 | points[3].y = ( a + b ) * half; executed (the execution status of this line is deduced): points[3].y = ( a + b ) * half; | - |
| 662 | } executed: }Execution Count:2696 | 2696 |
| 663 | | - |
| 664 | void QCosmeticStroker::renderCubicSubdivision(QCosmeticStroker::PointF *points, int level, int caps) | - |
| 665 | { | - |
| 666 | if (level) { partially evaluated: level| yes Evaluation Count:6596 | no Evaluation Count:0 |
| 0-6596 |
| 667 | qreal dx = points[3].x - points[0].x; executed (the execution status of this line is deduced): qreal dx = points[3].x - points[0].x; | - |
| 668 | qreal dy = points[3].y - points[0].y; executed (the execution status of this line is deduced): qreal dy = points[3].y - points[0].y; | - |
| 669 | qreal len = ((qreal).25) * (qAbs(dx) + qAbs(dy)); executed (the execution status of this line is deduced): qreal len = ((qreal).25) * (qAbs(dx) + qAbs(dy)); | - |
| 670 | | - |
| 671 | if (qAbs(dx * (points[0].y - points[2].y) - dy * (points[0].x - points[2].x)) >= len || evaluated: qAbs(dx * (points[0].y - points[2].y) - dy * (points[0].x - points[2].x)) >= len| yes Evaluation Count:2624 | yes Evaluation Count:3972 |
| 2624-3972 |
| 672 | qAbs(dx * (points[0].y - points[1].y) - dy * (points[0].x - points[1].x)) >= len) { evaluated: qAbs(dx * (points[0].y - points[1].y) - dy * (points[0].x - points[1].x)) >= len| yes Evaluation Count:72 | yes Evaluation Count:3900 |
| 72-3900 |
| 673 | splitCubic(points); executed (the execution status of this line is deduced): splitCubic(points); | - |
| 674 | | - |
| 675 | --level; executed (the execution status of this line is deduced): --level; | - |
| 676 | renderCubicSubdivision(points + 3, level, caps & CapBegin); executed (the execution status of this line is deduced): renderCubicSubdivision(points + 3, level, caps & CapBegin); | - |
| 677 | renderCubicSubdivision(points, level, caps & CapEnd); executed (the execution status of this line is deduced): renderCubicSubdivision(points, level, caps & CapEnd); | - |
| 678 | return; executed: return;Execution Count:2696 | 2696 |
| 679 | } | - |
| 680 | } executed: }Execution Count:3900 | 3900 |
| 681 | | - |
| 682 | stroke(this, points[3].x, points[3].y, points[0].x, points[0].y, caps); executed (the execution status of this line is deduced): stroke(this, points[3].x, points[3].y, points[0].x, points[0].y, caps); | - |
| 683 | } executed: }Execution Count:3900 | 3900 |
| 684 | | - |
| 685 | static inline int swapCaps(int caps) | - |
| 686 | { | - |
| 687 | return ((caps & QCosmeticStroker::CapBegin) << 1) | executed: return ((caps & QCosmeticStroker::CapBegin) << 1) | ((caps & QCosmeticStroker::CapEnd) >> 1);Execution Count:71030 | 71030 |
| 688 | ((caps & QCosmeticStroker::CapEnd) >> 1); executed: return ((caps & QCosmeticStroker::CapBegin) << 1) | ((caps & QCosmeticStroker::CapEnd) >> 1);Execution Count:71030 | 71030 |
| 689 | } | - |
| 690 | | - |
| 691 | // adjust line by half a pixel | - |
| 692 | static inline void capAdjust(int caps, int &x1, int &x2, int &y, int yinc) | - |
| 693 | { | - |
| 694 | if (caps & QCosmeticStroker::CapBegin) { evaluated: caps & QCosmeticStroker::CapBegin| yes Evaluation Count:66539 | yes Evaluation Count:81851 |
| 66539-81851 |
| 695 | x1 -= 32; executed (the execution status of this line is deduced): x1 -= 32; | - |
| 696 | y -= yinc >> 1; executed (the execution status of this line is deduced): y -= yinc >> 1; | - |
| 697 | } executed: }Execution Count:66539 | 66539 |
| 698 | if (caps & QCosmeticStroker::CapEnd) { evaluated: caps & QCosmeticStroker::CapEnd| yes Evaluation Count:67574 | yes Evaluation Count:80816 |
| 67574-80816 |
| 699 | x2 += 32; executed (the execution status of this line is deduced): x2 += 32; | - |
| 700 | } executed: }Execution Count:67574 | 67574 |
| 701 | } executed: }Execution Count:148390 | 148390 |
| 702 | | - |
| 703 | /* | - |
| 704 | The hard part about this is dropout control and avoiding douple drawing of points when | - |
| 705 | the drawing shifts from horizontal to vertical or back. | - |
| 706 | */ | - |
| 707 | template<DrawPixel drawPixel, class Dasher> | - |
| 708 | static void drawLine(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) | - |
| 709 | { | - |
| 710 | if (stroker->clipLine(rx1, ry1, rx2, ry2)) evaluated: stroker->clipLine(rx1, ry1, rx2, ry2)| yes Evaluation Count:2128 | yes Evaluation Count:145831 |
| 2128-145831 |
| 711 | return; executed: return;Execution Count:2128 | 2128 |
| 712 | | - |
| 713 | const int half = stroker->legacyRounding ? 31 : 0; evaluated: stroker->legacyRounding| yes Evaluation Count:4066 | yes Evaluation Count:141765 |
| 4066-141765 |
| 714 | int x1 = toF26Dot6(rx1) + half; executed (the execution status of this line is deduced): int x1 = ((int)((rx1)*64.)) + half; | - |
| 715 | int y1 = toF26Dot6(ry1) + half; executed (the execution status of this line is deduced): int y1 = ((int)((ry1)*64.)) + half; | - |
| 716 | int x2 = toF26Dot6(rx2) + half; executed (the execution status of this line is deduced): int x2 = ((int)((rx2)*64.)) + half; | - |
| 717 | int y2 = toF26Dot6(ry2) + half; executed (the execution status of this line is deduced): int y2 = ((int)((ry2)*64.)) + half; | - |
| 718 | | - |
| 719 | int dx = qAbs(x2 - x1); executed (the execution status of this line is deduced): int dx = qAbs(x2 - x1); | - |
| 720 | int dy = qAbs(y2 - y1); executed (the execution status of this line is deduced): int dy = qAbs(y2 - y1); | - |
| 721 | | - |
| 722 | QCosmeticStroker::Point last = stroker->lastPixel; executed (the execution status of this line is deduced): QCosmeticStroker::Point last = stroker->lastPixel; | - |
| 723 | | - |
| 724 | // qDebug() << "stroke" << x1/64. << y1/64. << x2/64. << y2/64.; | - |
| 725 | | - |
| 726 | if (dx < dy) { evaluated: dx < dy| yes Evaluation Count:70617 | yes Evaluation Count:75214 |
| 70617-75214 |
| 727 | // vertical | - |
| 728 | QCosmeticStroker::Direction dir = QCosmeticStroker::TopToBottom; executed (the execution status of this line is deduced): QCosmeticStroker::Direction dir = QCosmeticStroker::TopToBottom; | - |
| 729 | | - |
| 730 | bool swapped = false; executed (the execution status of this line is deduced): bool swapped = false; | - |
| 731 | if (y1 > y2) { evaluated: y1 > y2| yes Evaluation Count:64514 | yes Evaluation Count:6103 |
| 6103-64514 |
| 732 | swapped = true; executed (the execution status of this line is deduced): swapped = true; | - |
| 733 | qSwap(y1, y2); executed (the execution status of this line is deduced): qSwap(y1, y2); | - |
| 734 | qSwap(x1, x2); executed (the execution status of this line is deduced): qSwap(x1, x2); | - |
| 735 | caps = swapCaps(caps); executed (the execution status of this line is deduced): caps = swapCaps(caps); | - |
| 736 | dir = QCosmeticStroker::BottomToTop; executed (the execution status of this line is deduced): dir = QCosmeticStroker::BottomToTop; | - |
| 737 | } executed: }Execution Count:64514 | 64514 |
| 738 | int xinc = F16Dot16FixedDiv(x2 - x1, y2 - y1); executed (the execution status of this line is deduced): int xinc = F16Dot16FixedDiv(x2 - x1, y2 - y1); | - |
| 739 | int x = x1 << 10; executed (the execution status of this line is deduced): int x = x1 << 10; | - |
| 740 | | - |
| 741 | if ((stroker->lastDir ^ QCosmeticStroker::VerticalMask) == dir) evaluated: (stroker->lastDir ^ QCosmeticStroker::VerticalMask) == dir| yes Evaluation Count:252 | yes Evaluation Count:70365 |
| 252-70365 |
| 742 | caps |= swapped ? QCosmeticStroker::CapEnd : QCosmeticStroker::CapBegin; executed: caps |= swapped ? QCosmeticStroker::CapEnd : QCosmeticStroker::CapBegin;Execution Count:252 evaluated: swapped| yes Evaluation Count:154 | yes Evaluation Count:98 |
| 98-252 |
| 743 | | - |
| 744 | capAdjust(caps, y1, y2, x, xinc); executed (the execution status of this line is deduced): capAdjust(caps, y1, y2, x, xinc); | - |
| 745 | | - |
| 746 | int y = (y1 + 32) >> 6; executed (the execution status of this line is deduced): int y = (y1 + 32) >> 6; | - |
| 747 | int ys = (y2 + 32) >> 6; executed (the execution status of this line is deduced): int ys = (y2 + 32) >> 6; | - |
| 748 | | - |
| 749 | if (y != ys) { evaluated: y != ys| yes Evaluation Count:70603 | yes Evaluation Count:14 |
| 14-70603 |
| 750 | x += ( ((((y << 6) + 32 - y1))) * xinc ) >> 6; executed (the execution status of this line is deduced): x += ( ((((y << 6) + 32 - y1))) * xinc ) >> 6; | - |
| 751 | | - |
| 752 | // calculate first and last pixel and perform dropout control | - |
| 753 | QCosmeticStroker::Point first; executed (the execution status of this line is deduced): QCosmeticStroker::Point first; | - |
| 754 | first.x = x >> 16; executed (the execution status of this line is deduced): first.x = x >> 16; | - |
| 755 | first.y = y; executed (the execution status of this line is deduced): first.y = y; | - |
| 756 | last.x = (x + (ys - y - 1)*xinc) >> 16; executed (the execution status of this line is deduced): last.x = (x + (ys - y - 1)*xinc) >> 16; | - |
| 757 | last.y = ys - 1; executed (the execution status of this line is deduced): last.y = ys - 1; | - |
| 758 | if (swapped) evaluated: swapped| yes Evaluation Count:64509 | yes Evaluation Count:6094 |
| 6094-64509 |
| 759 | qSwap(first, last); executed: qSwap(first, last);Execution Count:64509 | 64509 |
| 760 | | - |
| 761 | bool axisAligned = qAbs(xinc) < (1 << 14); executed (the execution status of this line is deduced): bool axisAligned = qAbs(xinc) < (1 << 14); | - |
| 762 | if (stroker->lastPixel.x >= 0) { evaluated: stroker->lastPixel.x >= 0| yes Evaluation Count:37392 | yes Evaluation Count:33211 |
| 33211-37392 |
| 763 | if (first.x == stroker->lastPixel.x && evaluated: first.x == stroker->lastPixel.x| yes Evaluation Count:4166 | yes Evaluation Count:33226 |
| 4166-33226 |
| 764 | first.y == stroker->lastPixel.y) { evaluated: first.y == stroker->lastPixel.y| yes Evaluation Count:553 | yes Evaluation Count:3613 |
| 553-3613 |
| 765 | // remove duplicated pixel | - |
| 766 | if (swapped) { evaluated: swapped| yes Evaluation Count:251 | yes Evaluation Count:302 |
| 251-302 |
| 767 | --ys; executed (the execution status of this line is deduced): --ys; | - |
| 768 | } else { executed: }Execution Count:251 | 251 |
| 769 | ++y; executed (the execution status of this line is deduced): ++y; | - |
| 770 | x += xinc; executed (the execution status of this line is deduced): x += xinc; | - |
| 771 | } executed: }Execution Count:302 | 302 |
| 772 | } else if (stroker->lastDir != dir && evaluated: stroker->lastDir != dir| yes Evaluation Count:35475 | yes Evaluation Count:1364 |
| 1364-35475 |
| 773 | (((axisAligned && stroker->lastAxisAligned) && evaluated: axisAligned| yes Evaluation Count:35072 | yes Evaluation Count:403 |
evaluated: stroker->lastAxisAligned| yes Evaluation Count:34654 | yes Evaluation Count:418 |
| 403-35072 |
| 774 | stroker->lastPixel.x != first.x && stroker->lastPixel.y != first.y) || evaluated: stroker->lastPixel.x != first.x| yes Evaluation Count:32096 | yes Evaluation Count:2558 |
evaluated: stroker->lastPixel.y != first.y| yes Evaluation Count:29533 | yes Evaluation Count:2563 |
| 2558-32096 |
| 775 | (qAbs(stroker->lastPixel.x - first.x) > 1 || partially evaluated: qAbs(stroker->lastPixel.x - first.x) > 1| no Evaluation Count:0 | yes Evaluation Count:5942 |
| 0-5942 |
| 776 | qAbs(stroker->lastPixel.y - first.y) > 1))) { evaluated: qAbs(stroker->lastPixel.y - first.y) > 1| yes Evaluation Count:130 | yes Evaluation Count:5812 |
| 130-5812 |
| 777 | // have a missing pixel, insert it | - |
| 778 | if (swapped) { evaluated: swapped| yes Evaluation Count:29650 | yes Evaluation Count:13 |
| 13-29650 |
| 779 | ++ys; executed (the execution status of this line is deduced): ++ys; | - |
| 780 | } else { executed: }Execution Count:29650 | 29650 |
| 781 | --y; executed (the execution status of this line is deduced): --y; | - |
| 782 | x -= xinc; executed (the execution status of this line is deduced): x -= xinc; | - |
| 783 | } executed: }Execution Count:13 | 13 |
| 784 | } | - |
| 785 | } | - |
| 786 | stroker->lastDir = dir; executed (the execution status of this line is deduced): stroker->lastDir = dir; | - |
| 787 | stroker->lastAxisAligned = axisAligned; executed (the execution status of this line is deduced): stroker->lastAxisAligned = axisAligned; | - |
| 788 | | - |
| 789 | Dasher dasher(stroker, swapped, y << 6, ys << 6); executed (the execution status of this line is deduced): Dasher dasher(stroker, swapped, y << 6, ys << 6); | - |
| 790 | | - |
| 791 | do { | - |
| 792 | if (dasher.on()) evaluated: dasher.on()| yes Evaluation Count:2633002 | yes Evaluation Count:82 |
| 82-2633002 |
| 793 | drawPixel(stroker, x >> 16, y, 255); executed: drawPixel(stroker, x >> 16, y, 255);Execution Count:2633002 | 2633002 |
| 794 | dasher.adjust(); executed (the execution status of this line is deduced): dasher.adjust(); | - |
| 795 | x += xinc; executed (the execution status of this line is deduced): x += xinc; | - |
| 796 | } while (++y < ys); executed: }Execution Count:2633084 evaluated: ++y < ys| yes Evaluation Count:2562481 | yes Evaluation Count:70603 |
| 70603-2633084 |
| 797 | } executed: }Execution Count:70603 | 70603 |
| 798 | } else { executed: }Execution Count:70617 | 70617 |
| 799 | // horizontal | - |
| 800 | if (!dx) evaluated: !dx| yes Evaluation Count:94 | yes Evaluation Count:75120 |
| 94-75120 |
| 801 | return; executed: return;Execution Count:94 | 94 |
| 802 | | - |
| 803 | QCosmeticStroker::Direction dir = QCosmeticStroker::LeftToRight; executed (the execution status of this line is deduced): QCosmeticStroker::Direction dir = QCosmeticStroker::LeftToRight; | - |
| 804 | | - |
| 805 | bool swapped = false; executed (the execution status of this line is deduced): bool swapped = false; | - |
| 806 | if (x1 > x2) { evaluated: x1 > x2| yes Evaluation Count:5346 | yes Evaluation Count:69774 |
| 5346-69774 |
| 807 | swapped = true; executed (the execution status of this line is deduced): swapped = true; | - |
| 808 | qSwap(x1, x2); executed (the execution status of this line is deduced): qSwap(x1, x2); | - |
| 809 | qSwap(y1, y2); executed (the execution status of this line is deduced): qSwap(y1, y2); | - |
| 810 | caps = swapCaps(caps); executed (the execution status of this line is deduced): caps = swapCaps(caps); | - |
| 811 | dir = QCosmeticStroker::RightToLeft; executed (the execution status of this line is deduced): dir = QCosmeticStroker::RightToLeft; | - |
| 812 | } executed: }Execution Count:5346 | 5346 |
| 813 | int yinc = F16Dot16FixedDiv(y2 - y1, x2 - x1); executed (the execution status of this line is deduced): int yinc = F16Dot16FixedDiv(y2 - y1, x2 - x1); | - |
| 814 | int y = y1 << 10; executed (the execution status of this line is deduced): int y = y1 << 10; | - |
| 815 | | - |
| 816 | if ((stroker->lastDir ^ QCosmeticStroker::HorizontalMask) == dir) evaluated: (stroker->lastDir ^ QCosmeticStroker::HorizontalMask) == dir| yes Evaluation Count:1747 | yes Evaluation Count:73373 |
| 1747-73373 |
| 817 | caps |= swapped ? QCosmeticStroker::CapEnd : QCosmeticStroker::CapBegin; executed: caps |= swapped ? QCosmeticStroker::CapEnd : QCosmeticStroker::CapBegin;Execution Count:1747 evaluated: swapped| yes Evaluation Count:911 | yes Evaluation Count:836 |
| 836-1747 |
| 818 | | - |
| 819 | capAdjust(caps, x1, x2, y, yinc); executed (the execution status of this line is deduced): capAdjust(caps, x1, x2, y, yinc); | - |
| 820 | | - |
| 821 | int x = (x1 + 32) >> 6; executed (the execution status of this line is deduced): int x = (x1 + 32) >> 6; | - |
| 822 | int xs = (x2 + 32) >> 6; executed (the execution status of this line is deduced): int xs = (x2 + 32) >> 6; | - |
| 823 | | - |
| 824 | if (x != xs) { evaluated: x != xs| yes Evaluation Count:75116 | yes Evaluation Count:4 |
| 4-75116 |
| 825 | y += ( ((((x << 6) + 32 - x1))) * yinc ) >> 6; executed (the execution status of this line is deduced): y += ( ((((x << 6) + 32 - x1))) * yinc ) >> 6; | - |
| 826 | | - |
| 827 | // calculate first and last pixel to perform dropout control | - |
| 828 | QCosmeticStroker::Point first; executed (the execution status of this line is deduced): QCosmeticStroker::Point first; | - |
| 829 | first.x = x; executed (the execution status of this line is deduced): first.x = x; | - |
| 830 | first.y = y >> 16; executed (the execution status of this line is deduced): first.y = y >> 16; | - |
| 831 | last.x = xs - 1; executed (the execution status of this line is deduced): last.x = xs - 1; | - |
| 832 | last.y = (y + (xs - x - 1)*yinc) >> 16; executed (the execution status of this line is deduced): last.y = (y + (xs - x - 1)*yinc) >> 16; | - |
| 833 | if (swapped) evaluated: swapped| yes Evaluation Count:5344 | yes Evaluation Count:69772 |
| 5344-69772 |
| 834 | qSwap(first, last); executed: qSwap(first, last);Execution Count:5344 | 5344 |
| 835 | | - |
| 836 | bool axisAligned = qAbs(yinc) < (1 << 14); executed (the execution status of this line is deduced): bool axisAligned = qAbs(yinc) < (1 << 14); | - |
| 837 | if (stroker->lastPixel.x >= 0) { evaluated: stroker->lastPixel.x >= 0| yes Evaluation Count:40588 | yes Evaluation Count:34528 |
| 34528-40588 |
| 838 | if (first.x == stroker->lastPixel.x && first.y == stroker->lastPixel.y) { evaluated: first.x == stroker->lastPixel.x| yes Evaluation Count:34065 | yes Evaluation Count:6523 |
evaluated: first.y == stroker->lastPixel.y| yes Evaluation Count:33820 | yes Evaluation Count:245 |
| 245-34065 |
| 839 | // remove duplicated pixel | - |
| 840 | if (swapped) { evaluated: swapped| yes Evaluation Count:252 | yes Evaluation Count:33568 |
| 252-33568 |
| 841 | --xs; executed (the execution status of this line is deduced): --xs; | - |
| 842 | } else { executed: }Execution Count:252 | 252 |
| 843 | ++x; executed (the execution status of this line is deduced): ++x; | - |
| 844 | y += yinc; executed (the execution status of this line is deduced): y += yinc; | - |
| 845 | } executed: }Execution Count:33568 | 33568 |
| 846 | } else if (stroker->lastDir != dir && evaluated: stroker->lastDir != dir| yes Evaluation Count:4072 | yes Evaluation Count:2696 |
| 2696-4072 |
| 847 | (((axisAligned && stroker->lastAxisAligned) && evaluated: axisAligned| yes Evaluation Count:2915 | yes Evaluation Count:1157 |
evaluated: stroker->lastAxisAligned| yes Evaluation Count:2637 | yes Evaluation Count:278 |
| 278-2915 |
| 848 | stroker->lastPixel.x != first.x && stroker->lastPixel.y != first.y) || evaluated: stroker->lastPixel.x != first.x| yes Evaluation Count:2593 | yes Evaluation Count:44 |
evaluated: stroker->lastPixel.y != first.y| yes Evaluation Count:2555 | yes Evaluation Count:38 |
| 38-2593 |
| 849 | (qAbs(stroker->lastPixel.x - first.x) > 1 || partially evaluated: qAbs(stroker->lastPixel.x - first.x) > 1| no Evaluation Count:0 | yes Evaluation Count:1517 |
| 0-1517 |
| 850 | qAbs(stroker->lastPixel.y - first.y) > 1))) { evaluated: qAbs(stroker->lastPixel.y - first.y) > 1| yes Evaluation Count:26 | yes Evaluation Count:1491 |
| 26-1491 |
| 851 | // have a missing pixel, insert it | - |
| 852 | if (swapped) { evaluated: swapped| yes Evaluation Count:2576 | yes Evaluation Count:5 |
| 5-2576 |
| 853 | ++xs; executed (the execution status of this line is deduced): ++xs; | - |
| 854 | } else { executed: }Execution Count:2576 | 2576 |
| 855 | --x; executed (the execution status of this line is deduced): --x; | - |
| 856 | y -= yinc; executed (the execution status of this line is deduced): y -= yinc; | - |
| 857 | } executed: }Execution Count:5 | 5 |
| 858 | } | - |
| 859 | } | - |
| 860 | stroker->lastDir = dir; executed (the execution status of this line is deduced): stroker->lastDir = dir; | - |
| 861 | stroker->lastAxisAligned = axisAligned; executed (the execution status of this line is deduced): stroker->lastAxisAligned = axisAligned; | - |
| 862 | | - |
| 863 | Dasher dasher(stroker, swapped, x << 6, xs << 6); executed (the execution status of this line is deduced): Dasher dasher(stroker, swapped, x << 6, xs << 6); | - |
| 864 | | - |
| 865 | do { | - |
| 866 | if (dasher.on()) evaluated: dasher.on()| yes Evaluation Count:4803705 | yes Evaluation Count:114 |
| 114-4803705 |
| 867 | drawPixel(stroker, x, y >> 16, 255); executed: drawPixel(stroker, x, y >> 16, 255);Execution Count:4803705 | 4803705 |
| 868 | dasher.adjust(); executed (the execution status of this line is deduced): dasher.adjust(); | - |
| 869 | y += yinc; executed (the execution status of this line is deduced): y += yinc; | - |
| 870 | } while (++x < xs); executed: }Execution Count:4803819 evaluated: ++x < xs| yes Evaluation Count:4728703 | yes Evaluation Count:75116 |
| 75116-4803819 |
| 871 | } executed: }Execution Count:75116 | 75116 |
| 872 | } executed: }Execution Count:75120 | 75120 |
| 873 | stroker->lastPixel = last; executed (the execution status of this line is deduced): stroker->lastPixel = last; | - |
| 874 | } executed: }Execution Count:145737 | 145737 |
| 875 | | - |
| 876 | | - |
| 877 | template<DrawPixel drawPixel, class Dasher> | - |
| 878 | static void drawLineAA(QCosmeticStroker *stroker, qreal rx1, qreal ry1, qreal rx2, qreal ry2, int caps) | - |
| 879 | { | - |
| 880 | if (stroker->clipLine(rx1, ry1, rx2, ry2)) evaluated: stroker->clipLine(rx1, ry1, rx2, ry2)| yes Evaluation Count:352 | yes Evaluation Count:2699 |
| 352-2699 |
| 881 | return; executed: return;Execution Count:352 | 352 |
| 882 | | - |
| 883 | int x1 = toF26Dot6(rx1); executed (the execution status of this line is deduced): int x1 = ((int)((rx1)*64.)); | - |
| 884 | int y1 = toF26Dot6(ry1); executed (the execution status of this line is deduced): int y1 = ((int)((ry1)*64.)); | - |
| 885 | int x2 = toF26Dot6(rx2); executed (the execution status of this line is deduced): int x2 = ((int)((rx2)*64.)); | - |
| 886 | int y2 = toF26Dot6(ry2); executed (the execution status of this line is deduced): int y2 = ((int)((ry2)*64.)); | - |
| 887 | | - |
| 888 | int dx = x2 - x1; executed (the execution status of this line is deduced): int dx = x2 - x1; | - |
| 889 | int dy = y2 - y1; executed (the execution status of this line is deduced): int dy = y2 - y1; | - |
| 890 | | - |
| 891 | if (qAbs(dx) < qAbs(dy)) { evaluated: qAbs(dx) < qAbs(dy)| yes Evaluation Count:1200 | yes Evaluation Count:1499 |
| 1200-1499 |
| 892 | // vertical | - |
| 893 | | - |
| 894 | int xinc = F16Dot16FixedDiv(dx, dy); executed (the execution status of this line is deduced): int xinc = F16Dot16FixedDiv(dx, dy); | - |
| 895 | | - |
| 896 | bool swapped = false; executed (the execution status of this line is deduced): bool swapped = false; | - |
| 897 | if (y1 > y2) { evaluated: y1 > y2| yes Evaluation Count:552 | yes Evaluation Count:648 |
| 552-648 |
| 898 | qSwap(y1, y2); executed (the execution status of this line is deduced): qSwap(y1, y2); | - |
| 899 | qSwap(x1, x2); executed (the execution status of this line is deduced): qSwap(x1, x2); | - |
| 900 | swapped = true; executed (the execution status of this line is deduced): swapped = true; | - |
| 901 | caps = swapCaps(caps); executed (the execution status of this line is deduced): caps = swapCaps(caps); | - |
| 902 | } executed: }Execution Count:552 | 552 |
| 903 | | - |
| 904 | int x = (x1 - 32) << 10; executed (the execution status of this line is deduced): int x = (x1 - 32) << 10; | - |
| 905 | x -= ( ((y1 & 63) - 32) * xinc ) >> 6; executed (the execution status of this line is deduced): x -= ( ((y1 & 63) - 32) * xinc ) >> 6; | - |
| 906 | | - |
| 907 | capAdjust(caps, y1, y2, x, xinc); executed (the execution status of this line is deduced): capAdjust(caps, y1, y2, x, xinc); | - |
| 908 | | - |
| 909 | Dasher dasher(stroker, swapped, y1, y2); executed (the execution status of this line is deduced): Dasher dasher(stroker, swapped, y1, y2); | - |
| 910 | | - |
| 911 | int y = y1 >> 6; executed (the execution status of this line is deduced): int y = y1 >> 6; | - |
| 912 | int ys = y2 >> 6; executed (the execution status of this line is deduced): int ys = y2 >> 6; | - |
| 913 | | - |
| 914 | int alphaStart, alphaEnd; executed (the execution status of this line is deduced): int alphaStart, alphaEnd; | - |
| 915 | if (y == ys) { partially evaluated: y == ys| no Evaluation Count:0 | yes Evaluation Count:1200 |
| 0-1200 |
| 916 | alphaStart = y2 - y1; never executed (the execution status of this line is deduced): alphaStart = y2 - y1; | - |
| 917 | Q_ASSERT(alphaStart >= 0 && alphaStart < 64); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 918 | alphaEnd = 0; never executed (the execution status of this line is deduced): alphaEnd = 0; | - |
| 919 | } else { | 0 |
| 920 | alphaStart = 64 - (y1 & 63); executed (the execution status of this line is deduced): alphaStart = 64 - (y1 & 63); | - |
| 921 | alphaEnd = (y2 & 63); executed (the execution status of this line is deduced): alphaEnd = (y2 & 63); | - |
| 922 | } executed: }Execution Count:1200 | 1200 |
| 923 | // qDebug() << "vertical" << x1/64. << y1/64. << x2/64. << y2/64.; | - |
| 924 | // qDebug() << " x=" << x << "dx=" << dx << "xi=" << (x>>16) << "xsi=" << ((x+(ys-y)*dx)>>16) << "y=" << y << "ys=" << ys; | - |
| 925 | | - |
| 926 | // draw first pixel | - |
| 927 | if (dasher.on()) { partially evaluated: dasher.on()| yes Evaluation Count:1200 | no Evaluation Count:0 |
| 0-1200 |
| 928 | uint alpha = (quint8)(x >> 8); executed (the execution status of this line is deduced): uint alpha = (quint8)(x >> 8); | - |
| 929 | drawPixel(stroker, x>>16, y, (255-alpha) * alphaStart >> 6); executed (the execution status of this line is deduced): drawPixel(stroker, x>>16, y, (255-alpha) * alphaStart >> 6); | - |
| 930 | drawPixel(stroker, (x>>16) + 1, y, alpha * alphaStart >> 6); executed (the execution status of this line is deduced): drawPixel(stroker, (x>>16) + 1, y, alpha * alphaStart >> 6); | - |
| 931 | } executed: }Execution Count:1200 | 1200 |
| 932 | dasher.adjust(); executed (the execution status of this line is deduced): dasher.adjust(); | - |
| 933 | x += xinc; executed (the execution status of this line is deduced): x += xinc; | - |
| 934 | ++y; executed (the execution status of this line is deduced): ++y; | - |
| 935 | if (y < ys) { evaluated: y < ys| yes Evaluation Count:921 | yes Evaluation Count:279 |
| 279-921 |
| 936 | do { | - |
| 937 | if (dasher.on()) { partially evaluated: dasher.on()| yes Evaluation Count:19395 | no Evaluation Count:0 |
| 0-19395 |
| 938 | uint alpha = (quint8)(x >> 8); executed (the execution status of this line is deduced): uint alpha = (quint8)(x >> 8); | - |
| 939 | drawPixel(stroker, x>>16, y, (255-alpha)); executed (the execution status of this line is deduced): drawPixel(stroker, x>>16, y, (255-alpha)); | - |
| 940 | drawPixel(stroker, (x>>16) + 1, y, alpha); executed (the execution status of this line is deduced): drawPixel(stroker, (x>>16) + 1, y, alpha); | - |
| 941 | } executed: }Execution Count:19395 | 19395 |
| 942 | dasher.adjust(); executed (the execution status of this line is deduced): dasher.adjust(); | - |
| 943 | x += xinc; executed (the execution status of this line is deduced): x += xinc; | - |
| 944 | } while (++y < ys); executed: }Execution Count:19395 evaluated: ++y < ys| yes Evaluation Count:18474 | yes Evaluation Count:921 |
| 921-19395 |
| 945 | } executed: }Execution Count:921 | 921 |
| 946 | // draw last pixel | - |
| 947 | if (alphaEnd && dasher.on()) { evaluated: alphaEnd| yes Evaluation Count:853 | yes Evaluation Count:347 |
partially evaluated: dasher.on()| yes Evaluation Count:853 | no Evaluation Count:0 |
| 0-853 |
| 948 | uint alpha = (quint8)(x >> 8); executed (the execution status of this line is deduced): uint alpha = (quint8)(x >> 8); | - |
| 949 | drawPixel(stroker, x>>16, y, (255-alpha) * alphaEnd >> 6); executed (the execution status of this line is deduced): drawPixel(stroker, x>>16, y, (255-alpha) * alphaEnd >> 6); | - |
| 950 | drawPixel(stroker, (x>>16) + 1, y, alpha * alphaEnd >> 6); executed (the execution status of this line is deduced): drawPixel(stroker, (x>>16) + 1, y, alpha * alphaEnd >> 6); | - |
| 951 | } executed: }Execution Count:853 | 853 |
| 952 | } else { executed: }Execution Count:1200 | 1200 |
| 953 | // horizontal | - |
| 954 | if (!dx) evaluated: !dx| yes Evaluation Count:46 | yes Evaluation Count:1453 |
| 46-1453 |
| 955 | return; executed: return;Execution Count:46 | 46 |
| 956 | | - |
| 957 | int yinc = F16Dot16FixedDiv(dy, dx); executed (the execution status of this line is deduced): int yinc = F16Dot16FixedDiv(dy, dx); | - |
| 958 | | - |
| 959 | bool swapped = false; executed (the execution status of this line is deduced): bool swapped = false; | - |
| 960 | if (x1 > x2) { evaluated: x1 > x2| yes Evaluation Count:618 | yes Evaluation Count:835 |
| 618-835 |
| 961 | qSwap(x1, x2); executed (the execution status of this line is deduced): qSwap(x1, x2); | - |
| 962 | qSwap(y1, y2); executed (the execution status of this line is deduced): qSwap(y1, y2); | - |
| 963 | swapped = true; executed (the execution status of this line is deduced): swapped = true; | - |
| 964 | caps = swapCaps(caps); executed (the execution status of this line is deduced): caps = swapCaps(caps); | - |
| 965 | } executed: }Execution Count:618 | 618 |
| 966 | | - |
| 967 | int y = (y1 - 32) << 10; executed (the execution status of this line is deduced): int y = (y1 - 32) << 10; | - |
| 968 | y -= ( ((x1 & 63) - 32) * yinc ) >> 6; executed (the execution status of this line is deduced): y -= ( ((x1 & 63) - 32) * yinc ) >> 6; | - |
| 969 | | - |
| 970 | capAdjust(caps, x1, x2, y, yinc); executed (the execution status of this line is deduced): capAdjust(caps, x1, x2, y, yinc); | - |
| 971 | | - |
| 972 | Dasher dasher(stroker, swapped, x1, x2); executed (the execution status of this line is deduced): Dasher dasher(stroker, swapped, x1, x2); | - |
| 973 | | - |
| 974 | int x = x1 >> 6; executed (the execution status of this line is deduced): int x = x1 >> 6; | - |
| 975 | int xs = x2 >> 6; executed (the execution status of this line is deduced): int xs = x2 >> 6; | - |
| 976 | | - |
| 977 | // qDebug() << "horizontal" << x1/64. << y1/64. << x2/64. << y2/64.; | - |
| 978 | // qDebug() << " y=" << y << "dy=" << dy << "x=" << x << "xs=" << xs << "yi=" << (y>>16) << "ysi=" << ((y+(xs-x)*dy)>>16); | - |
| 979 | int alphaStart, alphaEnd; executed (the execution status of this line is deduced): int alphaStart, alphaEnd; | - |
| 980 | if (x == xs) { partially evaluated: x == xs| no Evaluation Count:0 | yes Evaluation Count:1453 |
| 0-1453 |
| 981 | alphaStart = x2 - x1; never executed (the execution status of this line is deduced): alphaStart = x2 - x1; | - |
| 982 | Q_ASSERT(alphaStart >= 0 && alphaStart < 64); never executed (the execution status of this line is deduced): qt_noop(); | - |
| 983 | alphaEnd = 0; never executed (the execution status of this line is deduced): alphaEnd = 0; | - |
| 984 | } else { | 0 |
| 985 | alphaStart = 64 - (x1 & 63); executed (the execution status of this line is deduced): alphaStart = 64 - (x1 & 63); | - |
| 986 | alphaEnd = (x2 & 63); executed (the execution status of this line is deduced): alphaEnd = (x2 & 63); | - |
| 987 | } executed: }Execution Count:1453 | 1453 |
| 988 | | - |
| 989 | // draw first pixel | - |
| 990 | if (dasher.on()) { partially evaluated: dasher.on()| yes Evaluation Count:1453 | no Evaluation Count:0 |
| 0-1453 |
| 991 | uint alpha = (quint8)(y >> 8); executed (the execution status of this line is deduced): uint alpha = (quint8)(y >> 8); | - |
| 992 | drawPixel(stroker, x, y>>16, (255-alpha) * alphaStart >> 6); executed (the execution status of this line is deduced): drawPixel(stroker, x, y>>16, (255-alpha) * alphaStart >> 6); | - |
| 993 | drawPixel(stroker, x, (y>>16) + 1, alpha * alphaStart >> 6); executed (the execution status of this line is deduced): drawPixel(stroker, x, (y>>16) + 1, alpha * alphaStart >> 6); | - |
| 994 | } executed: }Execution Count:1453 | 1453 |
| 995 | dasher.adjust(); executed (the execution status of this line is deduced): dasher.adjust(); | - |
| 996 | y += yinc; executed (the execution status of this line is deduced): y += yinc; | - |
| 997 | ++x; executed (the execution status of this line is deduced): ++x; | - |
| 998 | // draw line | - |
| 999 | if (x < xs) { evaluated: x < xs| yes Evaluation Count:1174 | yes Evaluation Count:279 |
| 279-1174 |
| 1000 | do { | - |
| 1001 | if (dasher.on()) { partially evaluated: dasher.on()| yes Evaluation Count:33017 | no Evaluation Count:0 |
| 0-33017 |
| 1002 | uint alpha = (quint8)(y >> 8); executed (the execution status of this line is deduced): uint alpha = (quint8)(y >> 8); | - |
| 1003 | drawPixel(stroker, x, y>>16, (255-alpha)); executed (the execution status of this line is deduced): drawPixel(stroker, x, y>>16, (255-alpha)); | - |
| 1004 | drawPixel(stroker, x, (y>>16) + 1, alpha); executed (the execution status of this line is deduced): drawPixel(stroker, x, (y>>16) + 1, alpha); | - |
| 1005 | } executed: }Execution Count:33017 | 33017 |
| 1006 | dasher.adjust(); executed (the execution status of this line is deduced): dasher.adjust(); | - |
| 1007 | y += yinc; executed (the execution status of this line is deduced): y += yinc; | - |
| 1008 | } while (++x < xs); executed: }Execution Count:33017 evaluated: ++x < xs| yes Evaluation Count:31843 | yes Evaluation Count:1174 |
| 1174-33017 |
| 1009 | } executed: }Execution Count:1174 | 1174 |
| 1010 | // draw last pixel | - |
| 1011 | if (alphaEnd && dasher.on()) { evaluated: alphaEnd| yes Evaluation Count:1015 | yes Evaluation Count:438 |
partially evaluated: dasher.on()| yes Evaluation Count:1015 | no Evaluation Count:0 |
| 0-1015 |
| 1012 | uint alpha = (quint8)(y >> 8); executed (the execution status of this line is deduced): uint alpha = (quint8)(y >> 8); | - |
| 1013 | drawPixel(stroker, x, y>>16, (255-alpha) * alphaEnd >> 6); executed (the execution status of this line is deduced): drawPixel(stroker, x, y>>16, (255-alpha) * alphaEnd >> 6); | - |
| 1014 | drawPixel(stroker, x, (y>>16) + 1, alpha * alphaEnd >> 6); executed (the execution status of this line is deduced): drawPixel(stroker, x, (y>>16) + 1, alpha * alphaEnd >> 6); | - |
| 1015 | } executed: }Execution Count:1015 | 1015 |
| 1016 | } executed: }Execution Count:1453 | 1453 |
| 1017 | } | - |
| 1018 | | - |
| 1019 | QT_END_NAMESPACE | - |
| 1020 | | - |
| | |