| 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 "private/qpaintengine_blitter_p.h" | - |
| 43 | | - |
| 44 | #include "private/qblittable_p.h" | - |
| 45 | #include "private/qpaintengine_raster_p.h" | - |
| 46 | #include "private/qpainter_p.h" | - |
| 47 | #include "private/qpixmap_blitter_p.h" | - |
| 48 | | - |
| 49 | #ifndef QT_NO_BLITTABLE | - |
| 50 | QT_BEGIN_NAMESPACE | - |
| 51 | | - |
| 52 | #define STATE_XFORM_SCALE 0x00000001 | - |
| 53 | #define STATE_XFORM_COMPLEX 0x00000002 | - |
| 54 | | - |
| 55 | #define STATE_BRUSH_PATTERN 0x00000010 | - |
| 56 | #define STATE_BRUSH_ALPHA 0x00000020 | - |
| 57 | | - |
| 58 | #define STATE_PEN_ENABLED 0x00000100 | - |
| 59 | | - |
| 60 | #define STATE_ANTIALIASING 0x00001000 | - |
| 61 | #define STATE_ALPHA 0x00002000 | - |
| 62 | #define STATE_BLENDING_COMPLEX 0x00004000 | - |
| 63 | | - |
| 64 | #define STATE_CLIPSYS_COMPLEX 0x00010000 | - |
| 65 | #define STATE_CLIP_COMPLEX 0x00020000 | - |
| 66 | | - |
| 67 | | - |
| 68 | class CapabilitiesToStateMask | - |
| 69 | { | - |
| 70 | public: | - |
| 71 | CapabilitiesToStateMask(QBlittable::Capabilities capabilities) | - |
| 72 | : m_capabilities(capabilities) | - |
| 73 | , fillRectMask(0) | - |
| 74 | , drawRectMask(0) | - |
| 75 | , drawPixmapMask(0) | - |
| 76 | , alphaFillRectMask(0) | - |
| 77 | , opacityPixmapMask(0) | - |
| 78 | , capabillitiesState(0) | - |
| 79 | { | - |
| 80 | if (capabilities & QBlittable::SolidRectCapability) never evaluated: capabilities & QBlittable::SolidRectCapability | 0 |
| 81 | setFillRectMask(); never executed: setFillRectMask(); | 0 |
| 82 | if (capabilities & QBlittable::SourcePixmapCapability) never evaluated: capabilities & QBlittable::SourcePixmapCapability | 0 |
| 83 | setSourcePixmapMask(); never executed: setSourcePixmapMask(); | 0 |
| 84 | if (capabilities & QBlittable::SourceOverPixmapCapability) never evaluated: capabilities & QBlittable::SourceOverPixmapCapability | 0 |
| 85 | setSourceOverPixmapMask(); never executed: setSourceOverPixmapMask(); | 0 |
| 86 | if (capabilities & QBlittable::SourceOverScaledPixmapCapability) never evaluated: capabilities & QBlittable::SourceOverScaledPixmapCapability | 0 |
| 87 | setSourceOverScaledPixmapMask(); never executed: setSourceOverScaledPixmapMask(); | 0 |
| 88 | if (capabilities & QBlittable::AlphaFillRectCapability) never evaluated: capabilities & QBlittable::AlphaFillRectCapability | 0 |
| 89 | setAlphaFillRectMask(); never executed: setAlphaFillRectMask(); | 0 |
| 90 | if (capabilities & QBlittable::OpacityPixmapCapability) never evaluated: capabilities & QBlittable::OpacityPixmapCapability | 0 |
| 91 | setOpacityPixmapMask(); never executed: setOpacityPixmapMask(); | 0 |
| 92 | } | 0 |
| 93 | | - |
| 94 | inline bool canBlitterFillRect() const | - |
| 95 | { | - |
| 96 | return checkStateAgainstMask(capabillitiesState, fillRectMask); never executed: return checkStateAgainstMask(capabillitiesState, fillRectMask); | 0 |
| 97 | } | - |
| 98 | | - |
| 99 | inline bool canBlitterAlphaFillRect() const | - |
| 100 | { | - |
| 101 | return checkStateAgainstMask(capabillitiesState, alphaFillRectMask); never executed: return checkStateAgainstMask(capabillitiesState, alphaFillRectMask); | 0 |
| 102 | } | - |
| 103 | | - |
| 104 | inline bool canBlitterDrawRectMask() const | - |
| 105 | { | - |
| 106 | return checkStateAgainstMask(capabillitiesState, drawRectMask); never executed: return checkStateAgainstMask(capabillitiesState, drawRectMask); | 0 |
| 107 | } | - |
| 108 | | - |
| 109 | bool canBlitterDrawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) const | - |
| 110 | { | - |
| 111 | if (pm.handle()->classId() != QPlatformPixmap::BlitterClass) never evaluated: pm.handle()->classId() != QPlatformPixmap::BlitterClass | 0 |
| 112 | return false; never executed: return false; | 0 |
| 113 | if (checkStateAgainstMask(capabillitiesState, drawPixmapMask)) { never evaluated: checkStateAgainstMask(capabillitiesState, drawPixmapMask) | 0 |
| 114 | if (m_capabilities & (QBlittable::SourceOverPixmapCapability never evaluated: m_capabilities & (QBlittable::SourceOverPixmapCapability | QBlittable::SourceOverScaledPixmapCapability) | 0 |
| 115 | | QBlittable::SourceOverScaledPixmapCapability)) { never evaluated: m_capabilities & (QBlittable::SourceOverPixmapCapability | QBlittable::SourceOverScaledPixmapCapability) | 0 |
| 116 | if (r.size() != sr.size()) never evaluated: r.size() != sr.size() | 0 |
| 117 | return m_capabilities & QBlittable::SourceOverScaledPixmapCapability; never executed: return m_capabilities & QBlittable::SourceOverScaledPixmapCapability; | 0 |
| 118 | else | - |
| 119 | return m_capabilities & QBlittable::SourceOverPixmapCapability; never executed: return m_capabilities & QBlittable::SourceOverPixmapCapability; | 0 |
| 120 | } | - |
| 121 | if ((m_capabilities & QBlittable::SourcePixmapCapability) && r.size() == sr.size() && !pm.hasAlphaChannel()) never evaluated: (m_capabilities & QBlittable::SourcePixmapCapability) never evaluated: r.size() == sr.size() never evaluated: !pm.hasAlphaChannel() | 0 |
| 122 | return m_capabilities & QBlittable::SourcePixmapCapability; never executed: return m_capabilities & QBlittable::SourcePixmapCapability; | 0 |
| 123 | } | 0 |
| 124 | return false; never executed: return false; | 0 |
| 125 | } | - |
| 126 | | - |
| 127 | bool canBlitterDrawPixmapOpacity(const QPixmap &pm) const | - |
| 128 | { | - |
| 129 | if (pm.handle()->classId() != QPlatformPixmap::BlitterClass) never evaluated: pm.handle()->classId() != QPlatformPixmap::BlitterClass | 0 |
| 130 | return false; never executed: return false; | 0 |
| 131 | | - |
| 132 | return checkStateAgainstMask(capabillitiesState, opacityPixmapMask); never executed: return checkStateAgainstMask(capabillitiesState, opacityPixmapMask); | 0 |
| 133 | } | - |
| 134 | | - |
| 135 | inline void updateState(uint mask, bool on) { | - |
| 136 | updateStateBits(&capabillitiesState, mask, on); never executed (the execution status of this line is deduced): updateStateBits(&capabillitiesState, mask, on); | - |
| 137 | } | 0 |
| 138 | | - |
| 139 | private: | - |
| 140 | | - |
| 141 | static inline void updateStateBits(uint *state, uint mask, bool on) | - |
| 142 | { | - |
| 143 | *state = on ? (*state | mask) : (*state & ~mask); | 0 |
| 144 | } | 0 |
| 145 | | - |
| 146 | static inline bool checkStateAgainstMask(uint state, uint mask) | - |
| 147 | { | - |
| 148 | return !state || (state & mask && !(state & ~mask)); never executed: return !state || (state & mask && !(state & ~mask)); | 0 |
| 149 | } | - |
| 150 | | - |
| 151 | void setFillRectMask() { | - |
| 152 | updateStateBits(&fillRectMask, STATE_XFORM_SCALE, false); never executed (the execution status of this line is deduced): updateStateBits(&fillRectMask, 0x00000001, false); | - |
| 153 | updateStateBits(&fillRectMask, STATE_XFORM_COMPLEX, false); never executed (the execution status of this line is deduced): updateStateBits(&fillRectMask, 0x00000002, false); | - |
| 154 | | - |
| 155 | updateStateBits(&fillRectMask, STATE_BRUSH_PATTERN, false); never executed (the execution status of this line is deduced): updateStateBits(&fillRectMask, 0x00000010, false); | - |
| 156 | updateStateBits(&fillRectMask, STATE_BRUSH_ALPHA, false); never executed (the execution status of this line is deduced): updateStateBits(&fillRectMask, 0x00000020, false); | - |
| 157 | | - |
| 158 | updateStateBits(&fillRectMask, STATE_PEN_ENABLED, true); never executed (the execution status of this line is deduced): updateStateBits(&fillRectMask, 0x00000100, true); | - |
| 159 | | - |
| 160 | //Sub-pixel aliasing should not be sent to the blitter | - |
| 161 | updateStateBits(&fillRectMask, STATE_ANTIALIASING, true); never executed (the execution status of this line is deduced): updateStateBits(&fillRectMask, 0x00001000, true); | - |
| 162 | updateStateBits(&fillRectMask, STATE_ALPHA, false); never executed (the execution status of this line is deduced): updateStateBits(&fillRectMask, 0x00002000, false); | - |
| 163 | updateStateBits(&fillRectMask, STATE_BLENDING_COMPLEX, false); never executed (the execution status of this line is deduced): updateStateBits(&fillRectMask, 0x00004000, false); | - |
| 164 | | - |
| 165 | updateStateBits(&fillRectMask, STATE_CLIPSYS_COMPLEX, false); never executed (the execution status of this line is deduced): updateStateBits(&fillRectMask, 0x00010000, false); | - |
| 166 | updateStateBits(&fillRectMask, STATE_CLIP_COMPLEX, false); never executed (the execution status of this line is deduced): updateStateBits(&fillRectMask, 0x00020000, false); | - |
| 167 | } | 0 |
| 168 | | - |
| 169 | void setAlphaFillRectMask() { | - |
| 170 | updateStateBits(&alphaFillRectMask, STATE_XFORM_SCALE, false); never executed (the execution status of this line is deduced): updateStateBits(&alphaFillRectMask, 0x00000001, false); | - |
| 171 | updateStateBits(&alphaFillRectMask, STATE_XFORM_COMPLEX, false); never executed (the execution status of this line is deduced): updateStateBits(&alphaFillRectMask, 0x00000002, false); | - |
| 172 | | - |
| 173 | updateStateBits(&alphaFillRectMask, STATE_BRUSH_PATTERN, false); never executed (the execution status of this line is deduced): updateStateBits(&alphaFillRectMask, 0x00000010, false); | - |
| 174 | updateStateBits(&alphaFillRectMask, STATE_BRUSH_ALPHA, true); never executed (the execution status of this line is deduced): updateStateBits(&alphaFillRectMask, 0x00000020, true); | - |
| 175 | | - |
| 176 | updateStateBits(&alphaFillRectMask, STATE_PEN_ENABLED, true); never executed (the execution status of this line is deduced): updateStateBits(&alphaFillRectMask, 0x00000100, true); | - |
| 177 | | - |
| 178 | //Sub-pixel aliasing should not be sent to the blitter | - |
| 179 | updateStateBits(&alphaFillRectMask, STATE_ANTIALIASING, true); never executed (the execution status of this line is deduced): updateStateBits(&alphaFillRectMask, 0x00001000, true); | - |
| 180 | updateStateBits(&alphaFillRectMask, STATE_ALPHA, false); never executed (the execution status of this line is deduced): updateStateBits(&alphaFillRectMask, 0x00002000, false); | - |
| 181 | updateStateBits(&alphaFillRectMask, STATE_BLENDING_COMPLEX, false); never executed (the execution status of this line is deduced): updateStateBits(&alphaFillRectMask, 0x00004000, false); | - |
| 182 | | - |
| 183 | updateStateBits(&alphaFillRectMask, STATE_CLIPSYS_COMPLEX, false); never executed (the execution status of this line is deduced): updateStateBits(&alphaFillRectMask, 0x00010000, false); | - |
| 184 | updateStateBits(&alphaFillRectMask, STATE_CLIP_COMPLEX, false); never executed (the execution status of this line is deduced): updateStateBits(&alphaFillRectMask, 0x00020000, false); | - |
| 185 | } | 0 |
| 186 | | - |
| 187 | void setSourcePixmapMask() { | - |
| 188 | updateStateBits(&drawPixmapMask, STATE_XFORM_SCALE, true); never executed (the execution status of this line is deduced): updateStateBits(&drawPixmapMask, 0x00000001, true); | - |
| 189 | updateStateBits(&drawPixmapMask, STATE_XFORM_COMPLEX, false); never executed (the execution status of this line is deduced): updateStateBits(&drawPixmapMask, 0x00000002, false); | - |
| 190 | | - |
| 191 | updateStateBits(&drawPixmapMask, STATE_BRUSH_PATTERN, true); never executed (the execution status of this line is deduced): updateStateBits(&drawPixmapMask, 0x00000010, true); | - |
| 192 | updateStateBits(&drawPixmapMask, STATE_BRUSH_ALPHA, false); never executed (the execution status of this line is deduced): updateStateBits(&drawPixmapMask, 0x00000020, false); | - |
| 193 | | - |
| 194 | updateStateBits(&drawPixmapMask, STATE_PEN_ENABLED, true); never executed (the execution status of this line is deduced): updateStateBits(&drawPixmapMask, 0x00000100, true); | - |
| 195 | | - |
| 196 | updateStateBits(&drawPixmapMask, STATE_ANTIALIASING, true); never executed (the execution status of this line is deduced): updateStateBits(&drawPixmapMask, 0x00001000, true); | - |
| 197 | updateStateBits(&drawPixmapMask, STATE_ALPHA, false); never executed (the execution status of this line is deduced): updateStateBits(&drawPixmapMask, 0x00002000, false); | - |
| 198 | updateStateBits(&drawPixmapMask, STATE_BLENDING_COMPLEX, false); never executed (the execution status of this line is deduced): updateStateBits(&drawPixmapMask, 0x00004000, false); | - |
| 199 | | - |
| 200 | updateStateBits(&drawPixmapMask, STATE_CLIPSYS_COMPLEX, false); never executed (the execution status of this line is deduced): updateStateBits(&drawPixmapMask, 0x00010000, false); | - |
| 201 | updateStateBits(&drawPixmapMask, STATE_CLIP_COMPLEX, false); never executed (the execution status of this line is deduced): updateStateBits(&drawPixmapMask, 0x00020000, false); | - |
| 202 | } | 0 |
| 203 | | - |
| 204 | void setSourceOverPixmapMask() { | - |
| 205 | setSourcePixmapMask(); never executed (the execution status of this line is deduced): setSourcePixmapMask(); | - |
| 206 | } | 0 |
| 207 | | - |
| 208 | void setSourceOverScaledPixmapMask() { | - |
| 209 | setSourceOverPixmapMask(); never executed (the execution status of this line is deduced): setSourceOverPixmapMask(); | - |
| 210 | updateStateBits(&drawRectMask, STATE_XFORM_SCALE, true); never executed (the execution status of this line is deduced): updateStateBits(&drawRectMask, 0x00000001, true); | - |
| 211 | } | 0 |
| 212 | | - |
| 213 | void setOpacityPixmapMask() { | - |
| 214 | updateStateBits(&opacityPixmapMask, STATE_XFORM_SCALE, true); never executed (the execution status of this line is deduced): updateStateBits(&opacityPixmapMask, 0x00000001, true); | - |
| 215 | updateStateBits(&opacityPixmapMask, STATE_XFORM_COMPLEX, false); never executed (the execution status of this line is deduced): updateStateBits(&opacityPixmapMask, 0x00000002, false); | - |
| 216 | | - |
| 217 | updateStateBits(&opacityPixmapMask, STATE_BRUSH_PATTERN, true); never executed (the execution status of this line is deduced): updateStateBits(&opacityPixmapMask, 0x00000010, true); | - |
| 218 | updateStateBits(&opacityPixmapMask, STATE_BRUSH_ALPHA, true); never executed (the execution status of this line is deduced): updateStateBits(&opacityPixmapMask, 0x00000020, true); | - |
| 219 | | - |
| 220 | updateStateBits(&opacityPixmapMask, STATE_PEN_ENABLED, true); never executed (the execution status of this line is deduced): updateStateBits(&opacityPixmapMask, 0x00000100, true); | - |
| 221 | | - |
| 222 | updateStateBits(&opacityPixmapMask, STATE_ANTIALIASING, true); never executed (the execution status of this line is deduced): updateStateBits(&opacityPixmapMask, 0x00001000, true); | - |
| 223 | updateStateBits(&opacityPixmapMask, STATE_ALPHA, true); never executed (the execution status of this line is deduced): updateStateBits(&opacityPixmapMask, 0x00002000, true); | - |
| 224 | updateStateBits(&opacityPixmapMask, STATE_BLENDING_COMPLEX, false); never executed (the execution status of this line is deduced): updateStateBits(&opacityPixmapMask, 0x00004000, false); | - |
| 225 | | - |
| 226 | updateStateBits(&opacityPixmapMask, STATE_CLIPSYS_COMPLEX, false); never executed (the execution status of this line is deduced): updateStateBits(&opacityPixmapMask, 0x00010000, false); | - |
| 227 | updateStateBits(&opacityPixmapMask, STATE_CLIP_COMPLEX, false); never executed (the execution status of this line is deduced): updateStateBits(&opacityPixmapMask, 0x00020000, false); | - |
| 228 | } | 0 |
| 229 | | - |
| 230 | QBlittable::Capabilities m_capabilities; | - |
| 231 | uint fillRectMask; | - |
| 232 | uint drawRectMask; | - |
| 233 | uint drawPixmapMask; | - |
| 234 | uint alphaFillRectMask; | - |
| 235 | uint opacityPixmapMask; | - |
| 236 | uint capabillitiesState; | - |
| 237 | }; | - |
| 238 | | - |
| 239 | class QBlitterPaintEnginePrivate : public QRasterPaintEnginePrivate | - |
| 240 | { | - |
| 241 | Q_DECLARE_PUBLIC(QBlitterPaintEngine); | - |
| 242 | public: | - |
| 243 | QBlitterPaintEnginePrivate(QBlittablePlatformPixmap *p) | - |
| 244 | : QRasterPaintEnginePrivate() | - |
| 245 | , pmData(p) | - |
| 246 | , caps(pmData->blittable()->capabilities()) | - |
| 247 | , hasXForm(false) | - |
| 248 | | - |
| 249 | {} | 0 |
| 250 | | - |
| 251 | void lock(); | - |
| 252 | void unlock(); | - |
| 253 | void fillRect(const QRectF &rect, const QColor &color, bool alpha); | - |
| 254 | void clipAndDrawPixmap(const QRectF &clip, const QRectF &target, const QPixmap &pm, const QRectF &sr, bool opacity); | - |
| 255 | | - |
| 256 | | - |
| 257 | void updateCompleteState(QPainterState *s); | - |
| 258 | void updatePenState(QPainterState *s); | - |
| 259 | void updateBrushState(QPainterState *s); | - |
| 260 | void updateOpacityState(QPainterState *s); | - |
| 261 | void updateCompositionModeState(QPainterState *s); | - |
| 262 | void updateRenderHintsState(QPainterState *s); | - |
| 263 | void updateTransformState(QPainterState *s); | - |
| 264 | void updateClipState(QPainterState *s); | - |
| 265 | | - |
| 266 | QBlittablePlatformPixmap *pmData; | - |
| 267 | CapabilitiesToStateMask caps; | - |
| 268 | uint hasXForm; | - |
| 269 | }; | - |
| 270 | | - |
| 271 | | - |
| 272 | inline void QBlitterPaintEnginePrivate::lock() | - |
| 273 | { | - |
| 274 | if (!pmData->blittable()->isLocked()) never evaluated: !pmData->blittable()->isLocked() | 0 |
| 275 | rasterBuffer->prepare(pmData->buffer()); never executed: rasterBuffer->prepare(pmData->buffer()); | 0 |
| 276 | } | 0 |
| 277 | | - |
| 278 | inline void QBlitterPaintEnginePrivate::unlock() | - |
| 279 | { | - |
| 280 | pmData->blittable()->unlock(); never executed (the execution status of this line is deduced): pmData->blittable()->unlock(); | - |
| 281 | } | 0 |
| 282 | | - |
| 283 | // State tracking to make decisions | - |
| 284 | void QBlitterPaintEnginePrivate::updateCompleteState(QPainterState *s) | - |
| 285 | { | - |
| 286 | updatePenState(s); never executed (the execution status of this line is deduced): updatePenState(s); | - |
| 287 | updateBrushState(s); never executed (the execution status of this line is deduced): updateBrushState(s); | - |
| 288 | updateOpacityState(s); never executed (the execution status of this line is deduced): updateOpacityState(s); | - |
| 289 | updateCompositionModeState(s); never executed (the execution status of this line is deduced): updateCompositionModeState(s); | - |
| 290 | updateRenderHintsState(s); never executed (the execution status of this line is deduced): updateRenderHintsState(s); | - |
| 291 | updateTransformState(s); never executed (the execution status of this line is deduced): updateTransformState(s); | - |
| 292 | updateClipState(s); never executed (the execution status of this line is deduced): updateClipState(s); | - |
| 293 | } | 0 |
| 294 | | - |
| 295 | void QBlitterPaintEnginePrivate::updatePenState(QPainterState *s) | - |
| 296 | { | - |
| 297 | caps.updateState(STATE_PEN_ENABLED, qpen_style(s->pen) != Qt::NoPen); never executed (the execution status of this line is deduced): caps.updateState(0x00000100, qpen_style(s->pen) != Qt::NoPen); | - |
| 298 | } | 0 |
| 299 | | - |
| 300 | void QBlitterPaintEnginePrivate::updateBrushState(QPainterState *s) | - |
| 301 | { | - |
| 302 | Qt::BrushStyle style = qbrush_style(s->brush); never executed (the execution status of this line is deduced): Qt::BrushStyle style = qbrush_style(s->brush); | - |
| 303 | | - |
| 304 | caps.updateState(STATE_BRUSH_PATTERN, style > Qt::SolidPattern); never executed (the execution status of this line is deduced): caps.updateState(0x00000010, style > Qt::SolidPattern); | - |
| 305 | caps.updateState(STATE_BRUSH_ALPHA, never executed (the execution status of this line is deduced): caps.updateState(0x00000020, | - |
| 306 | qbrush_color(s->brush).alpha() < 255); never executed (the execution status of this line is deduced): qbrush_color(s->brush).alpha() < 255); | - |
| 307 | } | 0 |
| 308 | | - |
| 309 | void QBlitterPaintEnginePrivate::updateOpacityState(QPainterState *s) | - |
| 310 | { | - |
| 311 | bool translucent = s->opacity < 1; never executed (the execution status of this line is deduced): bool translucent = s->opacity < 1; | - |
| 312 | caps.updateState(STATE_ALPHA, translucent); never executed (the execution status of this line is deduced): caps.updateState(0x00002000, translucent); | - |
| 313 | } | 0 |
| 314 | | - |
| 315 | void QBlitterPaintEnginePrivate::updateCompositionModeState(QPainterState *s) | - |
| 316 | { | - |
| 317 | bool nonTrivial = s->composition_mode != QPainter::CompositionMode_SourceOver never evaluated: s->composition_mode != QPainter::CompositionMode_SourceOver | 0 |
| 318 | && s->composition_mode != QPainter::CompositionMode_Source; never evaluated: s->composition_mode != QPainter::CompositionMode_Source | 0 |
| 319 | | - |
| 320 | caps.updateState(STATE_BLENDING_COMPLEX, nonTrivial); never executed (the execution status of this line is deduced): caps.updateState(0x00004000, nonTrivial); | - |
| 321 | } | 0 |
| 322 | | - |
| 323 | void QBlitterPaintEnginePrivate::updateRenderHintsState(QPainterState *s) | - |
| 324 | { | - |
| 325 | bool aa = s->renderHints & QPainter::Antialiasing; never executed (the execution status of this line is deduced): bool aa = s->renderHints & QPainter::Antialiasing; | - |
| 326 | caps.updateState(STATE_ANTIALIASING, aa); never executed (the execution status of this line is deduced): caps.updateState(0x00001000, aa); | - |
| 327 | } | 0 |
| 328 | | - |
| 329 | void QBlitterPaintEnginePrivate::updateTransformState(QPainterState *s) | - |
| 330 | { | - |
| 331 | QTransform::TransformationType type = s->matrix.type(); never executed (the execution status of this line is deduced): QTransform::TransformationType type = s->matrix.type(); | - |
| 332 | | - |
| 333 | // consider scaling operations with a negative factor as "complex" for now. | - |
| 334 | // as some blitters could handle axisymmetrical operations, we should improve blitter | - |
| 335 | // paint engine to handle them as a capability | - |
| 336 | caps.updateState(STATE_XFORM_COMPLEX, (type > QTransform::TxScale) || never executed (the execution status of this line is deduced): caps.updateState(0x00000002, (type > QTransform::TxScale) || | - |
| 337 | ((type == QTransform::TxScale) && ((s->matrix.m11() < 0.0) || (s->matrix.m22() < 0.0)))); never executed (the execution status of this line is deduced): ((type == QTransform::TxScale) && ((s->matrix.m11() < 0.0) || (s->matrix.m22() < 0.0)))); | - |
| 338 | caps.updateState(STATE_XFORM_SCALE, type > QTransform::TxTranslate); never executed (the execution status of this line is deduced): caps.updateState(0x00000001, type > QTransform::TxTranslate); | - |
| 339 | | - |
| 340 | hasXForm = type >= QTransform::TxTranslate; never executed (the execution status of this line is deduced): hasXForm = type >= QTransform::TxTranslate; | - |
| 341 | } | 0 |
| 342 | | - |
| 343 | void QBlitterPaintEnginePrivate::updateClipState(QPainterState *) | - |
| 344 | { | - |
| 345 | const QClipData *clipData = clip(); never executed (the execution status of this line is deduced): const QClipData *clipData = clip(); | - |
| 346 | bool complexClip = clipData && !(clipData->hasRectClip || clipData->hasRegionClip); never evaluated: clipData never evaluated: clipData->hasRectClip never evaluated: clipData->hasRegionClip | 0 |
| 347 | caps.updateState(STATE_CLIP_COMPLEX, complexClip); never executed (the execution status of this line is deduced): caps.updateState(0x00020000, complexClip); | - |
| 348 | } | 0 |
| 349 | | - |
| 350 | void QBlitterPaintEnginePrivate::fillRect(const QRectF &rect, const QColor &color, bool alpha) | - |
| 351 | { | - |
| 352 | Q_Q(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEngine * const q = q_func(); | - |
| 353 | pmData->unmarkRasterOverlay(rect); never executed (the execution status of this line is deduced): pmData->unmarkRasterOverlay(rect); | - |
| 354 | QRectF targetRect = rect; never executed (the execution status of this line is deduced): QRectF targetRect = rect; | - |
| 355 | if (hasXForm) never evaluated: hasXForm | 0 |
| 356 | targetRect = q->state()->matrix.mapRect(rect); never executed: targetRect = q->state()->matrix.mapRect(rect); | 0 |
| 357 | const QClipData *clipData = clip(); never executed (the execution status of this line is deduced): const QClipData *clipData = clip(); | - |
| 358 | if (clipData) { never evaluated: clipData | 0 |
| 359 | if (clipData->hasRectClip) { never evaluated: clipData->hasRectClip | 0 |
| 360 | unlock(); never executed (the execution status of this line is deduced): unlock(); | - |
| 361 | if (alpha) | 0 |
| 362 | pmData->blittable()->alphaFillRect(targetRect & clipData->clipRect, color, q->state()->compositionMode()); never executed: pmData->blittable()->alphaFillRect(targetRect & clipData->clipRect, color, q->state()->compositionMode()); | 0 |
| 363 | else | - |
| 364 | pmData->blittable()->fillRect(targetRect & clipData->clipRect, color); never executed: pmData->blittable()->fillRect(targetRect & clipData->clipRect, color); | 0 |
| 365 | } else if (clipData->hasRegionClip) { never evaluated: clipData->hasRegionClip | 0 |
| 366 | QVector<QRect> rects = clipData->clipRegion.rects(); never executed (the execution status of this line is deduced): QVector<QRect> rects = clipData->clipRegion.rects(); | - |
| 367 | for (int i = 0; i < rects.size(); ++i) { never evaluated: i < rects.size() | 0 |
| 368 | QRect intersectRect = rects.at(i).intersected(targetRect.toRect()); never executed (the execution status of this line is deduced): QRect intersectRect = rects.at(i).intersected(targetRect.toRect()); | - |
| 369 | if (!intersectRect.isEmpty()) { never evaluated: !intersectRect.isEmpty() | 0 |
| 370 | unlock(); never executed (the execution status of this line is deduced): unlock(); | - |
| 371 | if (alpha) | 0 |
| 372 | pmData->blittable()->alphaFillRect(intersectRect, color, q->state()->compositionMode()); never executed: pmData->blittable()->alphaFillRect(intersectRect, color, q->state()->compositionMode()); | 0 |
| 373 | else | - |
| 374 | pmData->blittable()->fillRect(intersectRect, color); never executed: pmData->blittable()->fillRect(intersectRect, color); | 0 |
| 375 | } | - |
| 376 | } | 0 |
| 377 | } | 0 |
| 378 | } else { | - |
| 379 | if (targetRect.x() >= 0 && targetRect.y() >= 0 never evaluated: targetRect.x() >= 0 never evaluated: targetRect.y() >= 0 | 0 |
| 380 | && targetRect.width() <= q->paintDevice()->width() never evaluated: targetRect.width() <= q->paintDevice()->width() | 0 |
| 381 | && targetRect.height() <= q->paintDevice()->height()) { never evaluated: targetRect.height() <= q->paintDevice()->height() | 0 |
| 382 | unlock(); never executed (the execution status of this line is deduced): unlock(); | - |
| 383 | if (alpha) | 0 |
| 384 | pmData->blittable()->alphaFillRect(targetRect, color, q->state()->compositionMode()); never executed: pmData->blittable()->alphaFillRect(targetRect, color, q->state()->compositionMode()); | 0 |
| 385 | else | - |
| 386 | pmData->blittable()->fillRect(targetRect, color); never executed: pmData->blittable()->fillRect(targetRect, color); | 0 |
| 387 | } else { | - |
| 388 | QRectF deviceRect(0, 0, q->paintDevice()->width(), q->paintDevice()->height()); never executed (the execution status of this line is deduced): QRectF deviceRect(0, 0, q->paintDevice()->width(), q->paintDevice()->height()); | - |
| 389 | unlock(); never executed (the execution status of this line is deduced): unlock(); | - |
| 390 | if (alpha) | 0 |
| 391 | pmData->blittable()->alphaFillRect(deviceRect & targetRect, color, q->state()->compositionMode()); never executed: pmData->blittable()->alphaFillRect(deviceRect & targetRect, color, q->state()->compositionMode()); | 0 |
| 392 | else | - |
| 393 | pmData->blittable()->fillRect(deviceRect & targetRect, color); never executed: pmData->blittable()->fillRect(deviceRect & targetRect, color); | 0 |
| 394 | } | - |
| 395 | } | - |
| 396 | } | - |
| 397 | | - |
| 398 | void QBlitterPaintEnginePrivate::clipAndDrawPixmap(const QRectF &clip, | - |
| 399 | const QRectF &target, | - |
| 400 | const QPixmap &pm, | - |
| 401 | const QRectF &sr, | - |
| 402 | bool opacity) | - |
| 403 | { | - |
| 404 | Q_Q(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEngine * const q = q_func(); | - |
| 405 | QRectF intersectedRect = clip.intersected(target); never executed (the execution status of this line is deduced): QRectF intersectedRect = clip.intersected(target); | - |
| 406 | if (intersectedRect.isEmpty()) never evaluated: intersectedRect.isEmpty() | 0 |
| 407 | return; | 0 |
| 408 | QRectF source = sr; never executed (the execution status of this line is deduced): QRectF source = sr; | - |
| 409 | if (intersectedRect.size() != target.size()) { never evaluated: intersectedRect.size() != target.size() | 0 |
| 410 | if (sr.size() == target.size()) { never evaluated: sr.size() == target.size() | 0 |
| 411 | // no resize | - |
| 412 | qreal deltaTop = target.top() - intersectedRect.top(); never executed (the execution status of this line is deduced): qreal deltaTop = target.top() - intersectedRect.top(); | - |
| 413 | qreal deltaLeft = target.left() - intersectedRect.left(); never executed (the execution status of this line is deduced): qreal deltaLeft = target.left() - intersectedRect.left(); | - |
| 414 | qreal deltaBottom = target.bottom() - intersectedRect.bottom(); never executed (the execution status of this line is deduced): qreal deltaBottom = target.bottom() - intersectedRect.bottom(); | - |
| 415 | qreal deltaRight = target.right() - intersectedRect.right(); never executed (the execution status of this line is deduced): qreal deltaRight = target.right() - intersectedRect.right(); | - |
| 416 | source.adjust(-deltaLeft, -deltaTop, -deltaRight, -deltaBottom); never executed (the execution status of this line is deduced): source.adjust(-deltaLeft, -deltaTop, -deltaRight, -deltaBottom); | - |
| 417 | } else { | 0 |
| 418 | // resize case | - |
| 419 | qreal hFactor = sr.size().width() / target.size().width(); never executed (the execution status of this line is deduced): qreal hFactor = sr.size().width() / target.size().width(); | - |
| 420 | qreal vFactor = sr.size().height() / target.size().height(); never executed (the execution status of this line is deduced): qreal vFactor = sr.size().height() / target.size().height(); | - |
| 421 | qreal deltaTop = (target.top() - intersectedRect.top()) * vFactor; never executed (the execution status of this line is deduced): qreal deltaTop = (target.top() - intersectedRect.top()) * vFactor; | - |
| 422 | qreal deltaLeft = (target.left() - intersectedRect.left()) * hFactor; never executed (the execution status of this line is deduced): qreal deltaLeft = (target.left() - intersectedRect.left()) * hFactor; | - |
| 423 | qreal deltaBottom = (target.bottom() - intersectedRect.bottom()) * vFactor; never executed (the execution status of this line is deduced): qreal deltaBottom = (target.bottom() - intersectedRect.bottom()) * vFactor; | - |
| 424 | qreal deltaRight = (target.right() - intersectedRect.right()) * hFactor; never executed (the execution status of this line is deduced): qreal deltaRight = (target.right() - intersectedRect.right()) * hFactor; | - |
| 425 | source.adjust(-deltaLeft, -deltaTop, -deltaRight, -deltaBottom); never executed (the execution status of this line is deduced): source.adjust(-deltaLeft, -deltaTop, -deltaRight, -deltaBottom); | - |
| 426 | } | 0 |
| 427 | } | - |
| 428 | pmData->unmarkRasterOverlay(intersectedRect); never executed (the execution status of this line is deduced): pmData->unmarkRasterOverlay(intersectedRect); | - |
| 429 | if (opacity) | 0 |
| 430 | pmData->blittable()->drawPixmapOpacity(intersectedRect, pm, source, q->state()->compositionMode(), q->state()->opacity); never executed: pmData->blittable()->drawPixmapOpacity(intersectedRect, pm, source, q->state()->compositionMode(), q->state()->opacity); | 0 |
| 431 | else | - |
| 432 | pmData->blittable()->drawPixmap(intersectedRect, pm, source); never executed: pmData->blittable()->drawPixmap(intersectedRect, pm, source); | 0 |
| 433 | } | - |
| 434 | | - |
| 435 | QBlitterPaintEngine::QBlitterPaintEngine(QBlittablePlatformPixmap *p) | - |
| 436 | : QRasterPaintEngine(*(new QBlitterPaintEnginePrivate(p)), p->buffer()) | - |
| 437 | {} | 0 |
| 438 | | - |
| 439 | // State tracking | - |
| 440 | void QBlitterPaintEngine::penChanged() | - |
| 441 | { | - |
| 442 | Q_D(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEnginePrivate * const d = d_func(); | - |
| 443 | | - |
| 444 | QRasterPaintEngine::penChanged(); never executed (the execution status of this line is deduced): QRasterPaintEngine::penChanged(); | - |
| 445 | d->updatePenState(state()); never executed (the execution status of this line is deduced): d->updatePenState(state()); | - |
| 446 | } | 0 |
| 447 | | - |
| 448 | void QBlitterPaintEngine::brushChanged() | - |
| 449 | { | - |
| 450 | Q_D(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEnginePrivate * const d = d_func(); | - |
| 451 | | - |
| 452 | QRasterPaintEngine::brushChanged(); never executed (the execution status of this line is deduced): QRasterPaintEngine::brushChanged(); | - |
| 453 | d->updateBrushState(state()); never executed (the execution status of this line is deduced): d->updateBrushState(state()); | - |
| 454 | } | 0 |
| 455 | | - |
| 456 | void QBlitterPaintEngine::opacityChanged() | - |
| 457 | { | - |
| 458 | Q_D(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEnginePrivate * const d = d_func(); | - |
| 459 | | - |
| 460 | QRasterPaintEngine::opacityChanged(); never executed (the execution status of this line is deduced): QRasterPaintEngine::opacityChanged(); | - |
| 461 | d->updateOpacityState(state()); never executed (the execution status of this line is deduced): d->updateOpacityState(state()); | - |
| 462 | } | 0 |
| 463 | | - |
| 464 | void QBlitterPaintEngine::compositionModeChanged() | - |
| 465 | { | - |
| 466 | Q_D(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEnginePrivate * const d = d_func(); | - |
| 467 | | - |
| 468 | QRasterPaintEngine::compositionModeChanged(); never executed (the execution status of this line is deduced): QRasterPaintEngine::compositionModeChanged(); | - |
| 469 | d->updateCompositionModeState(state()); never executed (the execution status of this line is deduced): d->updateCompositionModeState(state()); | - |
| 470 | } | 0 |
| 471 | | - |
| 472 | void QBlitterPaintEngine::renderHintsChanged() | - |
| 473 | { | - |
| 474 | Q_D(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEnginePrivate * const d = d_func(); | - |
| 475 | | - |
| 476 | QRasterPaintEngine::renderHintsChanged(); never executed (the execution status of this line is deduced): QRasterPaintEngine::renderHintsChanged(); | - |
| 477 | d->updateRenderHintsState(state()); never executed (the execution status of this line is deduced): d->updateRenderHintsState(state()); | - |
| 478 | } | 0 |
| 479 | | - |
| 480 | void QBlitterPaintEngine::transformChanged() | - |
| 481 | { | - |
| 482 | Q_D(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEnginePrivate * const d = d_func(); | - |
| 483 | | - |
| 484 | QRasterPaintEngine::transformChanged(); never executed (the execution status of this line is deduced): QRasterPaintEngine::transformChanged(); | - |
| 485 | d->updateTransformState(state()); never executed (the execution status of this line is deduced): d->updateTransformState(state()); | - |
| 486 | } | 0 |
| 487 | | - |
| 488 | void QBlitterPaintEngine::clipEnabledChanged() | - |
| 489 | { | - |
| 490 | Q_D(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEnginePrivate * const d = d_func(); | - |
| 491 | QRasterPaintEngine::clipEnabledChanged(); never executed (the execution status of this line is deduced): QRasterPaintEngine::clipEnabledChanged(); | - |
| 492 | d->updateClipState(state()); never executed (the execution status of this line is deduced): d->updateClipState(state()); | - |
| 493 | } | 0 |
| 494 | | - |
| 495 | bool QBlitterPaintEngine::begin(QPaintDevice *pdev) | - |
| 496 | { | - |
| 497 | bool ok = QRasterPaintEngine::begin(pdev); never executed (the execution status of this line is deduced): bool ok = QRasterPaintEngine::begin(pdev); | - |
| 498 | #ifdef QT_BLITTER_RASTEROVERLAY | - |
| 499 | Q_D(QBlitterPaintEngine); | - |
| 500 | d->pmData->unmergeOverlay(); | - |
| 501 | #endif | - |
| 502 | return ok; never executed: return ok; | 0 |
| 503 | } | - |
| 504 | | - |
| 505 | bool QBlitterPaintEngine::end() | - |
| 506 | { | - |
| 507 | #ifdef QT_BLITTER_RASTEROVERLAY | - |
| 508 | Q_D(QBlitterPaintEngine); | - |
| 509 | d->pmData->mergeOverlay(); | - |
| 510 | #endif | - |
| 511 | | - |
| 512 | return QRasterPaintEngine::end(); never executed: return QRasterPaintEngine::end(); | 0 |
| 513 | } | - |
| 514 | | - |
| 515 | void QBlitterPaintEngine::setState(QPainterState *s) | - |
| 516 | { | - |
| 517 | Q_D(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEnginePrivate * const d = d_func(); | - |
| 518 | | - |
| 519 | QRasterPaintEngine::setState(s); never executed (the execution status of this line is deduced): QRasterPaintEngine::setState(s); | - |
| 520 | d->updateCompleteState(s); never executed (the execution status of this line is deduced): d->updateCompleteState(s); | - |
| 521 | } | 0 |
| 522 | | - |
| 523 | // Accelerated paths | - |
| 524 | void QBlitterPaintEngine::fill(const QVectorPath &path, const QBrush &brush) | - |
| 525 | { | - |
| 526 | Q_D(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEnginePrivate * const d = d_func(); | - |
| 527 | if (path.shape() == QVectorPath::RectangleHint) { never evaluated: path.shape() == QVectorPath::RectangleHint | 0 |
| 528 | QRectF rect(((QPointF *) path.points())[0], ((QPointF *) path.points())[2]); never executed (the execution status of this line is deduced): QRectF rect(((QPointF *) path.points())[0], ((QPointF *) path.points())[2]); | - |
| 529 | fillRect(rect, brush); never executed (the execution status of this line is deduced): fillRect(rect, brush); | - |
| 530 | } else { | 0 |
| 531 | d->lock(); never executed (the execution status of this line is deduced): d->lock(); | - |
| 532 | d->pmData->markRasterOverlay(path); never executed (the execution status of this line is deduced): d->pmData->markRasterOverlay(path); | - |
| 533 | QRasterPaintEngine::fill(path, brush); never executed (the execution status of this line is deduced): QRasterPaintEngine::fill(path, brush); | - |
| 534 | } | 0 |
| 535 | } | - |
| 536 | | - |
| 537 | void QBlitterPaintEngine::fillRect(const QRectF &rect, const QColor &color) | - |
| 538 | { | - |
| 539 | Q_D(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEnginePrivate * const d = d_func(); | - |
| 540 | if (d->caps.canBlitterAlphaFillRect()) { never evaluated: d->caps.canBlitterAlphaFillRect() | 0 |
| 541 | d->fillRect(rect, color, true); never executed (the execution status of this line is deduced): d->fillRect(rect, color, true); | - |
| 542 | } else if (d->caps.canBlitterFillRect() && color.alpha() == 0xff) { never executed: } never evaluated: d->caps.canBlitterFillRect() never evaluated: color.alpha() == 0xff | 0 |
| 543 | d->fillRect(rect, color, false); never executed (the execution status of this line is deduced): d->fillRect(rect, color, false); | - |
| 544 | } else { | 0 |
| 545 | d->lock(); never executed (the execution status of this line is deduced): d->lock(); | - |
| 546 | d->pmData->markRasterOverlay(rect); never executed (the execution status of this line is deduced): d->pmData->markRasterOverlay(rect); | - |
| 547 | QRasterPaintEngine::fillRect(rect, color); never executed (the execution status of this line is deduced): QRasterPaintEngine::fillRect(rect, color); | - |
| 548 | } | 0 |
| 549 | } | - |
| 550 | | - |
| 551 | void QBlitterPaintEngine::fillRect(const QRectF &rect, const QBrush &brush) | - |
| 552 | { | - |
| 553 | if (rect.size().isEmpty()) never evaluated: rect.size().isEmpty() | 0 |
| 554 | return; | 0 |
| 555 | | - |
| 556 | Q_D(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEnginePrivate * const d = d_func(); | - |
| 557 | | - |
| 558 | if (qbrush_style(brush) == Qt::SolidPattern never evaluated: qbrush_style(brush) == Qt::SolidPattern | 0 |
| 559 | && d->caps.canBlitterAlphaFillRect()) { never evaluated: d->caps.canBlitterAlphaFillRect() | 0 |
| 560 | d->fillRect(rect, qbrush_color(brush), true); never executed (the execution status of this line is deduced): d->fillRect(rect, qbrush_color(brush), true); | - |
| 561 | } else if (qbrush_style(brush) == Qt::SolidPattern never executed: } never evaluated: qbrush_style(brush) == Qt::SolidPattern | 0 |
| 562 | && qbrush_color(brush).alpha() == 0xff never evaluated: qbrush_color(brush).alpha() == 0xff | 0 |
| 563 | && d->caps.canBlitterFillRect()) { never evaluated: d->caps.canBlitterFillRect() | 0 |
| 564 | d->fillRect(rect, qbrush_color(brush), false); never executed (the execution status of this line is deduced): d->fillRect(rect, qbrush_color(brush), false); | - |
| 565 | } else if ((brush.style() == Qt::TexturePattern) && never executed: } never evaluated: (brush.style() == Qt::TexturePattern) | 0 |
| 566 | (brush.transform().type() <= QTransform::TxTranslate) && never evaluated: (brush.transform().type() <= QTransform::TxTranslate) | 0 |
| 567 | ((d->caps.canBlitterDrawPixmapOpacity(brush.texture())) || never evaluated: (d->caps.canBlitterDrawPixmapOpacity(brush.texture())) | 0 |
| 568 | (d->caps.canBlitterDrawPixmap(rect, brush.texture(), rect)))) { never evaluated: (d->caps.canBlitterDrawPixmap(rect, brush.texture(), rect)) | 0 |
| 569 | bool rectIsFilled = false; never executed (the execution status of this line is deduced): bool rectIsFilled = false; | - |
| 570 | QRectF transformedRect = state()->matrix.mapRect(rect); never executed (the execution status of this line is deduced): QRectF transformedRect = state()->matrix.mapRect(rect); | - |
| 571 | qreal x = transformedRect.x(); never executed (the execution status of this line is deduced): qreal x = transformedRect.x(); | - |
| 572 | qreal y = transformedRect.y(); never executed (the execution status of this line is deduced): qreal y = transformedRect.y(); | - |
| 573 | QPixmap pm = brush.texture(); never executed (the execution status of this line is deduced): QPixmap pm = brush.texture(); | - |
| 574 | d->unlock(); never executed (the execution status of this line is deduced): d->unlock(); | - |
| 575 | int srcX = int(rect.x() - state()->brushOrigin.x() - brush.transform().dx()) % pm.width(); never executed (the execution status of this line is deduced): int srcX = int(rect.x() - state()->brushOrigin.x() - brush.transform().dx()) % pm.width(); | - |
| 576 | if (srcX < 0) never evaluated: srcX < 0 | 0 |
| 577 | srcX = pm.width() + srcX; never executed: srcX = pm.width() + srcX; | 0 |
| 578 | const int startX = srcX; never executed (the execution status of this line is deduced): const int startX = srcX; | - |
| 579 | int srcY = int(rect.y() - state()->brushOrigin.y() - brush.transform().dy()) % pm.height(); never executed (the execution status of this line is deduced): int srcY = int(rect.y() - state()->brushOrigin.y() - brush.transform().dy()) % pm.height(); | - |
| 580 | if (srcY < 0) never evaluated: srcY < 0 | 0 |
| 581 | srcY = pm.height() + srcY; never executed: srcY = pm.height() + srcY; | 0 |
| 582 | while (!rectIsFilled) { never evaluated: !rectIsFilled | 0 |
| 583 | qreal blitWidth = (pm.width() ) - srcX; never executed (the execution status of this line is deduced): qreal blitWidth = (pm.width() ) - srcX; | - |
| 584 | qreal blitHeight = (pm.height() ) - srcY; never executed (the execution status of this line is deduced): qreal blitHeight = (pm.height() ) - srcY; | - |
| 585 | if (x + blitWidth > transformedRect.right()) never evaluated: x + blitWidth > transformedRect.right() | 0 |
| 586 | blitWidth = transformedRect.right() -x; never executed: blitWidth = transformedRect.right() -x; | 0 |
| 587 | if (y + blitHeight > transformedRect.bottom()) never evaluated: y + blitHeight > transformedRect.bottom() | 0 |
| 588 | blitHeight = transformedRect.bottom() - y; never executed: blitHeight = transformedRect.bottom() - y; | 0 |
| 589 | const QClipData *clipData = d->clip(); never executed (the execution status of this line is deduced): const QClipData *clipData = d->clip(); | - |
| 590 | if (clipData->hasRectClip) { never evaluated: clipData->hasRectClip | 0 |
| 591 | QRect targetRect = QRect(x, y, blitWidth, blitHeight).intersected(clipData->clipRect); never executed (the execution status of this line is deduced): QRect targetRect = QRect(x, y, blitWidth, blitHeight).intersected(clipData->clipRect); | - |
| 592 | if (targetRect.isValid()) { never evaluated: targetRect.isValid() | 0 |
| 593 | int tmpSrcX = srcX + (targetRect.x() - x); never executed (the execution status of this line is deduced): int tmpSrcX = srcX + (targetRect.x() - x); | - |
| 594 | int tmpSrcY = srcY + (targetRect.y() - y); never executed (the execution status of this line is deduced): int tmpSrcY = srcY + (targetRect.y() - y); | - |
| 595 | QRect srcRect(tmpSrcX, tmpSrcY, targetRect.width(), targetRect.height()); never executed (the execution status of this line is deduced): QRect srcRect(tmpSrcX, tmpSrcY, targetRect.width(), targetRect.height()); | - |
| 596 | d->pmData->blittable()->drawPixmap(targetRect, pm, srcRect); never executed (the execution status of this line is deduced): d->pmData->blittable()->drawPixmap(targetRect, pm, srcRect); | - |
| 597 | } | 0 |
| 598 | } else if (clipData->hasRegionClip) { never executed: } never evaluated: clipData->hasRegionClip | 0 |
| 599 | QVector<QRect> clipRects = clipData->clipRegion.rects(); never executed (the execution status of this line is deduced): QVector<QRect> clipRects = clipData->clipRegion.rects(); | - |
| 600 | QRect unclippedTargetRect(x, y, blitWidth, blitHeight); never executed (the execution status of this line is deduced): QRect unclippedTargetRect(x, y, blitWidth, blitHeight); | - |
| 601 | QRegion intersectedRects = clipData->clipRegion.intersected(unclippedTargetRect); never executed (the execution status of this line is deduced): QRegion intersectedRects = clipData->clipRegion.intersected(unclippedTargetRect); | - |
| 602 | | - |
| 603 | for (int i = 0; i < intersectedRects.rects().size(); ++i) { never evaluated: i < intersectedRects.rects().size() | 0 |
| 604 | QRect targetRect = intersectedRects.rects().at(i); never executed (the execution status of this line is deduced): QRect targetRect = intersectedRects.rects().at(i); | - |
| 605 | if (!targetRect.isValid() || targetRect.isEmpty()) never evaluated: !targetRect.isValid() never evaluated: targetRect.isEmpty() | 0 |
| 606 | continue; never executed: continue; | 0 |
| 607 | int tmpSrcX = srcX + (targetRect.x() - x); never executed (the execution status of this line is deduced): int tmpSrcX = srcX + (targetRect.x() - x); | - |
| 608 | int tmpSrcY = srcY + (targetRect.y() - y); never executed (the execution status of this line is deduced): int tmpSrcY = srcY + (targetRect.y() - y); | - |
| 609 | QRect srcRect(tmpSrcX, tmpSrcY, targetRect.width(), targetRect.height()); never executed (the execution status of this line is deduced): QRect srcRect(tmpSrcX, tmpSrcY, targetRect.width(), targetRect.height()); | - |
| 610 | d->pmData->blittable()->drawPixmap(targetRect, pm, srcRect); never executed (the execution status of this line is deduced): d->pmData->blittable()->drawPixmap(targetRect, pm, srcRect); | - |
| 611 | } | 0 |
| 612 | } | 0 |
| 613 | x+=blitWidth; never executed (the execution status of this line is deduced): x+=blitWidth; | - |
| 614 | if (qFuzzyCompare(x, transformedRect.right())) { never evaluated: qFuzzyCompare(x, transformedRect.right()) | 0 |
| 615 | x = transformedRect.x(); never executed (the execution status of this line is deduced): x = transformedRect.x(); | - |
| 616 | srcX = startX; never executed (the execution status of this line is deduced): srcX = startX; | - |
| 617 | srcY = 0; never executed (the execution status of this line is deduced): srcY = 0; | - |
| 618 | y += blitHeight; never executed (the execution status of this line is deduced): y += blitHeight; | - |
| 619 | if (qFuzzyCompare(y, transformedRect.bottom())) never evaluated: qFuzzyCompare(y, transformedRect.bottom()) | 0 |
| 620 | rectIsFilled = true; never executed: rectIsFilled = true; | 0 |
| 621 | } else | 0 |
| 622 | srcX = 0; never executed: srcX = 0; | 0 |
| 623 | } | - |
| 624 | } else { | 0 |
| 625 | d->lock(); never executed (the execution status of this line is deduced): d->lock(); | - |
| 626 | d->pmData->markRasterOverlay(rect); never executed (the execution status of this line is deduced): d->pmData->markRasterOverlay(rect); | - |
| 627 | QRasterPaintEngine::fillRect(rect, brush); never executed (the execution status of this line is deduced): QRasterPaintEngine::fillRect(rect, brush); | - |
| 628 | } | 0 |
| 629 | | - |
| 630 | } | - |
| 631 | | - |
| 632 | void QBlitterPaintEngine::drawRects(const QRect *rects, int rectCount) | - |
| 633 | { | - |
| 634 | Q_D(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEnginePrivate * const d = d_func(); | - |
| 635 | if (d->caps.canBlitterDrawRectMask()) { never evaluated: d->caps.canBlitterDrawRectMask() | 0 |
| 636 | for (int i=0; i<rectCount; ++i) never evaluated: i<rectCount | 0 |
| 637 | d->fillRect(rects[i], qbrush_color(state()->brush), false); never executed: d->fillRect(rects[i], qbrush_color(state()->brush), false); | 0 |
| 638 | } else { | 0 |
| 639 | d->pmData->markRasterOverlay(rects, rectCount); never executed (the execution status of this line is deduced): d->pmData->markRasterOverlay(rects, rectCount); | - |
| 640 | QRasterPaintEngine::drawRects(rects, rectCount); never executed (the execution status of this line is deduced): QRasterPaintEngine::drawRects(rects, rectCount); | - |
| 641 | } | 0 |
| 642 | } | - |
| 643 | | - |
| 644 | void QBlitterPaintEngine::drawRects(const QRectF *rects, int rectCount) | - |
| 645 | { | - |
| 646 | Q_D(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEnginePrivate * const d = d_func(); | - |
| 647 | if (d->caps.canBlitterDrawRectMask()) { never evaluated: d->caps.canBlitterDrawRectMask() | 0 |
| 648 | for (int i = 0; i < rectCount; ++i) never evaluated: i < rectCount | 0 |
| 649 | d->fillRect(rects[i], qbrush_color(state()->brush), false); never executed: d->fillRect(rects[i], qbrush_color(state()->brush), false); | 0 |
| 650 | } else { | 0 |
| 651 | d->pmData->markRasterOverlay(rects, rectCount); never executed (the execution status of this line is deduced): d->pmData->markRasterOverlay(rects, rectCount); | - |
| 652 | QRasterPaintEngine::drawRects(rects, rectCount); never executed (the execution status of this line is deduced): QRasterPaintEngine::drawRects(rects, rectCount); | - |
| 653 | } | 0 |
| 654 | } | - |
| 655 | | - |
| 656 | void QBlitterPaintEngine::drawPixmap(const QPointF &pos, const QPixmap &pm) | - |
| 657 | { | - |
| 658 | drawPixmap(QRectF(pos, pm.size()), pm, pm.rect()); never executed (the execution status of this line is deduced): drawPixmap(QRectF(pos, pm.size()), pm, pm.rect()); | - |
| 659 | } | 0 |
| 660 | | - |
| 661 | void QBlitterPaintEngine::drawPixmap(const QRectF &r, const QPixmap &pm, const QRectF &sr) | - |
| 662 | { | - |
| 663 | Q_D(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEnginePrivate * const d = d_func(); | - |
| 664 | bool canDrawOpacity; never executed (the execution status of this line is deduced): bool canDrawOpacity; | - |
| 665 | | - |
| 666 | canDrawOpacity = d->caps.canBlitterDrawPixmapOpacity(pm); never executed (the execution status of this line is deduced): canDrawOpacity = d->caps.canBlitterDrawPixmapOpacity(pm); | - |
| 667 | if (canDrawOpacity || (d->caps.canBlitterDrawPixmap(r, pm, sr))) { never evaluated: canDrawOpacity never evaluated: (d->caps.canBlitterDrawPixmap(r, pm, sr)) | 0 |
| 668 | | - |
| 669 | d->unlock(); never executed (the execution status of this line is deduced): d->unlock(); | - |
| 670 | QRectF targetRect = r; never executed (the execution status of this line is deduced): QRectF targetRect = r; | - |
| 671 | if (d->hasXForm) never evaluated: d->hasXForm | 0 |
| 672 | targetRect = state()->matrix.mapRect(r); never executed: targetRect = state()->matrix.mapRect(r); | 0 |
| 673 | const QClipData *clipData = d->clip(); never executed (the execution status of this line is deduced): const QClipData *clipData = d->clip(); | - |
| 674 | if (clipData) { never evaluated: clipData | 0 |
| 675 | if (clipData->hasRectClip) { never evaluated: clipData->hasRectClip | 0 |
| 676 | d->clipAndDrawPixmap(clipData->clipRect, targetRect, pm, sr, canDrawOpacity); never executed (the execution status of this line is deduced): d->clipAndDrawPixmap(clipData->clipRect, targetRect, pm, sr, canDrawOpacity); | - |
| 677 | } else if (clipData->hasRegionClip) { never executed: } never evaluated: clipData->hasRegionClip | 0 |
| 678 | QVector<QRect>rects = clipData->clipRegion.rects(); never executed (the execution status of this line is deduced): QVector<QRect>rects = clipData->clipRegion.rects(); | - |
| 679 | for (int i = 0; i<rects.size(); ++i) never evaluated: i<rects.size() | 0 |
| 680 | d->clipAndDrawPixmap(rects.at(i), targetRect, pm, sr, canDrawOpacity); never executed: d->clipAndDrawPixmap(rects.at(i), targetRect, pm, sr, canDrawOpacity); | 0 |
| 681 | } | 0 |
| 682 | } else { | - |
| 683 | QRectF deviceRect(0, 0, paintDevice()->width(), paintDevice()->height()); never executed (the execution status of this line is deduced): QRectF deviceRect(0, 0, paintDevice()->width(), paintDevice()->height()); | - |
| 684 | d->clipAndDrawPixmap(deviceRect, targetRect, pm, sr, canDrawOpacity); never executed (the execution status of this line is deduced): d->clipAndDrawPixmap(deviceRect, targetRect, pm, sr, canDrawOpacity); | - |
| 685 | } | 0 |
| 686 | }else { | - |
| 687 | d->lock(); never executed (the execution status of this line is deduced): d->lock(); | - |
| 688 | d->pmData->markRasterOverlay(r); never executed (the execution status of this line is deduced): d->pmData->markRasterOverlay(r); | - |
| 689 | QRasterPaintEngine::drawPixmap(r, pm, sr); never executed (the execution status of this line is deduced): QRasterPaintEngine::drawPixmap(r, pm, sr); | - |
| 690 | } | 0 |
| 691 | } | - |
| 692 | | - |
| 693 | // Overriden methods to lock the graphics memory | - |
| 694 | void QBlitterPaintEngine::drawPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) | - |
| 695 | { | - |
| 696 | Q_D(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEnginePrivate * const d = d_func(); | - |
| 697 | d->lock(); never executed (the execution status of this line is deduced): d->lock(); | - |
| 698 | d->pmData->markRasterOverlay(points, pointCount); never executed (the execution status of this line is deduced): d->pmData->markRasterOverlay(points, pointCount); | - |
| 699 | QRasterPaintEngine::drawPolygon(points, pointCount, mode); never executed (the execution status of this line is deduced): QRasterPaintEngine::drawPolygon(points, pointCount, mode); | - |
| 700 | } | 0 |
| 701 | | - |
| 702 | void QBlitterPaintEngine::drawPolygon(const QPoint *points, int pointCount, PolygonDrawMode mode) | - |
| 703 | { | - |
| 704 | Q_D(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEnginePrivate * const d = d_func(); | - |
| 705 | d->lock(); never executed (the execution status of this line is deduced): d->lock(); | - |
| 706 | d->pmData->markRasterOverlay(points, pointCount); never executed (the execution status of this line is deduced): d->pmData->markRasterOverlay(points, pointCount); | - |
| 707 | QRasterPaintEngine::drawPolygon(points, pointCount, mode); never executed (the execution status of this line is deduced): QRasterPaintEngine::drawPolygon(points, pointCount, mode); | - |
| 708 | } | 0 |
| 709 | | - |
| 710 | void QBlitterPaintEngine::fillPath(const QPainterPath &path, QSpanData *fillData) | - |
| 711 | { | - |
| 712 | Q_D(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEnginePrivate * const d = d_func(); | - |
| 713 | d->lock(); never executed (the execution status of this line is deduced): d->lock(); | - |
| 714 | d->pmData->markRasterOverlay(path); never executed (the execution status of this line is deduced): d->pmData->markRasterOverlay(path); | - |
| 715 | QRasterPaintEngine::fillPath(path, fillData); never executed (the execution status of this line is deduced): QRasterPaintEngine::fillPath(path, fillData); | - |
| 716 | } | 0 |
| 717 | | - |
| 718 | void QBlitterPaintEngine::fillPolygon(const QPointF *points, int pointCount, PolygonDrawMode mode) | - |
| 719 | { | - |
| 720 | Q_D(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEnginePrivate * const d = d_func(); | - |
| 721 | d->lock(); never executed (the execution status of this line is deduced): d->lock(); | - |
| 722 | d->pmData->markRasterOverlay(points, pointCount); never executed (the execution status of this line is deduced): d->pmData->markRasterOverlay(points, pointCount); | - |
| 723 | QRasterPaintEngine::fillPolygon(points, pointCount, mode); never executed (the execution status of this line is deduced): QRasterPaintEngine::fillPolygon(points, pointCount, mode); | - |
| 724 | } | 0 |
| 725 | | - |
| 726 | void QBlitterPaintEngine::drawEllipse(const QRectF &r) | - |
| 727 | { | - |
| 728 | Q_D(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEnginePrivate * const d = d_func(); | - |
| 729 | d->lock(); never executed (the execution status of this line is deduced): d->lock(); | - |
| 730 | d->pmData->markRasterOverlay(r); never executed (the execution status of this line is deduced): d->pmData->markRasterOverlay(r); | - |
| 731 | QRasterPaintEngine::drawEllipse(r); never executed (the execution status of this line is deduced): QRasterPaintEngine::drawEllipse(r); | - |
| 732 | } | 0 |
| 733 | | - |
| 734 | void QBlitterPaintEngine::drawImage(const QPointF &pos, const QImage &image) | - |
| 735 | { | - |
| 736 | drawImage(QRectF(pos, image.size()), image, image.rect()); never executed (the execution status of this line is deduced): drawImage(QRectF(pos, image.size()), image, image.rect()); | - |
| 737 | } | 0 |
| 738 | | - |
| 739 | void QBlitterPaintEngine::drawImage(const QRectF &r, const QImage &pm, const QRectF &sr, | - |
| 740 | Qt::ImageConversionFlags flags) | - |
| 741 | { | - |
| 742 | Q_D(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEnginePrivate * const d = d_func(); | - |
| 743 | d->lock(); never executed (the execution status of this line is deduced): d->lock(); | - |
| 744 | d->pmData->markRasterOverlay(r); never executed (the execution status of this line is deduced): d->pmData->markRasterOverlay(r); | - |
| 745 | QRasterPaintEngine::drawImage(r, pm, sr, flags); never executed (the execution status of this line is deduced): QRasterPaintEngine::drawImage(r, pm, sr, flags); | - |
| 746 | } | 0 |
| 747 | | - |
| 748 | void QBlitterPaintEngine::drawTiledPixmap(const QRectF &r, const QPixmap &pm, const QPointF &sr) | - |
| 749 | { | - |
| 750 | Q_D(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEnginePrivate * const d = d_func(); | - |
| 751 | d->lock(); never executed (the execution status of this line is deduced): d->lock(); | - |
| 752 | d->pmData->markRasterOverlay(r); never executed (the execution status of this line is deduced): d->pmData->markRasterOverlay(r); | - |
| 753 | QRasterPaintEngine::drawTiledPixmap(r, pm, sr); never executed (the execution status of this line is deduced): QRasterPaintEngine::drawTiledPixmap(r, pm, sr); | - |
| 754 | } | 0 |
| 755 | | - |
| 756 | void QBlitterPaintEngine::drawTextItem(const QPointF &pos, const QTextItem &ti) | - |
| 757 | { | - |
| 758 | Q_D(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEnginePrivate * const d = d_func(); | - |
| 759 | d->lock(); never executed (the execution status of this line is deduced): d->lock(); | - |
| 760 | d->pmData->markRasterOverlay(pos, ti); never executed (the execution status of this line is deduced): d->pmData->markRasterOverlay(pos, ti); | - |
| 761 | QRasterPaintEngine::drawTextItem(pos, ti); never executed (the execution status of this line is deduced): QRasterPaintEngine::drawTextItem(pos, ti); | - |
| 762 | } | 0 |
| 763 | | - |
| 764 | void QBlitterPaintEngine::drawPoints(const QPointF *points, int pointCount) | - |
| 765 | { | - |
| 766 | Q_D(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEnginePrivate * const d = d_func(); | - |
| 767 | d->lock(); never executed (the execution status of this line is deduced): d->lock(); | - |
| 768 | d->pmData->markRasterOverlay(points, pointCount); never executed (the execution status of this line is deduced): d->pmData->markRasterOverlay(points, pointCount); | - |
| 769 | QRasterPaintEngine::drawPoints(points, pointCount); never executed (the execution status of this line is deduced): QRasterPaintEngine::drawPoints(points, pointCount); | - |
| 770 | } | 0 |
| 771 | | - |
| 772 | void QBlitterPaintEngine::drawPoints(const QPoint *points, int pointCount) | - |
| 773 | { | - |
| 774 | Q_D(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEnginePrivate * const d = d_func(); | - |
| 775 | d->lock(); never executed (the execution status of this line is deduced): d->lock(); | - |
| 776 | d->pmData->markRasterOverlay(points, pointCount); never executed (the execution status of this line is deduced): d->pmData->markRasterOverlay(points, pointCount); | - |
| 777 | QRasterPaintEngine::drawPoints(points, pointCount); never executed (the execution status of this line is deduced): QRasterPaintEngine::drawPoints(points, pointCount); | - |
| 778 | } | 0 |
| 779 | | - |
| 780 | void QBlitterPaintEngine::stroke(const QVectorPath &path, const QPen &pen) | - |
| 781 | { | - |
| 782 | Q_D(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEnginePrivate * const d = d_func(); | - |
| 783 | d->lock(); never executed (the execution status of this line is deduced): d->lock(); | - |
| 784 | d->pmData->markRasterOverlay(path); never executed (the execution status of this line is deduced): d->pmData->markRasterOverlay(path); | - |
| 785 | QRasterPaintEngine::stroke(path, pen); never executed (the execution status of this line is deduced): QRasterPaintEngine::stroke(path, pen); | - |
| 786 | } | 0 |
| 787 | | - |
| 788 | void QBlitterPaintEngine::drawStaticTextItem(QStaticTextItem *sti) | - |
| 789 | { | - |
| 790 | Q_D(QBlitterPaintEngine); never executed (the execution status of this line is deduced): QBlitterPaintEnginePrivate * const d = d_func(); | - |
| 791 | d->lock(); never executed (the execution status of this line is deduced): d->lock(); | - |
| 792 | QRasterPaintEngine::drawStaticTextItem(sti); never executed (the execution status of this line is deduced): QRasterPaintEngine::drawStaticTextItem(sti); | - |
| 793 | | - |
| 794 | #ifdef QT_BLITTER_RASTEROVERLAY | - |
| 795 | //#### d->pmData->markRasterOverlay(sti); | - |
| 796 | qWarning("not implemented: markRasterOverlay for QStaticTextItem"); | - |
| 797 | #endif | - |
| 798 | } | 0 |
| 799 | | - |
| 800 | QT_END_NAMESPACE | - |
| 801 | #endif //QT_NO_BLITTABLE | - |
| 802 | | - |
| 803 | | - |
| | |