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