| Absolute File Name: | /home/qt/qt5_coco/qt5/qtbase/src/gui/painting/qbrush.cpp |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||||||||
| 2 | - | |||||||||||||||||||
| 3 | - | |||||||||||||||||||
| 4 | const uchar *qt_patternForBrush(int brushStyle, bool invert) | - | ||||||||||||||||||
| 5 | { | - | ||||||||||||||||||
| 6 | ((!(brushStyle > Qt::SolidPattern && brushStyle < Qt::LinearGradientPattern)) ? qt_assert("brushStyle > Qt::SolidPattern && brushStyle < Qt::LinearGradientPattern",__FILE__,57) : qt_noop()); | - | ||||||||||||||||||
| 7 | static const uchar pat_tbl[][2][8] = { | - | ||||||||||||||||||
| 8 | { | - | ||||||||||||||||||
| 9 | { 0x00, 0x44, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00 }, | - | ||||||||||||||||||
| 10 | { 0xff, 0xbb, 0xff, 0xff, 0xff, 0xbb, 0xff, 0xff }, | - | ||||||||||||||||||
| 11 | }, { | - | ||||||||||||||||||
| 12 | { 0x88, 0x00, 0x22, 0x00, 0x88, 0x00, 0x22, 0x00 }, | - | ||||||||||||||||||
| 13 | { 0x77, 0xff, 0xdd, 0xff, 0x77, 0xff, 0xdd, 0xff }, | - | ||||||||||||||||||
| 14 | }, { | - | ||||||||||||||||||
| 15 | { 0xaa, 0x44, 0xaa, 0x11, 0xaa, 0x44, 0xaa, 0x11 }, | - | ||||||||||||||||||
| 16 | { 0x55, 0xbb, 0x55, 0xee, 0x55, 0xbb, 0x55, 0xee }, | - | ||||||||||||||||||
| 17 | }, { | - | ||||||||||||||||||
| 18 | { 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa }, | - | ||||||||||||||||||
| 19 | { 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55, 0xaa, 0x55 }, | - | ||||||||||||||||||
| 20 | }, { | - | ||||||||||||||||||
| 21 | { 0x55, 0xbb, 0x55, 0xee, 0x55, 0xbb, 0x55, 0xee }, | - | ||||||||||||||||||
| 22 | { 0xaa, 0x44, 0xaa, 0x11, 0xaa, 0x44, 0xaa, 0x11 }, | - | ||||||||||||||||||
| 23 | }, { | - | ||||||||||||||||||
| 24 | { 0x77, 0xff, 0xdd, 0xff, 0x77, 0xff, 0xdd, 0xff }, | - | ||||||||||||||||||
| 25 | { 0x88, 0x00, 0x22, 0x00, 0x88, 0x00, 0x22, 0x00 }, | - | ||||||||||||||||||
| 26 | }, { | - | ||||||||||||||||||
| 27 | { 0xff, 0xbb, 0xff, 0xff, 0xff, 0xbb, 0xff, 0xff }, | - | ||||||||||||||||||
| 28 | { 0x00, 0x44, 0x00, 0x00, 0x00, 0x44, 0x00, 0x00 }, | - | ||||||||||||||||||
| 29 | }, { | - | ||||||||||||||||||
| 30 | { 0xff, 0xff, 0xff, 0x00, 0xff, 0xff, 0xff, 0xff }, | - | ||||||||||||||||||
| 31 | { 0x00, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x00 }, | - | ||||||||||||||||||
| 32 | }, { | - | ||||||||||||||||||
| 33 | { 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef, 0xef }, | - | ||||||||||||||||||
| 34 | { 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10, 0x10 }, | - | ||||||||||||||||||
| 35 | }, { | - | ||||||||||||||||||
| 36 | { 0xef, 0xef, 0xef, 0x00, 0xef, 0xef, 0xef, 0xef }, | - | ||||||||||||||||||
| 37 | { 0x10, 0x10, 0x10, 0xff, 0x10, 0x10, 0x10, 0x10 }, | - | ||||||||||||||||||
| 38 | }, { | - | ||||||||||||||||||
| 39 | { 0x7f, 0xbf, 0xdf, 0xef, 0xf7, 0xfb, 0xfd, 0xfe }, | - | ||||||||||||||||||
| 40 | { 0x80, 0x40, 0x20, 0x10, 0x08, 0x04, 0x02, 0x01 }, | - | ||||||||||||||||||
| 41 | }, { | - | ||||||||||||||||||
| 42 | { 0xfe, 0xfd, 0xfb, 0xf7, 0xef, 0xdf, 0xbf, 0x7f }, | - | ||||||||||||||||||
| 43 | { 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80 }, | - | ||||||||||||||||||
| 44 | }, { | - | ||||||||||||||||||
| 45 | { 0x7e, 0xbd, 0xdb, 0xe7, 0xe7, 0xdb, 0xbd, 0x7e }, | - | ||||||||||||||||||
| 46 | { 0x81, 0x42, 0x24, 0x18, 0x18, 0x24, 0x42, 0x81 }, | - | ||||||||||||||||||
| 47 | }, | - | ||||||||||||||||||
| 48 | }; | - | ||||||||||||||||||
| 49 | return never executed: pat_tbl[brushStyle - Qt::Dense1Pattern][invert];return pat_tbl[brushStyle - Qt::Dense1Pattern][invert];never executed: return pat_tbl[brushStyle - Qt::Dense1Pattern][invert]; | 0 | ||||||||||||||||||
| 50 | } | - | ||||||||||||||||||
| 51 | - | |||||||||||||||||||
| 52 | QPixmap qt_pixmapForBrush(int brushStyle, bool invert) | - | ||||||||||||||||||
| 53 | { | - | ||||||||||||||||||
| 54 | - | |||||||||||||||||||
| 55 | QPixmap pm; | - | ||||||||||||||||||
| 56 | QString key = QLatin1String("$qt-brush$") | - | ||||||||||||||||||
| 57 | % HexString<uint>(brushStyle) | - | ||||||||||||||||||
| 58 | % QLatin1Char(invert ? '1' : '0'); | - | ||||||||||||||||||
| 59 | if (!QPixmapCache::find(key, pm)
| 0 | ||||||||||||||||||
| 60 | pm = QBitmap::fromData(QSize(8, 8), qt_patternForBrush(brushStyle, invert), | - | ||||||||||||||||||
| 61 | QImage::Format_MonoLSB); | - | ||||||||||||||||||
| 62 | QPixmapCache::insert(key, pm); | - | ||||||||||||||||||
| 63 | } never executed: end of block | 0 | ||||||||||||||||||
| 64 | - | |||||||||||||||||||
| 65 | return never executed: pm;return pm;never executed: return pm; | 0 | ||||||||||||||||||
| 66 | } | - | ||||||||||||||||||
| 67 | - | |||||||||||||||||||
| 68 | static void qt_cleanup_brush_pattern_image_cache(); | - | ||||||||||||||||||
| 69 | class QBrushPatternImageCache | - | ||||||||||||||||||
| 70 | { | - | ||||||||||||||||||
| 71 | public: | - | ||||||||||||||||||
| 72 | QBrushPatternImageCache() | - | ||||||||||||||||||
| 73 | : m_initialized(false) | - | ||||||||||||||||||
| 74 | { | - | ||||||||||||||||||
| 75 | init(); | - | ||||||||||||||||||
| 76 | } never executed: end of block | 0 | ||||||||||||||||||
| 77 | - | |||||||||||||||||||
| 78 | void init() | - | ||||||||||||||||||
| 79 | { | - | ||||||||||||||||||
| 80 | qAddPostRoutine(qt_cleanup_brush_pattern_image_cache); | - | ||||||||||||||||||
| 81 | for (int style = Qt::Dense1Pattern; style <= Qt::DiagCrossPattern
| 0 | ||||||||||||||||||
| 82 | int i = style - Qt::Dense1Pattern; | - | ||||||||||||||||||
| 83 | m_images[i][0] = QImage(qt_patternForBrush(style, 0), 8, 8, 1, QImage::Format_MonoLSB); | - | ||||||||||||||||||
| 84 | m_images[i][1] = QImage(qt_patternForBrush(style, 1), 8, 8, 1, QImage::Format_MonoLSB); | - | ||||||||||||||||||
| 85 | } never executed: end of block | 0 | ||||||||||||||||||
| 86 | m_initialized = true; | - | ||||||||||||||||||
| 87 | } never executed: end of block | 0 | ||||||||||||||||||
| 88 | - | |||||||||||||||||||
| 89 | QImage getImage(int brushStyle, bool invert) const | - | ||||||||||||||||||
| 90 | { | - | ||||||||||||||||||
| 91 | ((!(brushStyle >= Qt::Dense1Pattern && brushStyle <= Qt::DiagCrossPattern)) ? qt_assert("brushStyle >= Qt::Dense1Pattern && brushStyle <= Qt::DiagCrossPattern",__FILE__,142) : qt_noop()); | - | ||||||||||||||||||
| 92 | if (!m_initialized
| 0 | ||||||||||||||||||
| 93 | const_cast< never executed: QBrushPatternImageCache*>(this)->init();const_cast<QBrushPatternImageCache*>(this)->init();never executed: const_cast<QBrushPatternImageCache*>(this)->init(); | 0 | ||||||||||||||||||
| 94 | return never executed: m_images[brushStyle - Qt::Dense1Pattern][invert];return m_images[brushStyle - Qt::Dense1Pattern][invert];never executed: return m_images[brushStyle - Qt::Dense1Pattern][invert]; | 0 | ||||||||||||||||||
| 95 | } | - | ||||||||||||||||||
| 96 | - | |||||||||||||||||||
| 97 | void cleanup() { | - | ||||||||||||||||||
| 98 | for (int style = Qt::Dense1Pattern; style <= Qt::DiagCrossPattern
| 0 | ||||||||||||||||||
| 99 | int i = style - Qt::Dense1Pattern; | - | ||||||||||||||||||
| 100 | m_images[i][0] = QImage(); | - | ||||||||||||||||||
| 101 | m_images[i][1] = QImage(); | - | ||||||||||||||||||
| 102 | } never executed: end of block | 0 | ||||||||||||||||||
| 103 | m_initialized = false; | - | ||||||||||||||||||
| 104 | } never executed: end of block | 0 | ||||||||||||||||||
| 105 | - | |||||||||||||||||||
| 106 | private: | - | ||||||||||||||||||
| 107 | QImage m_images[Qt::DiagCrossPattern - Qt::Dense1Pattern + 1][2]; | - | ||||||||||||||||||
| 108 | bool m_initialized; | - | ||||||||||||||||||
| 109 | }; | - | ||||||||||||||||||
| 110 | - | |||||||||||||||||||
| 111 | namespace { namespace Q_QGS_qt_brushPatternImageCache { typedef QBrushPatternImageCache Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
never executed: }guard.store(QtGlobalStatic::Destroyed);never executed: }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; returnend of blocknever executed: &holder.value;return &holder.value;never executed: } } } static QGlobalStatic<QBrushPatternImageCache, Q_QGS_qt_brushPatternImageCache::innerFunction, Q_QGS_qt_brushPatternImageCache::guard> qt_brushPatternImageCache;return &holder.value; | 0 | ||||||||||||||||||
| 112 | - | |||||||||||||||||||
| 113 | static void qt_cleanup_brush_pattern_image_cache() | - | ||||||||||||||||||
| 114 | { | - | ||||||||||||||||||
| 115 | qt_brushPatternImageCache()->cleanup(); | - | ||||||||||||||||||
| 116 | } never executed: end of block | 0 | ||||||||||||||||||
| 117 | - | |||||||||||||||||||
| 118 | __attribute__((visibility("default"))) QImage qt_imageForBrush(int brushStyle, bool invert) | - | ||||||||||||||||||
| 119 | { | - | ||||||||||||||||||
| 120 | return never executed: qt_brushPatternImageCache()->getImage(brushStyle, invert);return qt_brushPatternImageCache()->getImage(brushStyle, invert);never executed: return qt_brushPatternImageCache()->getImage(brushStyle, invert); | 0 | ||||||||||||||||||
| 121 | } | - | ||||||||||||||||||
| 122 | - | |||||||||||||||||||
| 123 | struct QTexturedBrushData : public QBrushData | - | ||||||||||||||||||
| 124 | { | - | ||||||||||||||||||
| 125 | QTexturedBrushData() { | - | ||||||||||||||||||
| 126 | m_has_pixmap_texture = false; | - | ||||||||||||||||||
| 127 | m_pixmap = 0; | - | ||||||||||||||||||
| 128 | } never executed: end of block | 0 | ||||||||||||||||||
| 129 | ~QTexturedBrushData() { | - | ||||||||||||||||||
| 130 | delete m_pixmap; | - | ||||||||||||||||||
| 131 | } never executed: end of block | 0 | ||||||||||||||||||
| 132 | - | |||||||||||||||||||
| 133 | void setPixmap(const QPixmap &pm) { | - | ||||||||||||||||||
| 134 | delete m_pixmap; | - | ||||||||||||||||||
| 135 | - | |||||||||||||||||||
| 136 | if (pm.isNull()
| 0 | ||||||||||||||||||
| 137 | m_pixmap = 0; | - | ||||||||||||||||||
| 138 | m_has_pixmap_texture = false; | - | ||||||||||||||||||
| 139 | } never executed: else {end of block | 0 | ||||||||||||||||||
| 140 | m_pixmap = new QPixmap(pm); | - | ||||||||||||||||||
| 141 | m_has_pixmap_texture = true; | - | ||||||||||||||||||
| 142 | } never executed: end of block | 0 | ||||||||||||||||||
| 143 | - | |||||||||||||||||||
| 144 | m_image = QImage(); | - | ||||||||||||||||||
| 145 | } never executed: end of block | 0 | ||||||||||||||||||
| 146 | - | |||||||||||||||||||
| 147 | void setImage(const QImage &image) { | - | ||||||||||||||||||
| 148 | m_image = image; | - | ||||||||||||||||||
| 149 | delete m_pixmap; | - | ||||||||||||||||||
| 150 | m_pixmap = 0; | - | ||||||||||||||||||
| 151 | m_has_pixmap_texture = false; | - | ||||||||||||||||||
| 152 | } never executed: end of block | 0 | ||||||||||||||||||
| 153 | - | |||||||||||||||||||
| 154 | QPixmap &pixmap() { | - | ||||||||||||||||||
| 155 | if (!m_pixmap
| 0 | ||||||||||||||||||
| 156 | m_pixmap = new QPixmap(QPixmap::fromImage(m_image)); | - | ||||||||||||||||||
| 157 | } never executed: end of block | 0 | ||||||||||||||||||
| 158 | return never executed: *m_pixmap;return *m_pixmap;never executed: return *m_pixmap; | 0 | ||||||||||||||||||
| 159 | } | - | ||||||||||||||||||
| 160 | - | |||||||||||||||||||
| 161 | QImage &image() { | - | ||||||||||||||||||
| 162 | if (m_image.isNull()
| 0 | ||||||||||||||||||
| 163 | m_image = m_pixmap->toImage(); never executed: m_image = m_pixmap->toImage(); | 0 | ||||||||||||||||||
| 164 | return never executed: m_image;return m_image;never executed: return m_image; | 0 | ||||||||||||||||||
| 165 | } | - | ||||||||||||||||||
| 166 | - | |||||||||||||||||||
| 167 | QPixmap *m_pixmap; | - | ||||||||||||||||||
| 168 | QImage m_image; | - | ||||||||||||||||||
| 169 | bool m_has_pixmap_texture; | - | ||||||||||||||||||
| 170 | }; | - | ||||||||||||||||||
| 171 | - | |||||||||||||||||||
| 172 | - | |||||||||||||||||||
| 173 | - | |||||||||||||||||||
| 174 | bool __attribute__((visibility("default"))) qHasPixmapTexture(const QBrush& brush) | - | ||||||||||||||||||
| 175 | { | - | ||||||||||||||||||
| 176 | if (brush.style() != Qt::TexturePattern
| 0 | ||||||||||||||||||
| 177 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 178 | QTexturedBrushData *tx_data = static_cast<QTexturedBrushData *>(brush.d.data()); | - | ||||||||||||||||||
| 179 | return never executed: tx_data->m_has_pixmap_texture;return tx_data->m_has_pixmap_texture;never executed: return tx_data->m_has_pixmap_texture; | 0 | ||||||||||||||||||
| 180 | } | - | ||||||||||||||||||
| 181 | - | |||||||||||||||||||
| 182 | struct QGradientBrushData : public QBrushData | - | ||||||||||||||||||
| 183 | { | - | ||||||||||||||||||
| 184 | QGradient gradient; | - | ||||||||||||||||||
| 185 | }; | - | ||||||||||||||||||
| 186 | - | |||||||||||||||||||
| 187 | struct QBrushDataPointerDeleter | - | ||||||||||||||||||
| 188 | { | - | ||||||||||||||||||
| 189 | static inline void deleteData(QBrushData *d) | - | ||||||||||||||||||
| 190 | { | - | ||||||||||||||||||
| 191 | switch (d->style) { | - | ||||||||||||||||||
| 192 | case never executed: Qt::TexturePattern:case Qt::TexturePattern:never executed: case Qt::TexturePattern: | 0 | ||||||||||||||||||
| 193 | delete static_cast<QTexturedBrushData*>(d); | - | ||||||||||||||||||
| 194 | break; never executed: break; | 0 | ||||||||||||||||||
| 195 | case never executed: Qt::LinearGradientPattern:case Qt::LinearGradientPattern:never executed: case Qt::LinearGradientPattern: | 0 | ||||||||||||||||||
| 196 | case never executed: Qt::RadialGradientPattern:case Qt::RadialGradientPattern:never executed: case Qt::RadialGradientPattern: | 0 | ||||||||||||||||||
| 197 | case never executed: Qt::ConicalGradientPattern:case Qt::ConicalGradientPattern:never executed: case Qt::ConicalGradientPattern: | 0 | ||||||||||||||||||
| 198 | delete static_cast<QGradientBrushData*>(d); | - | ||||||||||||||||||
| 199 | break; never executed: break; | 0 | ||||||||||||||||||
| 200 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||
| 201 | delete d; | - | ||||||||||||||||||
| 202 | } never executed: end of block | 0 | ||||||||||||||||||
| 203 | } | - | ||||||||||||||||||
| 204 | - | |||||||||||||||||||
| 205 | static inline void cleanup(QBrushData *d) | - | ||||||||||||||||||
| 206 | { | - | ||||||||||||||||||
| 207 | if (d
| 0 | ||||||||||||||||||
| 208 | deleteData(d); | - | ||||||||||||||||||
| 209 | } never executed: end of block | 0 | ||||||||||||||||||
| 210 | } never executed: end of block | 0 | ||||||||||||||||||
| 211 | }; | - | ||||||||||||||||||
| 212 | class QNullBrushData | - | ||||||||||||||||||
| 213 | { | - | ||||||||||||||||||
| 214 | public: | - | ||||||||||||||||||
| 215 | QBrushData *brush; | - | ||||||||||||||||||
| 216 | QNullBrushData() : brush(new QBrushData) | - | ||||||||||||||||||
| 217 | { | - | ||||||||||||||||||
| 218 | brush->ref.store(1); | - | ||||||||||||||||||
| 219 | brush->style = Qt::BrushStyle(0); | - | ||||||||||||||||||
| 220 | brush->color = Qt::black; | - | ||||||||||||||||||
| 221 | } never executed: end of block | 0 | ||||||||||||||||||
| 222 | ~QNullBrushData() | - | ||||||||||||||||||
| 223 | { | - | ||||||||||||||||||
| 224 | if (!brush->ref.deref()
| 0 | ||||||||||||||||||
| 225 | delete brush; never executed: delete brush; | 0 | ||||||||||||||||||
| 226 | brush = 0; | - | ||||||||||||||||||
| 227 | } never executed: end of block | 0 | ||||||||||||||||||
| 228 | }; | - | ||||||||||||||||||
| 229 | - | |||||||||||||||||||
| 230 | namespace { namespace Q_QGS_nullBrushInstance_holder { typedef QNullBrushData Type; QBasicAtomicInt guard = { QtGlobalStatic::Uninitialized }; __attribute__((visibility("hidden"))) inline Type *innerFunction() { struct HolderBase { ~HolderBase() noexcept { if (guard.load() == QtGlobalStatic::Initialized
never executed: }guard.store(QtGlobalStatic::Destroyed);never executed: }; static struct Holder : public HolderBase { Type value; Holder() noexcept(noexcept(Type ())) : value () { guard.store(QtGlobalStatic::Initialized); } } holder; returnend of blocknever executed: &holder.value;return &holder.value;never executed: } } } static QGlobalStatic<QNullBrushData, Q_QGS_nullBrushInstance_holder::innerFunction, Q_QGS_nullBrushInstance_holder::guard> nullBrushInstance_holder;return &holder.value; | 0 | ||||||||||||||||||
| 231 | static QBrushData *nullBrushInstance() | - | ||||||||||||||||||
| 232 | { | - | ||||||||||||||||||
| 233 | return never executed: nullBrushInstance_holder()->brush;return nullBrushInstance_holder()->brush;never executed: return nullBrushInstance_holder()->brush; | 0 | ||||||||||||||||||
| 234 | } | - | ||||||||||||||||||
| 235 | - | |||||||||||||||||||
| 236 | static bool qbrush_check_type(Qt::BrushStyle style) { | - | ||||||||||||||||||
| 237 | switch (style) { | - | ||||||||||||||||||
| 238 | case never executed: Qt::TexturePattern:case Qt::TexturePattern:never executed: case Qt::TexturePattern: | 0 | ||||||||||||||||||
| 239 | QMessageLogger(__FILE__, 372, __PRETTY_FUNCTION__).warning("QBrush: Incorrect use of TexturePattern"); | - | ||||||||||||||||||
| 240 | break; never executed: break; | 0 | ||||||||||||||||||
| 241 | case never executed: Qt::LinearGradientPattern:case Qt::LinearGradientPattern:never executed: case Qt::LinearGradientPattern: | 0 | ||||||||||||||||||
| 242 | case never executed: Qt::RadialGradientPattern:case Qt::RadialGradientPattern:never executed: case Qt::RadialGradientPattern: | 0 | ||||||||||||||||||
| 243 | case never executed: Qt::ConicalGradientPattern:case Qt::ConicalGradientPattern:never executed: case Qt::ConicalGradientPattern: | 0 | ||||||||||||||||||
| 244 | QMessageLogger(__FILE__, 377, __PRETTY_FUNCTION__).warning("QBrush: Wrong use of a gradient pattern"); | - | ||||||||||||||||||
| 245 | break; never executed: break; | 0 | ||||||||||||||||||
| 246 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||
| 247 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||
| 248 | } | - | ||||||||||||||||||
| 249 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 250 | } | - | ||||||||||||||||||
| 251 | - | |||||||||||||||||||
| 252 | - | |||||||||||||||||||
| 253 | - | |||||||||||||||||||
| 254 | - | |||||||||||||||||||
| 255 | - | |||||||||||||||||||
| 256 | - | |||||||||||||||||||
| 257 | void QBrush::init(const QColor &color, Qt::BrushStyle style) | - | ||||||||||||||||||
| 258 | { | - | ||||||||||||||||||
| 259 | switch(style) { | - | ||||||||||||||||||
| 260 | case never executed: Qt::NoBrush:case Qt::NoBrush:never executed: case Qt::NoBrush: | 0 | ||||||||||||||||||
| 261 | d.reset(nullBrushInstance()); | - | ||||||||||||||||||
| 262 | d->ref.ref(); | - | ||||||||||||||||||
| 263 | if (d->color != color
never executed: setColor(color); | 0 | ||||||||||||||||||
| 264 | return; never executed: return; | 0 | ||||||||||||||||||
| 265 | case never executed: Qt::TexturePattern:case Qt::TexturePattern:never executed: case Qt::TexturePattern: | 0 | ||||||||||||||||||
| 266 | d.reset(new QTexturedBrushData); | - | ||||||||||||||||||
| 267 | break; never executed: break; | 0 | ||||||||||||||||||
| 268 | case never executed: Qt::LinearGradientPattern:case Qt::LinearGradientPattern:never executed: case Qt::LinearGradientPattern: | 0 | ||||||||||||||||||
| 269 | case never executed: Qt::RadialGradientPattern:case Qt::RadialGradientPattern:never executed: case Qt::RadialGradientPattern: | 0 | ||||||||||||||||||
| 270 | case never executed: Qt::ConicalGradientPattern:case Qt::ConicalGradientPattern:never executed: case Qt::ConicalGradientPattern: | 0 | ||||||||||||||||||
| 271 | d.reset(new QGradientBrushData); | - | ||||||||||||||||||
| 272 | break; never executed: break; | 0 | ||||||||||||||||||
| 273 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||
| 274 | d.reset(new QBrushData); | - | ||||||||||||||||||
| 275 | break; never executed: break; | 0 | ||||||||||||||||||
| 276 | } | - | ||||||||||||||||||
| 277 | d->ref.store(1); | - | ||||||||||||||||||
| 278 | d->style = style; | - | ||||||||||||||||||
| 279 | d->color = color; | - | ||||||||||||||||||
| 280 | } never executed: end of block | 0 | ||||||||||||||||||
| 281 | - | |||||||||||||||||||
| 282 | - | |||||||||||||||||||
| 283 | - | |||||||||||||||||||
| 284 | - | |||||||||||||||||||
| 285 | - | |||||||||||||||||||
| 286 | - | |||||||||||||||||||
| 287 | QBrush::QBrush() | - | ||||||||||||||||||
| 288 | : d(nullBrushInstance()) | - | ||||||||||||||||||
| 289 | { | - | ||||||||||||||||||
| 290 | ((!(d)) ? qt_assert("d",__FILE__,423) : qt_noop()); | - | ||||||||||||||||||
| 291 | d->ref.ref(); | - | ||||||||||||||||||
| 292 | } never executed: end of block | 0 | ||||||||||||||||||
| 293 | QBrush::QBrush(const QPixmap &pixmap) | - | ||||||||||||||||||
| 294 | { | - | ||||||||||||||||||
| 295 | init(Qt::black, Qt::TexturePattern); | - | ||||||||||||||||||
| 296 | setTexture(pixmap); | - | ||||||||||||||||||
| 297 | } never executed: end of block | 0 | ||||||||||||||||||
| 298 | QBrush::QBrush(const QImage &image) | - | ||||||||||||||||||
| 299 | { | - | ||||||||||||||||||
| 300 | init(Qt::black, Qt::TexturePattern); | - | ||||||||||||||||||
| 301 | setTextureImage(image); | - | ||||||||||||||||||
| 302 | } never executed: end of block | 0 | ||||||||||||||||||
| 303 | - | |||||||||||||||||||
| 304 | - | |||||||||||||||||||
| 305 | - | |||||||||||||||||||
| 306 | - | |||||||||||||||||||
| 307 | - | |||||||||||||||||||
| 308 | - | |||||||||||||||||||
| 309 | - | |||||||||||||||||||
| 310 | QBrush::QBrush(Qt::BrushStyle style) | - | ||||||||||||||||||
| 311 | { | - | ||||||||||||||||||
| 312 | if (qbrush_check_type(style)
| 0 | ||||||||||||||||||
| 313 | init(Qt::black, style); never executed: init(Qt::black, style); | 0 | ||||||||||||||||||
| 314 | else { | - | ||||||||||||||||||
| 315 | d.reset(nullBrushInstance()); | - | ||||||||||||||||||
| 316 | d->ref.ref(); | - | ||||||||||||||||||
| 317 | } never executed: end of block | 0 | ||||||||||||||||||
| 318 | } | - | ||||||||||||||||||
| 319 | - | |||||||||||||||||||
| 320 | - | |||||||||||||||||||
| 321 | - | |||||||||||||||||||
| 322 | - | |||||||||||||||||||
| 323 | - | |||||||||||||||||||
| 324 | - | |||||||||||||||||||
| 325 | - | |||||||||||||||||||
| 326 | QBrush::QBrush(const QColor &color, Qt::BrushStyle style) | - | ||||||||||||||||||
| 327 | { | - | ||||||||||||||||||
| 328 | if (qbrush_check_type(style)
| 0 | ||||||||||||||||||
| 329 | init(color, style); never executed: init(color, style); | 0 | ||||||||||||||||||
| 330 | else { | - | ||||||||||||||||||
| 331 | d.reset(nullBrushInstance()); | - | ||||||||||||||||||
| 332 | d->ref.ref(); | - | ||||||||||||||||||
| 333 | } never executed: end of block | 0 | ||||||||||||||||||
| 334 | } | - | ||||||||||||||||||
| 335 | QBrush::QBrush(Qt::GlobalColor color, Qt::BrushStyle style) | - | ||||||||||||||||||
| 336 | { | - | ||||||||||||||||||
| 337 | if (qbrush_check_type(style)
| 0 | ||||||||||||||||||
| 338 | init(color, style); never executed: init(color, style); | 0 | ||||||||||||||||||
| 339 | else { | - | ||||||||||||||||||
| 340 | d.reset(nullBrushInstance()); | - | ||||||||||||||||||
| 341 | d->ref.ref(); | - | ||||||||||||||||||
| 342 | } never executed: end of block | 0 | ||||||||||||||||||
| 343 | } | - | ||||||||||||||||||
| 344 | QBrush::QBrush(const QColor &color, const QPixmap &pixmap) | - | ||||||||||||||||||
| 345 | { | - | ||||||||||||||||||
| 346 | init(color, Qt::TexturePattern); | - | ||||||||||||||||||
| 347 | setTexture(pixmap); | - | ||||||||||||||||||
| 348 | } never executed: end of block | 0 | ||||||||||||||||||
| 349 | QBrush::QBrush(Qt::GlobalColor color, const QPixmap &pixmap) | - | ||||||||||||||||||
| 350 | { | - | ||||||||||||||||||
| 351 | init(color, Qt::TexturePattern); | - | ||||||||||||||||||
| 352 | setTexture(pixmap); | - | ||||||||||||||||||
| 353 | } never executed: end of block | 0 | ||||||||||||||||||
| 354 | - | |||||||||||||||||||
| 355 | - | |||||||||||||||||||
| 356 | - | |||||||||||||||||||
| 357 | - | |||||||||||||||||||
| 358 | - | |||||||||||||||||||
| 359 | QBrush::QBrush(const QBrush &other) | - | ||||||||||||||||||
| 360 | : d(other.d.data()) | - | ||||||||||||||||||
| 361 | { | - | ||||||||||||||||||
| 362 | d->ref.ref(); | - | ||||||||||||||||||
| 363 | } never executed: end of block | 0 | ||||||||||||||||||
| 364 | QBrush::QBrush(const QGradient &gradient) | - | ||||||||||||||||||
| 365 | { | - | ||||||||||||||||||
| 366 | ((!(gradient.type() != QGradient::NoGradient)) ? qt_assert_x("QBrush::QBrush", "QGradient should not be used directly, use the linear, radial\n" "or conical gradients instead", | - | ||||||||||||||||||
| 367 | - | |||||||||||||||||||
| 368 | __FILE__ | - | ||||||||||||||||||
| 369 | , | - | ||||||||||||||||||
| 370 | - | |||||||||||||||||||
| 371 | 556 | - | ||||||||||||||||||
| 372 | ) : qt_noop()) | - | ||||||||||||||||||
| 373 | - | |||||||||||||||||||
| 374 | ; | - | ||||||||||||||||||
| 375 | - | |||||||||||||||||||
| 376 | const Qt::BrushStyle enum_table[] = { | - | ||||||||||||||||||
| 377 | Qt::LinearGradientPattern, | - | ||||||||||||||||||
| 378 | Qt::RadialGradientPattern, | - | ||||||||||||||||||
| 379 | Qt::ConicalGradientPattern | - | ||||||||||||||||||
| 380 | }; | - | ||||||||||||||||||
| 381 | - | |||||||||||||||||||
| 382 | init(QColor(), enum_table[gradient.type()]); | - | ||||||||||||||||||
| 383 | QGradientBrushData *grad = static_cast<QGradientBrushData *>(d.data()); | - | ||||||||||||||||||
| 384 | grad->gradient = gradient; | - | ||||||||||||||||||
| 385 | } never executed: end of block | 0 | ||||||||||||||||||
| 386 | - | |||||||||||||||||||
| 387 | - | |||||||||||||||||||
| 388 | - | |||||||||||||||||||
| 389 | - | |||||||||||||||||||
| 390 | - | |||||||||||||||||||
| 391 | QBrush::~QBrush() | - | ||||||||||||||||||
| 392 | { | - | ||||||||||||||||||
| 393 | } | - | ||||||||||||||||||
| 394 | - | |||||||||||||||||||
| 395 | void QBrush::cleanUp(QBrushData *x) | - | ||||||||||||||||||
| 396 | { | - | ||||||||||||||||||
| 397 | QBrushDataPointerDeleter::deleteData(x); | - | ||||||||||||||||||
| 398 | } never executed: end of block | 0 | ||||||||||||||||||
| 399 | - | |||||||||||||||||||
| 400 | - | |||||||||||||||||||
| 401 | void QBrush::detach(Qt::BrushStyle newStyle) | - | ||||||||||||||||||
| 402 | { | - | ||||||||||||||||||
| 403 | if (newStyle == d->style
| 0 | ||||||||||||||||||
| 404 | return; never executed: return; | 0 | ||||||||||||||||||
| 405 | - | |||||||||||||||||||
| 406 | QScopedPointer<QBrushData, QBrushDataPointerDeleter> x; | - | ||||||||||||||||||
| 407 | switch(newStyle) { | - | ||||||||||||||||||
| 408 | case never executed: Qt::TexturePattern:case Qt::TexturePattern:never executed: {case Qt::TexturePattern: | 0 | ||||||||||||||||||
| 409 | QTexturedBrushData *tbd = new QTexturedBrushData; | - | ||||||||||||||||||
| 410 | if (d->style == Qt::TexturePattern
| 0 | ||||||||||||||||||
| 411 | QTexturedBrushData *data = static_cast<QTexturedBrushData *>(d.data()); | - | ||||||||||||||||||
| 412 | if (data->m_has_pixmap_texture
| 0 | ||||||||||||||||||
| 413 | tbd->setPixmap(data->pixmap()); never executed: tbd->setPixmap(data->pixmap()); | 0 | ||||||||||||||||||
| 414 | else | - | ||||||||||||||||||
| 415 | tbd->setImage(data->image()); never executed: tbd->setImage(data->image()); | 0 | ||||||||||||||||||
| 416 | } | - | ||||||||||||||||||
| 417 | x.reset(tbd); | - | ||||||||||||||||||
| 418 | break; never executed: break; | 0 | ||||||||||||||||||
| 419 | } | - | ||||||||||||||||||
| 420 | case never executed: Qt::LinearGradientPattern:case Qt::LinearGradientPattern:never executed: case Qt::LinearGradientPattern: | 0 | ||||||||||||||||||
| 421 | case never executed: Qt::RadialGradientPattern:case Qt::RadialGradientPattern:never executed: case Qt::RadialGradientPattern: | 0 | ||||||||||||||||||
| 422 | case never executed: Qt::ConicalGradientPattern:case Qt::ConicalGradientPattern:never executed: {case Qt::ConicalGradientPattern: | 0 | ||||||||||||||||||
| 423 | QGradientBrushData *gbd = new QGradientBrushData; | - | ||||||||||||||||||
| 424 | switch (d->style) { | - | ||||||||||||||||||
| 425 | case never executed: Qt::LinearGradientPattern:case Qt::LinearGradientPattern:never executed: case Qt::LinearGradientPattern: | 0 | ||||||||||||||||||
| 426 | case never executed: Qt::RadialGradientPattern:case Qt::RadialGradientPattern:never executed: case Qt::RadialGradientPattern: | 0 | ||||||||||||||||||
| 427 | case never executed: Qt::ConicalGradientPattern:case Qt::ConicalGradientPattern:never executed: case Qt::ConicalGradientPattern: | 0 | ||||||||||||||||||
| 428 | gbd->gradient = | - | ||||||||||||||||||
| 429 | static_cast<QGradientBrushData *>(d.data())->gradient; | - | ||||||||||||||||||
| 430 | break; never executed: break; | 0 | ||||||||||||||||||
| 431 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||
| 432 | break; never executed: break; | 0 | ||||||||||||||||||
| 433 | } | - | ||||||||||||||||||
| 434 | x.reset(gbd); | - | ||||||||||||||||||
| 435 | break; never executed: break; | 0 | ||||||||||||||||||
| 436 | } | - | ||||||||||||||||||
| 437 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||
| 438 | x.reset(new QBrushData); | - | ||||||||||||||||||
| 439 | break; never executed: break; | 0 | ||||||||||||||||||
| 440 | } | - | ||||||||||||||||||
| 441 | x->ref.store(1); | - | ||||||||||||||||||
| 442 | x->style = newStyle; | - | ||||||||||||||||||
| 443 | x->color = d->color; | - | ||||||||||||||||||
| 444 | x->transform = d->transform; | - | ||||||||||||||||||
| 445 | d.swap(x); | - | ||||||||||||||||||
| 446 | } never executed: end of block | 0 | ||||||||||||||||||
| 447 | QBrush &QBrush::operator=(const QBrush &b) | - | ||||||||||||||||||
| 448 | { | - | ||||||||||||||||||
| 449 | if (d == b.d
| 0 | ||||||||||||||||||
| 450 | return never executed: *this;return *this;never executed: return *this; | 0 | ||||||||||||||||||
| 451 | - | |||||||||||||||||||
| 452 | b.d->ref.ref(); | - | ||||||||||||||||||
| 453 | d.reset(b.d.data()); | - | ||||||||||||||||||
| 454 | return never executed: *this;return *this;never executed: return *this; | 0 | ||||||||||||||||||
| 455 | } | - | ||||||||||||||||||
| 456 | QBrush::operator QVariant() const | - | ||||||||||||||||||
| 457 | { | - | ||||||||||||||||||
| 458 | return never executed: QVariant(QVariant::Brush, this);return QVariant(QVariant::Brush, this);never executed: return QVariant(QVariant::Brush, this); | 0 | ||||||||||||||||||
| 459 | } | - | ||||||||||||||||||
| 460 | void QBrush::setStyle(Qt::BrushStyle style) | - | ||||||||||||||||||
| 461 | { | - | ||||||||||||||||||
| 462 | if (d->style == style
| 0 | ||||||||||||||||||
| 463 | return; never executed: return; | 0 | ||||||||||||||||||
| 464 | - | |||||||||||||||||||
| 465 | if (qbrush_check_type(style)
| 0 | ||||||||||||||||||
| 466 | detach(style); | - | ||||||||||||||||||
| 467 | d->style = style; | - | ||||||||||||||||||
| 468 | } never executed: end of block | 0 | ||||||||||||||||||
| 469 | } never executed: end of block | 0 | ||||||||||||||||||
| 470 | void QBrush::setColor(const QColor &c) | - | ||||||||||||||||||
| 471 | { | - | ||||||||||||||||||
| 472 | if (d->color == c
| 0 | ||||||||||||||||||
| 473 | return; never executed: return; | 0 | ||||||||||||||||||
| 474 | - | |||||||||||||||||||
| 475 | detach(d->style); | - | ||||||||||||||||||
| 476 | d->color = c; | - | ||||||||||||||||||
| 477 | } never executed: end of block | 0 | ||||||||||||||||||
| 478 | QPixmap QBrush::texture() const | - | ||||||||||||||||||
| 479 | { | - | ||||||||||||||||||
| 480 | return never executed: d->style == Qt::TexturePatternreturn d->style == Qt::TexturePattern ? (static_cast<QTexturedBrushData *>(d.data()))->pixmap() : QPixmap();never executed: return d->style == Qt::TexturePattern ? (static_cast<QTexturedBrushData *>(d.data()))->pixmap() : QPixmap(); | 0 | ||||||||||||||||||
| 481 | ? (static_cast<QTexturedBrushData *>(d.data()))->pixmap() never executed: return d->style == Qt::TexturePattern ? (static_cast<QTexturedBrushData *>(d.data()))->pixmap() : QPixmap(); | 0 | ||||||||||||||||||
| 482 | : QPixmap(); never executed: return d->style == Qt::TexturePattern ? (static_cast<QTexturedBrushData *>(d.data()))->pixmap() : QPixmap(); | 0 | ||||||||||||||||||
| 483 | } | - | ||||||||||||||||||
| 484 | void QBrush::setTexture(const QPixmap &pixmap) | - | ||||||||||||||||||
| 485 | { | - | ||||||||||||||||||
| 486 | if (!pixmap.isNull()
| 0 | ||||||||||||||||||
| 487 | detach(Qt::TexturePattern); | - | ||||||||||||||||||
| 488 | QTexturedBrushData *data = static_cast<QTexturedBrushData *>(d.data()); | - | ||||||||||||||||||
| 489 | data->setPixmap(pixmap); | - | ||||||||||||||||||
| 490 | } never executed: else {end of block | 0 | ||||||||||||||||||
| 491 | detach(Qt::NoBrush); | - | ||||||||||||||||||
| 492 | } never executed: end of block | 0 | ||||||||||||||||||
| 493 | } | - | ||||||||||||||||||
| 494 | QImage QBrush::textureImage() const | - | ||||||||||||||||||
| 495 | { | - | ||||||||||||||||||
| 496 | return never executed: d->style == Qt::TexturePatternreturn d->style == Qt::TexturePattern ? (static_cast<QTexturedBrushData *>(d.data()))->image() : QImage();never executed: return d->style == Qt::TexturePattern ? (static_cast<QTexturedBrushData *>(d.data()))->image() : QImage(); | 0 | ||||||||||||||||||
| 497 | ? (static_cast<QTexturedBrushData *>(d.data()))->image() never executed: return d->style == Qt::TexturePattern ? (static_cast<QTexturedBrushData *>(d.data()))->image() : QImage(); | 0 | ||||||||||||||||||
| 498 | : QImage(); never executed: return d->style == Qt::TexturePattern ? (static_cast<QTexturedBrushData *>(d.data()))->image() : QImage(); | 0 | ||||||||||||||||||
| 499 | } | - | ||||||||||||||||||
| 500 | void QBrush::setTextureImage(const QImage &image) | - | ||||||||||||||||||
| 501 | { | - | ||||||||||||||||||
| 502 | if (!image.isNull()
| 0 | ||||||||||||||||||
| 503 | detach(Qt::TexturePattern); | - | ||||||||||||||||||
| 504 | QTexturedBrushData *data = static_cast<QTexturedBrushData *>(d.data()); | - | ||||||||||||||||||
| 505 | data->setImage(image); | - | ||||||||||||||||||
| 506 | } never executed: else {end of block | 0 | ||||||||||||||||||
| 507 | detach(Qt::NoBrush); | - | ||||||||||||||||||
| 508 | } never executed: end of block | 0 | ||||||||||||||||||
| 509 | } | - | ||||||||||||||||||
| 510 | - | |||||||||||||||||||
| 511 | - | |||||||||||||||||||
| 512 | - | |||||||||||||||||||
| 513 | - | |||||||||||||||||||
| 514 | - | |||||||||||||||||||
| 515 | const QGradient *QBrush::gradient() const | - | ||||||||||||||||||
| 516 | { | - | ||||||||||||||||||
| 517 | if (d->style == Qt::LinearGradientPattern
| 0 | ||||||||||||||||||
| 518 | || d->style == Qt::RadialGradientPattern
| 0 | ||||||||||||||||||
| 519 | || d->style == Qt::ConicalGradientPattern
| 0 | ||||||||||||||||||
| 520 | return never executed: &static_cast<const QGradientBrushData *>(d.data())->gradient;return &static_cast<const QGradientBrushData *>(d.data())->gradient;never executed: return &static_cast<const QGradientBrushData *>(d.data())->gradient; | 0 | ||||||||||||||||||
| 521 | } | - | ||||||||||||||||||
| 522 | return never executed: 0;return 0;never executed: return 0; | 0 | ||||||||||||||||||
| 523 | } | - | ||||||||||||||||||
| 524 | - | |||||||||||||||||||
| 525 | __attribute__((visibility("default"))) bool qt_isExtendedRadialGradient(const QBrush &brush) | - | ||||||||||||||||||
| 526 | { | - | ||||||||||||||||||
| 527 | if (brush.style() == Qt::RadialGradientPattern
| 0 | ||||||||||||||||||
| 528 | const QGradient *g = brush.gradient(); | - | ||||||||||||||||||
| 529 | const QRadialGradient *rg = static_cast<const QRadialGradient *>(g); | - | ||||||||||||||||||
| 530 | - | |||||||||||||||||||
| 531 | if (!qFuzzyIsNull(rg->focalRadius())
| 0 | ||||||||||||||||||
| 532 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||
| 533 | - | |||||||||||||||||||
| 534 | QPointF delta = rg->focalPoint() - rg->center(); | - | ||||||||||||||||||
| 535 | if (delta.x() * delta.x() + delta.y() * delta.y() > rg->radius() * rg->radius()
| 0 | ||||||||||||||||||
| 536 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||
| 537 | } never executed: end of block | 0 | ||||||||||||||||||
| 538 | - | |||||||||||||||||||
| 539 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 540 | } | - | ||||||||||||||||||
| 541 | bool QBrush::isOpaque() const | - | ||||||||||||||||||
| 542 | { | - | ||||||||||||||||||
| 543 | bool opaqueColor = d->color.alpha() == 255; | - | ||||||||||||||||||
| 544 | - | |||||||||||||||||||
| 545 | - | |||||||||||||||||||
| 546 | if (d->style == Qt::SolidPattern
| 0 | ||||||||||||||||||
| 547 | return never executed: opaqueColor;return opaqueColor;never executed: return opaqueColor; | 0 | ||||||||||||||||||
| 548 | - | |||||||||||||||||||
| 549 | if (qt_isExtendedRadialGradient(*this)
| 0 | ||||||||||||||||||
| 550 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 551 | - | |||||||||||||||||||
| 552 | if (d->style == Qt::LinearGradientPattern
| 0 | ||||||||||||||||||
| 553 | || d->style == Qt::RadialGradientPattern
| 0 | ||||||||||||||||||
| 554 | || d->style == Qt::ConicalGradientPattern
| 0 | ||||||||||||||||||
| 555 | QGradientStops stops = gradient()->stops(); | - | ||||||||||||||||||
| 556 | for (int i=0; i<stops.size()
| 0 | ||||||||||||||||||
| 557 | if (stops.at(i).second.alpha() != 255
| 0 | ||||||||||||||||||
| 558 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 559 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||
| 560 | } else if (d->style == Qt::TexturePattern
| 0 | ||||||||||||||||||
| 561 | return never executed: qHasPixmapTexture(*this)return qHasPixmapTexture(*this) ? !texture().hasAlphaChannel() && !texture().isQBitmap() : !textureImage().hasAlphaChannel();never executed: return qHasPixmapTexture(*this) ? !texture().hasAlphaChannel() && !texture().isQBitmap() : !textureImage().hasAlphaChannel(); | 0 | ||||||||||||||||||
| 562 | ? !texture().hasAlphaChannel() && !texture().isQBitmap() never executed: return qHasPixmapTexture(*this) ? !texture().hasAlphaChannel() && !texture().isQBitmap() : !textureImage().hasAlphaChannel(); | 0 | ||||||||||||||||||
| 563 | : !textureImage().hasAlphaChannel(); never executed: return qHasPixmapTexture(*this) ? !texture().hasAlphaChannel() && !texture().isQBitmap() : !textureImage().hasAlphaChannel(); | 0 | ||||||||||||||||||
| 564 | } | - | ||||||||||||||||||
| 565 | - | |||||||||||||||||||
| 566 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 567 | } | - | ||||||||||||||||||
| 568 | void QBrush::setMatrix(const QMatrix &matrix) | - | ||||||||||||||||||
| 569 | { | - | ||||||||||||||||||
| 570 | setTransform(QTransform(matrix)); | - | ||||||||||||||||||
| 571 | } never executed: end of block | 0 | ||||||||||||||||||
| 572 | void QBrush::setTransform(const QTransform &matrix) | - | ||||||||||||||||||
| 573 | { | - | ||||||||||||||||||
| 574 | detach(d->style); | - | ||||||||||||||||||
| 575 | d->transform = matrix; | - | ||||||||||||||||||
| 576 | } never executed: end of block | 0 | ||||||||||||||||||
| 577 | bool QBrush::operator==(const QBrush &b) const | - | ||||||||||||||||||
| 578 | { | - | ||||||||||||||||||
| 579 | if (b.d == d
| 0 | ||||||||||||||||||
| 580 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||
| 581 | if (b.d->style != d->style
| 0 | ||||||||||||||||||
| 582 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 583 | switch (d->style) { | - | ||||||||||||||||||
| 584 | case never executed: Qt::TexturePattern:case Qt::TexturePattern:never executed: case Qt::TexturePattern: | 0 | ||||||||||||||||||
| 585 | { | - | ||||||||||||||||||
| 586 | - | |||||||||||||||||||
| 587 | - | |||||||||||||||||||
| 588 | - | |||||||||||||||||||
| 589 | - | |||||||||||||||||||
| 590 | const QPixmap *us = 0, *them = 0; | - | ||||||||||||||||||
| 591 | qint64 cacheKey1, cacheKey2; | - | ||||||||||||||||||
| 592 | if (qHasPixmapTexture(*this)
| 0 | ||||||||||||||||||
| 593 | us = (static_cast<QTexturedBrushData *>(d.data()))->m_pixmap; | - | ||||||||||||||||||
| 594 | cacheKey1 = us->cacheKey(); | - | ||||||||||||||||||
| 595 | } never executed: elseend of block | 0 | ||||||||||||||||||
| 596 | cacheKey1 = (static_cast<QTexturedBrushData *>(d.data()))->image().cacheKey(); never executed: cacheKey1 = (static_cast<QTexturedBrushData *>(d.data()))->image().cacheKey(); | 0 | ||||||||||||||||||
| 597 | - | |||||||||||||||||||
| 598 | if (qHasPixmapTexture(b)
| 0 | ||||||||||||||||||
| 599 | them = (static_cast<QTexturedBrushData *>(b.d.data()))->m_pixmap; | - | ||||||||||||||||||
| 600 | cacheKey2 = them->cacheKey(); | - | ||||||||||||||||||
| 601 | } never executed: elseend of block | 0 | ||||||||||||||||||
| 602 | cacheKey2 = (static_cast<QTexturedBrushData *>(b.d.data()))->image().cacheKey(); never executed: cacheKey2 = (static_cast<QTexturedBrushData *>(b.d.data()))->image().cacheKey(); | 0 | ||||||||||||||||||
| 603 | - | |||||||||||||||||||
| 604 | if (cacheKey1 != cacheKey2
| 0 | ||||||||||||||||||
| 605 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 606 | if (!us == !them
| 0 | ||||||||||||||||||
| 607 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||
| 608 | - | |||||||||||||||||||
| 609 | if (us
| 0 | ||||||||||||||||||
| 610 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||
| 611 | if (them
| 0 | ||||||||||||||||||
| 612 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||
| 613 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 614 | } | - | ||||||||||||||||||
| 615 | case never executed: Qt::LinearGradientPattern:case Qt::LinearGradientPattern:never executed: case Qt::LinearGradientPattern: | 0 | ||||||||||||||||||
| 616 | case never executed: Qt::RadialGradientPattern:case Qt::RadialGradientPattern:never executed: case Qt::RadialGradientPattern: | 0 | ||||||||||||||||||
| 617 | case never executed: Qt::ConicalGradientPattern:case Qt::ConicalGradientPattern:never executed: case Qt::ConicalGradientPattern: | 0 | ||||||||||||||||||
| 618 | { | - | ||||||||||||||||||
| 619 | const QGradientBrushData *d1 = static_cast<QGradientBrushData *>(d.data()); | - | ||||||||||||||||||
| 620 | const QGradientBrushData *d2 = static_cast<QGradientBrushData *>(b.d.data()); | - | ||||||||||||||||||
| 621 | return never executed: d1->gradient == d2->gradient;return d1->gradient == d2->gradient;never executed: return d1->gradient == d2->gradient; | 0 | ||||||||||||||||||
| 622 | } | - | ||||||||||||||||||
| 623 | default never executed: :default:never executed: default: | 0 | ||||||||||||||||||
| 624 | return never executed: true;return true;never executed: return true; | 0 | ||||||||||||||||||
| 625 | } | - | ||||||||||||||||||
| 626 | } | - | ||||||||||||||||||
| 627 | - | |||||||||||||||||||
| 628 | - | |||||||||||||||||||
| 629 | - | |||||||||||||||||||
| 630 | - | |||||||||||||||||||
| 631 | - | |||||||||||||||||||
| 632 | QDebug operator<<(QDebug dbg, const QBrush &b) | - | ||||||||||||||||||
| 633 | { | - | ||||||||||||||||||
| 634 | static const char *const BRUSH_STYLES[] = { | - | ||||||||||||||||||
| 635 | "NoBrush", | - | ||||||||||||||||||
| 636 | "SolidPattern", | - | ||||||||||||||||||
| 637 | "Dense1Pattern", | - | ||||||||||||||||||
| 638 | "Dense2Pattern", | - | ||||||||||||||||||
| 639 | "Dense3Pattern", | - | ||||||||||||||||||
| 640 | "Dense4Pattern", | - | ||||||||||||||||||
| 641 | "Dense5Pattern", | - | ||||||||||||||||||
| 642 | "Dense6Pattern", | - | ||||||||||||||||||
| 643 | "Dense7Pattern", | - | ||||||||||||||||||
| 644 | "HorPattern", | - | ||||||||||||||||||
| 645 | "VerPattern", | - | ||||||||||||||||||
| 646 | "CrossPattern", | - | ||||||||||||||||||
| 647 | "BDiagPattern", | - | ||||||||||||||||||
| 648 | "FDiagPattern", | - | ||||||||||||||||||
| 649 | "DiagCrossPattern", | - | ||||||||||||||||||
| 650 | "LinearGradientPattern", | - | ||||||||||||||||||
| 651 | "RadialGradientPattern", | - | ||||||||||||||||||
| 652 | "ConicalGradientPattern", | - | ||||||||||||||||||
| 653 | 0, 0, 0, 0, 0, 0, | - | ||||||||||||||||||
| 654 | "TexturePattern" | - | ||||||||||||||||||
| 655 | }; | - | ||||||||||||||||||
| 656 | - | |||||||||||||||||||
| 657 | QDebugStateSaver saver(dbg); | - | ||||||||||||||||||
| 658 | dbg.nospace() << "QBrush(" << b.color() << ',' << BRUSH_STYLES[b.style()] << ')'; | - | ||||||||||||||||||
| 659 | return never executed: dbg;return dbg;never executed: return dbg; | 0 | ||||||||||||||||||
| 660 | } | - | ||||||||||||||||||
| 661 | QDataStream &operator<<(QDataStream &s, const QBrush &b) | - | ||||||||||||||||||
| 662 | { | - | ||||||||||||||||||
| 663 | quint8 style = (quint8) b.style(); | - | ||||||||||||||||||
| 664 | bool gradient_style = false; | - | ||||||||||||||||||
| 665 | - | |||||||||||||||||||
| 666 | if (style == Qt::LinearGradientPattern
| 0 | ||||||||||||||||||
| 667 | || style == Qt::ConicalGradientPattern
| 0 | ||||||||||||||||||
| 668 | gradient_style = true; never executed: gradient_style = true; | 0 | ||||||||||||||||||
| 669 | - | |||||||||||||||||||
| 670 | if (s.version() < QDataStream::Qt_4_0
| 0 | ||||||||||||||||||
| 671 | style = Qt::NoBrush; never executed: style = Qt::NoBrush; | 0 | ||||||||||||||||||
| 672 | - | |||||||||||||||||||
| 673 | s << style << b.color(); | - | ||||||||||||||||||
| 674 | if (b.style() == Qt::TexturePattern
| 0 | ||||||||||||||||||
| 675 | if (s.version() >= QDataStream::Qt_5_5
| 0 | ||||||||||||||||||
| 676 | s << b.textureImage(); never executed: s << b.textureImage(); | 0 | ||||||||||||||||||
| 677 | else | - | ||||||||||||||||||
| 678 | s << b.texture(); never executed: s << b.texture(); | 0 | ||||||||||||||||||
| 679 | } else if (s.version() >= QDataStream::Qt_4_0
| 0 | ||||||||||||||||||
| 680 | const QGradient *gradient = b.gradient(); | - | ||||||||||||||||||
| 681 | int type_as_int = int(gradient->type()); | - | ||||||||||||||||||
| 682 | s << type_as_int; | - | ||||||||||||||||||
| 683 | if (s.version() >= QDataStream::Qt_4_3
| 0 | ||||||||||||||||||
| 684 | s << int(gradient->spread()); | - | ||||||||||||||||||
| 685 | s << int(gradient->coordinateMode()); | - | ||||||||||||||||||
| 686 | } never executed: end of block | 0 | ||||||||||||||||||
| 687 | - | |||||||||||||||||||
| 688 | if (s.version() >= QDataStream::Qt_4_5
| 0 | ||||||||||||||||||
| 689 | s << int(gradient->interpolationMode()); never executed: s << int(gradient->interpolationMode()); | 0 | ||||||||||||||||||
| 690 | - | |||||||||||||||||||
| 691 | if (sizeof(qreal) == sizeof(double)
| 0 | ||||||||||||||||||
| 692 | s << gradient->stops(); | - | ||||||||||||||||||
| 693 | } never executed: else {end of block | 0 | ||||||||||||||||||
| 694 | - | |||||||||||||||||||
| 695 | - | |||||||||||||||||||
| 696 | - | |||||||||||||||||||
| 697 | QVector<QGradientStop> stops = gradient->stops(); | - | ||||||||||||||||||
| 698 | s << quint32(stops.size()); | - | ||||||||||||||||||
| 699 | for (int i = 0; i < stops.size()
| 0 | ||||||||||||||||||
| 700 | const QGradientStop &stop = stops.at(i); | - | ||||||||||||||||||
| 701 | s << QPair<double, QColor>(double(stop.first), stop.second); | - | ||||||||||||||||||
| 702 | } never executed: end of block | 0 | ||||||||||||||||||
| 703 | } never executed: end of block | 0 | ||||||||||||||||||
| 704 | - | |||||||||||||||||||
| 705 | if (gradient->type() == QGradient::LinearGradient
| 0 | ||||||||||||||||||
| 706 | s << static_cast<const QLinearGradient *>(gradient)->start(); | - | ||||||||||||||||||
| 707 | s << static_cast<const QLinearGradient *>(gradient)->finalStop(); | - | ||||||||||||||||||
| 708 | } never executed: else if (gradient->type() == QGradient::RadialGradientend of block
| 0 | ||||||||||||||||||
| 709 | s << static_cast<const QRadialGradient *>(gradient)->center(); | - | ||||||||||||||||||
| 710 | s << static_cast<const QRadialGradient *>(gradient)->focalPoint(); | - | ||||||||||||||||||
| 711 | s << (double) static_cast<const QRadialGradient *>(gradient)->radius(); | - | ||||||||||||||||||
| 712 | } never executed: else {end of block | 0 | ||||||||||||||||||
| 713 | s << static_cast<const QConicalGradient *>(gradient)->center(); | - | ||||||||||||||||||
| 714 | s << (double) static_cast<const QConicalGradient *>(gradient)->angle(); | - | ||||||||||||||||||
| 715 | } never executed: end of block | 0 | ||||||||||||||||||
| 716 | } | - | ||||||||||||||||||
| 717 | if (s.version() >= QDataStream::Qt_4_3
| 0 | ||||||||||||||||||
| 718 | s << b.transform(); never executed: s << b.transform(); | 0 | ||||||||||||||||||
| 719 | return never executed: s;return s;never executed: return s; | 0 | ||||||||||||||||||
| 720 | } | - | ||||||||||||||||||
| 721 | QDataStream &operator>>(QDataStream &s, QBrush &b) | - | ||||||||||||||||||
| 722 | { | - | ||||||||||||||||||
| 723 | quint8 style; | - | ||||||||||||||||||
| 724 | QColor color; | - | ||||||||||||||||||
| 725 | s >> style; | - | ||||||||||||||||||
| 726 | s >> color; | - | ||||||||||||||||||
| 727 | b = QBrush(color); | - | ||||||||||||||||||
| 728 | if (style == Qt::TexturePattern
| 0 | ||||||||||||||||||
| 729 | if (s.version() >= QDataStream::Qt_5_5
| 0 | ||||||||||||||||||
| 730 | QImage img; | - | ||||||||||||||||||
| 731 | s >> img; | - | ||||||||||||||||||
| 732 | b.setTextureImage(std::move(img)); | - | ||||||||||||||||||
| 733 | } never executed: else {end of block | 0 | ||||||||||||||||||
| 734 | QPixmap pm; | - | ||||||||||||||||||
| 735 | s >> pm; | - | ||||||||||||||||||
| 736 | b.setTexture(std::move(pm)); | - | ||||||||||||||||||
| 737 | } never executed: end of block | 0 | ||||||||||||||||||
| 738 | } else if (style == Qt::LinearGradientPattern
| 0 | ||||||||||||||||||
| 739 | || style == Qt::RadialGradientPattern
| 0 | ||||||||||||||||||
| 740 | || style == Qt::ConicalGradientPattern
| 0 | ||||||||||||||||||
| 741 | - | |||||||||||||||||||
| 742 | int type_as_int; | - | ||||||||||||||||||
| 743 | QGradient::Type type; | - | ||||||||||||||||||
| 744 | QGradientStops stops; | - | ||||||||||||||||||
| 745 | QGradient::CoordinateMode cmode = QGradient::LogicalMode; | - | ||||||||||||||||||
| 746 | QGradient::Spread spread = QGradient::PadSpread; | - | ||||||||||||||||||
| 747 | QGradient::InterpolationMode imode = QGradient::ColorInterpolation; | - | ||||||||||||||||||
| 748 | - | |||||||||||||||||||
| 749 | s >> type_as_int; | - | ||||||||||||||||||
| 750 | type = QGradient::Type(type_as_int); | - | ||||||||||||||||||
| 751 | if (s.version() >= QDataStream::Qt_4_3
| 0 | ||||||||||||||||||
| 752 | s >> type_as_int; | - | ||||||||||||||||||
| 753 | spread = QGradient::Spread(type_as_int); | - | ||||||||||||||||||
| 754 | s >> type_as_int; | - | ||||||||||||||||||
| 755 | cmode = QGradient::CoordinateMode(type_as_int); | - | ||||||||||||||||||
| 756 | } never executed: end of block | 0 | ||||||||||||||||||
| 757 | - | |||||||||||||||||||
| 758 | if (s.version() >= QDataStream::Qt_4_5
| 0 | ||||||||||||||||||
| 759 | s >> type_as_int; | - | ||||||||||||||||||
| 760 | imode = QGradient::InterpolationMode(type_as_int); | - | ||||||||||||||||||
| 761 | } never executed: end of block | 0 | ||||||||||||||||||
| 762 | - | |||||||||||||||||||
| 763 | if (sizeof(qreal) == sizeof(double)
| 0 | ||||||||||||||||||
| 764 | s >> stops; | - | ||||||||||||||||||
| 765 | } never executed: else {end of block | 0 | ||||||||||||||||||
| 766 | quint32 numStops; | - | ||||||||||||||||||
| 767 | double n; | - | ||||||||||||||||||
| 768 | QColor c; | - | ||||||||||||||||||
| 769 | - | |||||||||||||||||||
| 770 | s >> numStops; | - | ||||||||||||||||||
| 771 | stops.reserve(numStops); | - | ||||||||||||||||||
| 772 | for (quint32 i = 0; i < numStops
| 0 | ||||||||||||||||||
| 773 | s >> n >> c; | - | ||||||||||||||||||
| 774 | stops << QPair<qreal, QColor>(n, c); | - | ||||||||||||||||||
| 775 | } never executed: end of block | 0 | ||||||||||||||||||
| 776 | } never executed: end of block | 0 | ||||||||||||||||||
| 777 | - | |||||||||||||||||||
| 778 | if (type == QGradient::LinearGradient
| 0 | ||||||||||||||||||
| 779 | QPointF p1, p2; | - | ||||||||||||||||||
| 780 | s >> p1; | - | ||||||||||||||||||
| 781 | s >> p2; | - | ||||||||||||||||||
| 782 | QLinearGradient lg(p1, p2); | - | ||||||||||||||||||
| 783 | lg.setStops(stops); | - | ||||||||||||||||||
| 784 | lg.setSpread(spread); | - | ||||||||||||||||||
| 785 | lg.setCoordinateMode(cmode); | - | ||||||||||||||||||
| 786 | lg.setInterpolationMode(imode); | - | ||||||||||||||||||
| 787 | b = QBrush(lg); | - | ||||||||||||||||||
| 788 | } never executed: else if (type == QGradient::RadialGradientend of block
| 0 | ||||||||||||||||||
| 789 | QPointF center, focal; | - | ||||||||||||||||||
| 790 | double radius; | - | ||||||||||||||||||
| 791 | s >> center; | - | ||||||||||||||||||
| 792 | s >> focal; | - | ||||||||||||||||||
| 793 | s >> radius; | - | ||||||||||||||||||
| 794 | QRadialGradient rg(center, radius, focal); | - | ||||||||||||||||||
| 795 | rg.setStops(stops); | - | ||||||||||||||||||
| 796 | rg.setSpread(spread); | - | ||||||||||||||||||
| 797 | rg.setCoordinateMode(cmode); | - | ||||||||||||||||||
| 798 | rg.setInterpolationMode(imode); | - | ||||||||||||||||||
| 799 | b = QBrush(rg); | - | ||||||||||||||||||
| 800 | } never executed: else {end of block | 0 | ||||||||||||||||||
| 801 | QPointF center; | - | ||||||||||||||||||
| 802 | double angle; | - | ||||||||||||||||||
| 803 | s >> center; | - | ||||||||||||||||||
| 804 | s >> angle; | - | ||||||||||||||||||
| 805 | QConicalGradient cg(center, angle); | - | ||||||||||||||||||
| 806 | cg.setStops(stops); | - | ||||||||||||||||||
| 807 | cg.setSpread(spread); | - | ||||||||||||||||||
| 808 | cg.setCoordinateMode(cmode); | - | ||||||||||||||||||
| 809 | cg.setInterpolationMode(imode); | - | ||||||||||||||||||
| 810 | b = QBrush(cg); | - | ||||||||||||||||||
| 811 | } never executed: end of block | 0 | ||||||||||||||||||
| 812 | } else { | - | ||||||||||||||||||
| 813 | b = QBrush(color, (Qt::BrushStyle)style); | - | ||||||||||||||||||
| 814 | } never executed: end of block | 0 | ||||||||||||||||||
| 815 | if (s.version() >= QDataStream::Qt_4_3
| 0 | ||||||||||||||||||
| 816 | QTransform transform; | - | ||||||||||||||||||
| 817 | s >> transform; | - | ||||||||||||||||||
| 818 | b.setTransform(transform); | - | ||||||||||||||||||
| 819 | } never executed: end of block | 0 | ||||||||||||||||||
| 820 | return never executed: s;return s;never executed: return s; | 0 | ||||||||||||||||||
| 821 | } | - | ||||||||||||||||||
| 822 | QGradient::QGradient() | - | ||||||||||||||||||
| 823 | : m_type(NoGradient), dummy(0) | - | ||||||||||||||||||
| 824 | { | - | ||||||||||||||||||
| 825 | } never executed: end of block | 0 | ||||||||||||||||||
| 826 | void QGradient::setColorAt(qreal pos, const QColor &color) | - | ||||||||||||||||||
| 827 | { | - | ||||||||||||||||||
| 828 | if ((pos > 1
| 0 | ||||||||||||||||||
| 829 | QMessageLogger(__FILE__, 1409, __PRETTY_FUNCTION__).warning("QGradient::setColorAt: Color position must be specified in the range 0 to 1"); | - | ||||||||||||||||||
| 830 | return; never executed: return; | 0 | ||||||||||||||||||
| 831 | } | - | ||||||||||||||||||
| 832 | - | |||||||||||||||||||
| 833 | int index = 0; | - | ||||||||||||||||||
| 834 | if (!qIsNaN(pos)
| 0 | ||||||||||||||||||
| 835 | while (index < m_stops.size()
never executed: index;++index;never executed: ++index; | 0 | ||||||||||||||||||
| 836 | - | |||||||||||||||||||
| 837 | if (index < m_stops.size()
| 0 | ||||||||||||||||||
| 838 | m_stops[index].second = color; never executed: m_stops[index].second = color; | 0 | ||||||||||||||||||
| 839 | else | - | ||||||||||||||||||
| 840 | m_stops.insert(index, QGradientStop(pos, color)); never executed: m_stops.insert(index, QGradientStop(pos, color)); | 0 | ||||||||||||||||||
| 841 | } | - | ||||||||||||||||||
| 842 | void QGradient::setStops(const QGradientStops &stops) | - | ||||||||||||||||||
| 843 | { | - | ||||||||||||||||||
| 844 | m_stops.clear(); | - | ||||||||||||||||||
| 845 | for (int i=0; i<stops.size()
| 0 | ||||||||||||||||||
| 846 | setColorAt(stops.at(i).first, stops.at(i).second); never executed: setColorAt(stops.at(i).first, stops.at(i).second); | 0 | ||||||||||||||||||
| 847 | } never executed: end of block | 0 | ||||||||||||||||||
| 848 | QGradientStops QGradient::stops() const | - | ||||||||||||||||||
| 849 | { | - | ||||||||||||||||||
| 850 | if (m_stops.isEmpty()
| 0 | ||||||||||||||||||
| 851 | QGradientStops tmp; | - | ||||||||||||||||||
| 852 | tmp << QGradientStop(0, Qt::black) << QGradientStop(1, Qt::white); | - | ||||||||||||||||||
| 853 | return never executed: tmp;return tmp;never executed: return tmp; | 0 | ||||||||||||||||||
| 854 | } | - | ||||||||||||||||||
| 855 | return never executed: m_stops;return m_stops;never executed: return m_stops; | 0 | ||||||||||||||||||
| 856 | } | - | ||||||||||||||||||
| 857 | QGradient::CoordinateMode QGradient::coordinateMode() const | - | ||||||||||||||||||
| 858 | { | - | ||||||||||||||||||
| 859 | union {void *p; uint i;}; p = dummy; | - | ||||||||||||||||||
| 860 | return never executed: CoordinateMode(i & 0x03);return CoordinateMode(i & 0x03);never executed: return CoordinateMode(i & 0x03); | 0 | ||||||||||||||||||
| 861 | } | - | ||||||||||||||||||
| 862 | - | |||||||||||||||||||
| 863 | - | |||||||||||||||||||
| 864 | - | |||||||||||||||||||
| 865 | - | |||||||||||||||||||
| 866 | - | |||||||||||||||||||
| 867 | - | |||||||||||||||||||
| 868 | - | |||||||||||||||||||
| 869 | void QGradient::setCoordinateMode(CoordinateMode mode) | - | ||||||||||||||||||
| 870 | { | - | ||||||||||||||||||
| 871 | union {void *p; uint i;}; p = dummy; | - | ||||||||||||||||||
| 872 | i &= ~0x03; | - | ||||||||||||||||||
| 873 | i |= uint(mode); | - | ||||||||||||||||||
| 874 | dummy = p; | - | ||||||||||||||||||
| 875 | } never executed: end of block | 0 | ||||||||||||||||||
| 876 | QGradient::InterpolationMode QGradient::interpolationMode() const | - | ||||||||||||||||||
| 877 | { | - | ||||||||||||||||||
| 878 | union {void *p; uint i;}; p = dummy; | - | ||||||||||||||||||
| 879 | return never executed: InterpolationMode((i >> 2) & 0x01);return InterpolationMode((i >> 2) & 0x01);never executed: return InterpolationMode((i >> 2) & 0x01); | 0 | ||||||||||||||||||
| 880 | } | - | ||||||||||||||||||
| 881 | void QGradient::setInterpolationMode(InterpolationMode mode) | - | ||||||||||||||||||
| 882 | { | - | ||||||||||||||||||
| 883 | union {void *p; uint i;}; p = dummy; | - | ||||||||||||||||||
| 884 | i &= ~(1 << 2); | - | ||||||||||||||||||
| 885 | i |= (uint(mode) << 2); | - | ||||||||||||||||||
| 886 | dummy = p; | - | ||||||||||||||||||
| 887 | } never executed: end of block | 0 | ||||||||||||||||||
| 888 | bool QGradient::operator==(const QGradient &gradient) const | - | ||||||||||||||||||
| 889 | { | - | ||||||||||||||||||
| 890 | if (gradient.m_type != m_type
| 0 | ||||||||||||||||||
| 891 | || gradient.m_spread != m_spread
| 0 | ||||||||||||||||||
| 892 | || gradient.dummy != dummy
never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 893 | - | |||||||||||||||||||
| 894 | if (m_type == LinearGradient
| 0 | ||||||||||||||||||
| 895 | if (m_data.linear.x1 != gradient.m_data.linear.x1
| 0 | ||||||||||||||||||
| 896 | || m_data.linear.y1 != gradient.m_data.linear.y1
| 0 | ||||||||||||||||||
| 897 | || m_data.linear.x2 != gradient.m_data.linear.x2
| 0 | ||||||||||||||||||
| 898 | || m_data.linear.y2 != gradient.m_data.linear.y2
| 0 | ||||||||||||||||||
| 899 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 900 | } never executed: else if (m_type == RadialGradientend of block
| 0 | ||||||||||||||||||
| 901 | if (m_data.radial.cx != gradient.m_data.radial.cx
| 0 | ||||||||||||||||||
| 902 | || m_data.radial.cy != gradient.m_data.radial.cy
| 0 | ||||||||||||||||||
| 903 | || m_data.radial.fx != gradient.m_data.radial.fx
| 0 | ||||||||||||||||||
| 904 | || m_data.radial.fy != gradient.m_data.radial.fy
| 0 | ||||||||||||||||||
| 905 | || m_data.radial.cradius != gradient.m_data.radial.cradius
| 0 | ||||||||||||||||||
| 906 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 907 | } never executed: else {end of block | 0 | ||||||||||||||||||
| 908 | if (m_data.conical.cx != gradient.m_data.conical.cx
| 0 | ||||||||||||||||||
| 909 | || m_data.conical.cy != gradient.m_data.conical.cy
| 0 | ||||||||||||||||||
| 910 | || m_data.conical.angle != gradient.m_data.conical.angle
| 0 | ||||||||||||||||||
| 911 | return never executed: false;return false;never executed: return false; | 0 | ||||||||||||||||||
| 912 | } never executed: end of block | 0 | ||||||||||||||||||
| 913 | - | |||||||||||||||||||
| 914 | return never executed: stops() == gradient.stops();return stops() == gradient.stops();never executed: return stops() == gradient.stops(); | 0 | ||||||||||||||||||
| 915 | } | - | ||||||||||||||||||
| 916 | QLinearGradient::QLinearGradient() | - | ||||||||||||||||||
| 917 | { | - | ||||||||||||||||||
| 918 | m_type = LinearGradient; | - | ||||||||||||||||||
| 919 | m_spread = PadSpread; | - | ||||||||||||||||||
| 920 | m_data.linear.x1 = 0; | - | ||||||||||||||||||
| 921 | m_data.linear.y1 = 0; | - | ||||||||||||||||||
| 922 | m_data.linear.x2 = 1; | - | ||||||||||||||||||
| 923 | m_data.linear.y2 = 1; | - | ||||||||||||||||||
| 924 | } never executed: end of block | 0 | ||||||||||||||||||
| 925 | QLinearGradient::QLinearGradient(const QPointF &start, const QPointF &finalStop) | - | ||||||||||||||||||
| 926 | { | - | ||||||||||||||||||
| 927 | m_type = LinearGradient; | - | ||||||||||||||||||
| 928 | m_spread = PadSpread; | - | ||||||||||||||||||
| 929 | m_data.linear.x1 = start.x(); | - | ||||||||||||||||||
| 930 | m_data.linear.y1 = start.y(); | - | ||||||||||||||||||
| 931 | m_data.linear.x2 = finalStop.x(); | - | ||||||||||||||||||
| 932 | m_data.linear.y2 = finalStop.y(); | - | ||||||||||||||||||
| 933 | } never executed: end of block | 0 | ||||||||||||||||||
| 934 | QLinearGradient::QLinearGradient(qreal xStart, qreal yStart, qreal xFinalStop, qreal yFinalStop) | - | ||||||||||||||||||
| 935 | { | - | ||||||||||||||||||
| 936 | m_type = LinearGradient; | - | ||||||||||||||||||
| 937 | m_spread = PadSpread; | - | ||||||||||||||||||
| 938 | m_data.linear.x1 = xStart; | - | ||||||||||||||||||
| 939 | m_data.linear.y1 = yStart; | - | ||||||||||||||||||
| 940 | m_data.linear.x2 = xFinalStop; | - | ||||||||||||||||||
| 941 | m_data.linear.y2 = yFinalStop; | - | ||||||||||||||||||
| 942 | } never executed: end of block | 0 | ||||||||||||||||||
| 943 | QPointF QLinearGradient::start() const | - | ||||||||||||||||||
| 944 | { | - | ||||||||||||||||||
| 945 | ((!(m_type == LinearGradient)) ? qt_assert("m_type == LinearGradient",__FILE__,1696) : qt_noop()); | - | ||||||||||||||||||
| 946 | return never executed: QPointF(m_data.linear.x1, m_data.linear.y1);return QPointF(m_data.linear.x1, m_data.linear.y1);never executed: return QPointF(m_data.linear.x1, m_data.linear.y1); | 0 | ||||||||||||||||||
| 947 | } | - | ||||||||||||||||||
| 948 | void QLinearGradient::setStart(const QPointF &start) | - | ||||||||||||||||||
| 949 | { | - | ||||||||||||||||||
| 950 | ((!(m_type == LinearGradient)) ? qt_assert("m_type == LinearGradient",__FILE__,1722) : qt_noop()); | - | ||||||||||||||||||
| 951 | m_data.linear.x1 = start.x(); | - | ||||||||||||||||||
| 952 | m_data.linear.y1 = start.y(); | - | ||||||||||||||||||
| 953 | } never executed: end of block | 0 | ||||||||||||||||||
| 954 | QPointF QLinearGradient::finalStop() const | - | ||||||||||||||||||
| 955 | { | - | ||||||||||||||||||
| 956 | ((!(m_type == LinearGradient)) ? qt_assert("m_type == LinearGradient",__FILE__,1747) : qt_noop()); | - | ||||||||||||||||||
| 957 | return never executed: QPointF(m_data.linear.x2, m_data.linear.y2);return QPointF(m_data.linear.x2, m_data.linear.y2);never executed: return QPointF(m_data.linear.x2, m_data.linear.y2); | 0 | ||||||||||||||||||
| 958 | } | - | ||||||||||||||||||
| 959 | void QLinearGradient::setFinalStop(const QPointF &stop) | - | ||||||||||||||||||
| 960 | { | - | ||||||||||||||||||
| 961 | ((!(m_type == LinearGradient)) ? qt_assert("m_type == LinearGradient",__FILE__,1763) : qt_noop()); | - | ||||||||||||||||||
| 962 | m_data.linear.x2 = stop.x(); | - | ||||||||||||||||||
| 963 | m_data.linear.y2 = stop.y(); | - | ||||||||||||||||||
| 964 | } never executed: end of block | 0 | ||||||||||||||||||
| 965 | static QPointF qt_radial_gradient_adapt_focal_point(const QPointF ¢er, | - | ||||||||||||||||||
| 966 | qreal radius, | - | ||||||||||||||||||
| 967 | const QPointF &focalPoint) | - | ||||||||||||||||||
| 968 | { | - | ||||||||||||||||||
| 969 | - | |||||||||||||||||||
| 970 | - | |||||||||||||||||||
| 971 | - | |||||||||||||||||||
| 972 | const qreal compensated_radius = radius - radius * qreal(0.001); | - | ||||||||||||||||||
| 973 | QLineF line(center, focalPoint); | - | ||||||||||||||||||
| 974 | if (line.length() > (compensated_radius)
| 0 | ||||||||||||||||||
| 975 | line.setLength(compensated_radius); never executed: line.setLength(compensated_radius); | 0 | ||||||||||||||||||
| 976 | return never executed: line.p2();return line.p2();never executed: return line.p2(); | 0 | ||||||||||||||||||
| 977 | } | - | ||||||||||||||||||
| 978 | QRadialGradient::QRadialGradient(const QPointF ¢er, qreal radius, const QPointF &focalPoint) | - | ||||||||||||||||||
| 979 | { | - | ||||||||||||||||||
| 980 | m_type = RadialGradient; | - | ||||||||||||||||||
| 981 | m_spread = PadSpread; | - | ||||||||||||||||||
| 982 | m_data.radial.cx = center.x(); | - | ||||||||||||||||||
| 983 | m_data.radial.cy = center.y(); | - | ||||||||||||||||||
| 984 | m_data.radial.cradius = radius; | - | ||||||||||||||||||
| 985 | - | |||||||||||||||||||
| 986 | QPointF adapted_focal = qt_radial_gradient_adapt_focal_point(center, radius, focalPoint); | - | ||||||||||||||||||
| 987 | m_data.radial.fx = adapted_focal.x(); | - | ||||||||||||||||||
| 988 | m_data.radial.fy = adapted_focal.y(); | - | ||||||||||||||||||
| 989 | } never executed: end of block | 0 | ||||||||||||||||||
| 990 | - | |||||||||||||||||||
| 991 | - | |||||||||||||||||||
| 992 | - | |||||||||||||||||||
| 993 | - | |||||||||||||||||||
| 994 | - | |||||||||||||||||||
| 995 | - | |||||||||||||||||||
| 996 | - | |||||||||||||||||||
| 997 | QRadialGradient::QRadialGradient(const QPointF ¢er, qreal radius) | - | ||||||||||||||||||
| 998 | { | - | ||||||||||||||||||
| 999 | m_type = RadialGradient; | - | ||||||||||||||||||
| 1000 | m_spread = PadSpread; | - | ||||||||||||||||||
| 1001 | m_data.radial.cx = center.x(); | - | ||||||||||||||||||
| 1002 | m_data.radial.cy = center.y(); | - | ||||||||||||||||||
| 1003 | m_data.radial.cradius = radius; | - | ||||||||||||||||||
| 1004 | m_data.radial.fx = center.x(); | - | ||||||||||||||||||
| 1005 | m_data.radial.fy = center.y(); | - | ||||||||||||||||||
| 1006 | } never executed: end of block | 0 | ||||||||||||||||||
| 1007 | QRadialGradient::QRadialGradient(qreal cx, qreal cy, qreal radius, qreal fx, qreal fy) | - | ||||||||||||||||||
| 1008 | { | - | ||||||||||||||||||
| 1009 | m_type = RadialGradient; | - | ||||||||||||||||||
| 1010 | m_spread = PadSpread; | - | ||||||||||||||||||
| 1011 | m_data.radial.cx = cx; | - | ||||||||||||||||||
| 1012 | m_data.radial.cy = cy; | - | ||||||||||||||||||
| 1013 | m_data.radial.cradius = radius; | - | ||||||||||||||||||
| 1014 | - | |||||||||||||||||||
| 1015 | QPointF adapted_focal = qt_radial_gradient_adapt_focal_point(QPointF(cx, cy), | - | ||||||||||||||||||
| 1016 | radius, | - | ||||||||||||||||||
| 1017 | QPointF(fx, fy)); | - | ||||||||||||||||||
| 1018 | - | |||||||||||||||||||
| 1019 | m_data.radial.fx = adapted_focal.x(); | - | ||||||||||||||||||
| 1020 | m_data.radial.fy = adapted_focal.y(); | - | ||||||||||||||||||
| 1021 | } never executed: end of block | 0 | ||||||||||||||||||
| 1022 | - | |||||||||||||||||||
| 1023 | - | |||||||||||||||||||
| 1024 | - | |||||||||||||||||||
| 1025 | - | |||||||||||||||||||
| 1026 | - | |||||||||||||||||||
| 1027 | - | |||||||||||||||||||
| 1028 | - | |||||||||||||||||||
| 1029 | QRadialGradient::QRadialGradient(qreal cx, qreal cy, qreal radius) | - | ||||||||||||||||||
| 1030 | { | - | ||||||||||||||||||
| 1031 | m_type = RadialGradient; | - | ||||||||||||||||||
| 1032 | m_spread = PadSpread; | - | ||||||||||||||||||
| 1033 | m_data.radial.cx = cx; | - | ||||||||||||||||||
| 1034 | m_data.radial.cy = cy; | - | ||||||||||||||||||
| 1035 | m_data.radial.cradius = radius; | - | ||||||||||||||||||
| 1036 | m_data.radial.fx = cx; | - | ||||||||||||||||||
| 1037 | m_data.radial.fy = cy; | - | ||||||||||||||||||
| 1038 | } never executed: end of block | 0 | ||||||||||||||||||
| 1039 | - | |||||||||||||||||||
| 1040 | - | |||||||||||||||||||
| 1041 | - | |||||||||||||||||||
| 1042 | - | |||||||||||||||||||
| 1043 | - | |||||||||||||||||||
| 1044 | - | |||||||||||||||||||
| 1045 | QRadialGradient::QRadialGradient() | - | ||||||||||||||||||
| 1046 | { | - | ||||||||||||||||||
| 1047 | m_type = RadialGradient; | - | ||||||||||||||||||
| 1048 | m_spread = PadSpread; | - | ||||||||||||||||||
| 1049 | m_data.radial.cx = 0; | - | ||||||||||||||||||
| 1050 | m_data.radial.cy = 0; | - | ||||||||||||||||||
| 1051 | m_data.radial.cradius = 1; | - | ||||||||||||||||||
| 1052 | m_data.radial.fx = 0; | - | ||||||||||||||||||
| 1053 | m_data.radial.fy = 0; | - | ||||||||||||||||||
| 1054 | } never executed: end of block | 0 | ||||||||||||||||||
| 1055 | - | |||||||||||||||||||
| 1056 | - | |||||||||||||||||||
| 1057 | - | |||||||||||||||||||
| 1058 | - | |||||||||||||||||||
| 1059 | - | |||||||||||||||||||
| 1060 | - | |||||||||||||||||||
| 1061 | - | |||||||||||||||||||
| 1062 | QRadialGradient::QRadialGradient(const QPointF ¢er, qreal centerRadius, const QPointF &focalPoint, qreal focalRadius) | - | ||||||||||||||||||
| 1063 | { | - | ||||||||||||||||||
| 1064 | m_type = RadialGradient; | - | ||||||||||||||||||
| 1065 | m_spread = PadSpread; | - | ||||||||||||||||||
| 1066 | m_data.radial.cx = center.x(); | - | ||||||||||||||||||
| 1067 | m_data.radial.cy = center.y(); | - | ||||||||||||||||||
| 1068 | m_data.radial.cradius = centerRadius; | - | ||||||||||||||||||
| 1069 | - | |||||||||||||||||||
| 1070 | m_data.radial.fx = focalPoint.x(); | - | ||||||||||||||||||
| 1071 | m_data.radial.fy = focalPoint.y(); | - | ||||||||||||||||||
| 1072 | setFocalRadius(focalRadius); | - | ||||||||||||||||||
| 1073 | } never executed: end of block | 0 | ||||||||||||||||||
| 1074 | QRadialGradient::QRadialGradient(qreal cx, qreal cy, qreal centerRadius, qreal fx, qreal fy, qreal focalRadius) | - | ||||||||||||||||||
| 1075 | { | - | ||||||||||||||||||
| 1076 | m_type = RadialGradient; | - | ||||||||||||||||||
| 1077 | m_spread = PadSpread; | - | ||||||||||||||||||
| 1078 | m_data.radial.cx = cx; | - | ||||||||||||||||||
| 1079 | m_data.radial.cy = cy; | - | ||||||||||||||||||
| 1080 | m_data.radial.cradius = centerRadius; | - | ||||||||||||||||||
| 1081 | - | |||||||||||||||||||
| 1082 | m_data.radial.fx = fx; | - | ||||||||||||||||||
| 1083 | m_data.radial.fy = fy; | - | ||||||||||||||||||
| 1084 | setFocalRadius(focalRadius); | - | ||||||||||||||||||
| 1085 | } never executed: end of block | 0 | ||||||||||||||||||
| 1086 | - | |||||||||||||||||||
| 1087 | - | |||||||||||||||||||
| 1088 | - | |||||||||||||||||||
| 1089 | - | |||||||||||||||||||
| 1090 | - | |||||||||||||||||||
| 1091 | - | |||||||||||||||||||
| 1092 | - | |||||||||||||||||||
| 1093 | QPointF QRadialGradient::center() const | - | ||||||||||||||||||
| 1094 | { | - | ||||||||||||||||||
| 1095 | ((!(m_type == RadialGradient)) ? qt_assert("m_type == RadialGradient",__FILE__,1982) : qt_noop()); | - | ||||||||||||||||||
| 1096 | return never executed: QPointF(m_data.radial.cx, m_data.radial.cy);return QPointF(m_data.radial.cx, m_data.radial.cy);never executed: return QPointF(m_data.radial.cx, m_data.radial.cy); | 0 | ||||||||||||||||||
| 1097 | } | - | ||||||||||||||||||
| 1098 | void QRadialGradient::setCenter(const QPointF ¢er) | - | ||||||||||||||||||
| 1099 | { | - | ||||||||||||||||||
| 1100 | ((!(m_type == RadialGradient)) ? qt_assert("m_type == RadialGradient",__FILE__,2008) : qt_noop()); | - | ||||||||||||||||||
| 1101 | m_data.radial.cx = center.x(); | - | ||||||||||||||||||
| 1102 | m_data.radial.cy = center.y(); | - | ||||||||||||||||||
| 1103 | } never executed: end of block | 0 | ||||||||||||||||||
| 1104 | qreal QRadialGradient::radius() const | - | ||||||||||||||||||
| 1105 | { | - | ||||||||||||||||||
| 1106 | ((!(m_type == RadialGradient)) ? qt_assert("m_type == RadialGradient",__FILE__,2024) : qt_noop()); | - | ||||||||||||||||||
| 1107 | return never executed: m_data.radial.cradius;return m_data.radial.cradius;never executed: return m_data.radial.cradius; | 0 | ||||||||||||||||||
| 1108 | } | - | ||||||||||||||||||
| 1109 | void QRadialGradient::setRadius(qreal radius) | - | ||||||||||||||||||
| 1110 | { | - | ||||||||||||||||||
| 1111 | ((!(m_type == RadialGradient)) ? qt_assert("m_type == RadialGradient",__FILE__,2039) : qt_noop()); | - | ||||||||||||||||||
| 1112 | m_data.radial.cradius = radius; | - | ||||||||||||||||||
| 1113 | } never executed: end of block | 0 | ||||||||||||||||||
| 1114 | qreal QRadialGradient::centerRadius() const | - | ||||||||||||||||||
| 1115 | { | - | ||||||||||||||||||
| 1116 | ((!(m_type == RadialGradient)) ? qt_assert("m_type == RadialGradient",__FILE__,2053) : qt_noop()); | - | ||||||||||||||||||
| 1117 | return never executed: m_data.radial.cradius;return m_data.radial.cradius;never executed: return m_data.radial.cradius; | 0 | ||||||||||||||||||
| 1118 | } | - | ||||||||||||||||||
| 1119 | - | |||||||||||||||||||
| 1120 | - | |||||||||||||||||||
| 1121 | - | |||||||||||||||||||
| 1122 | - | |||||||||||||||||||
| 1123 | - | |||||||||||||||||||
| 1124 | - | |||||||||||||||||||
| 1125 | - | |||||||||||||||||||
| 1126 | void QRadialGradient::setCenterRadius(qreal radius) | - | ||||||||||||||||||
| 1127 | { | - | ||||||||||||||||||
| 1128 | ((!(m_type == RadialGradient)) ? qt_assert("m_type == RadialGradient",__FILE__,2065) : qt_noop()); | - | ||||||||||||||||||
| 1129 | m_data.radial.cradius = radius; | - | ||||||||||||||||||
| 1130 | } never executed: end of block | 0 | ||||||||||||||||||
| 1131 | qreal QRadialGradient::focalRadius() const | - | ||||||||||||||||||
| 1132 | { | - | ||||||||||||||||||
| 1133 | ((!(m_type == RadialGradient)) ? qt_assert("m_type == RadialGradient",__FILE__,2079) : qt_noop()); | - | ||||||||||||||||||
| 1134 | union {void *p; uint i;}; p = dummy; | - | ||||||||||||||||||
| 1135 | - | |||||||||||||||||||
| 1136 | - | |||||||||||||||||||
| 1137 | union { float f; quint32 i; } u; | - | ||||||||||||||||||
| 1138 | u.i = i & ~0x07; | - | ||||||||||||||||||
| 1139 | return never executed: u.f;return u.f;never executed: return u.f; | 0 | ||||||||||||||||||
| 1140 | } | - | ||||||||||||||||||
| 1141 | - | |||||||||||||||||||
| 1142 | - | |||||||||||||||||||
| 1143 | - | |||||||||||||||||||
| 1144 | - | |||||||||||||||||||
| 1145 | - | |||||||||||||||||||
| 1146 | - | |||||||||||||||||||
| 1147 | - | |||||||||||||||||||
| 1148 | void QRadialGradient::setFocalRadius(qreal radius) | - | ||||||||||||||||||
| 1149 | { | - | ||||||||||||||||||
| 1150 | ((!(m_type == RadialGradient)) ? qt_assert("m_type == RadialGradient",__FILE__,2096) : qt_noop()); | - | ||||||||||||||||||
| 1151 | union {void *p; uint i;}; p = dummy; | - | ||||||||||||||||||
| 1152 | - | |||||||||||||||||||
| 1153 | - | |||||||||||||||||||
| 1154 | - | |||||||||||||||||||
| 1155 | - | |||||||||||||||||||
| 1156 | - | |||||||||||||||||||
| 1157 | union { float f; quint32 i; } u; | - | ||||||||||||||||||
| 1158 | u.f = float(radius); | - | ||||||||||||||||||
| 1159 | - | |||||||||||||||||||
| 1160 | i |= (u.i + 0x04) & ~0x07; | - | ||||||||||||||||||
| 1161 | dummy = p; | - | ||||||||||||||||||
| 1162 | } never executed: end of block | 0 | ||||||||||||||||||
| 1163 | QPointF QRadialGradient::focalPoint() const | - | ||||||||||||||||||
| 1164 | { | - | ||||||||||||||||||
| 1165 | ((!(m_type == RadialGradient)) ? qt_assert("m_type == RadialGradient",__FILE__,2119) : qt_noop()); | - | ||||||||||||||||||
| 1166 | return never executed: QPointF(m_data.radial.fx, m_data.radial.fy);return QPointF(m_data.radial.fx, m_data.radial.fy);never executed: return QPointF(m_data.radial.fx, m_data.radial.fy); | 0 | ||||||||||||||||||
| 1167 | } | - | ||||||||||||||||||
| 1168 | void QRadialGradient::setFocalPoint(const QPointF &focalPoint) | - | ||||||||||||||||||
| 1169 | { | - | ||||||||||||||||||
| 1170 | ((!(m_type == RadialGradient)) ? qt_assert("m_type == RadialGradient",__FILE__,2145) : qt_noop()); | - | ||||||||||||||||||
| 1171 | m_data.radial.fx = focalPoint.x(); | - | ||||||||||||||||||
| 1172 | m_data.radial.fy = focalPoint.y(); | - | ||||||||||||||||||
| 1173 | } never executed: end of block | 0 | ||||||||||||||||||
| 1174 | QConicalGradient::QConicalGradient(const QPointF ¢er, qreal angle) | - | ||||||||||||||||||
| 1175 | { | - | ||||||||||||||||||
| 1176 | m_type = ConicalGradient; | - | ||||||||||||||||||
| 1177 | m_spread = PadSpread; | - | ||||||||||||||||||
| 1178 | m_data.conical.cx = center.x(); | - | ||||||||||||||||||
| 1179 | m_data.conical.cy = center.y(); | - | ||||||||||||||||||
| 1180 | m_data.conical.angle = angle; | - | ||||||||||||||||||
| 1181 | } never executed: end of block | 0 | ||||||||||||||||||
| 1182 | QConicalGradient::QConicalGradient(qreal cx, qreal cy, qreal angle) | - | ||||||||||||||||||
| 1183 | { | - | ||||||||||||||||||
| 1184 | m_type = ConicalGradient; | - | ||||||||||||||||||
| 1185 | m_spread = PadSpread; | - | ||||||||||||||||||
| 1186 | m_data.conical.cx = cx; | - | ||||||||||||||||||
| 1187 | m_data.conical.cy = cy; | - | ||||||||||||||||||
| 1188 | m_data.conical.angle = angle; | - | ||||||||||||||||||
| 1189 | } never executed: end of block | 0 | ||||||||||||||||||
| 1190 | QConicalGradient::QConicalGradient() | - | ||||||||||||||||||
| 1191 | { | - | ||||||||||||||||||
| 1192 | m_type = ConicalGradient; | - | ||||||||||||||||||
| 1193 | m_spread = PadSpread; | - | ||||||||||||||||||
| 1194 | m_data.conical.cx = 0; | - | ||||||||||||||||||
| 1195 | m_data.conical.cy = 0; | - | ||||||||||||||||||
| 1196 | m_data.conical.angle = 0; | - | ||||||||||||||||||
| 1197 | } never executed: end of block | 0 | ||||||||||||||||||
| 1198 | QPointF QConicalGradient::center() const | - | ||||||||||||||||||
| 1199 | { | - | ||||||||||||||||||
| 1200 | ((!(m_type == ConicalGradient)) ? qt_assert("m_type == ConicalGradient",__FILE__,2251) : qt_noop()); | - | ||||||||||||||||||
| 1201 | return never executed: QPointF(m_data.conical.cx, m_data.conical.cy);return QPointF(m_data.conical.cx, m_data.conical.cy);never executed: return QPointF(m_data.conical.cx, m_data.conical.cy); | 0 | ||||||||||||||||||
| 1202 | } | - | ||||||||||||||||||
| 1203 | void QConicalGradient::setCenter(const QPointF ¢er) | - | ||||||||||||||||||
| 1204 | { | - | ||||||||||||||||||
| 1205 | ((!(m_type == ConicalGradient)) ? qt_assert("m_type == ConicalGradient",__FILE__,2276) : qt_noop()); | - | ||||||||||||||||||
| 1206 | m_data.conical.cx = center.x(); | - | ||||||||||||||||||
| 1207 | m_data.conical.cy = center.y(); | - | ||||||||||||||||||
| 1208 | } never executed: end of block | 0 | ||||||||||||||||||
| 1209 | qreal QConicalGradient::angle() const | - | ||||||||||||||||||
| 1210 | { | - | ||||||||||||||||||
| 1211 | ((!(m_type == ConicalGradient)) ? qt_assert("m_type == ConicalGradient",__FILE__,2290) : qt_noop()); | - | ||||||||||||||||||
| 1212 | return never executed: m_data.conical.angle;return m_data.conical.angle;never executed: return m_data.conical.angle; | 0 | ||||||||||||||||||
| 1213 | } | - | ||||||||||||||||||
| 1214 | void QConicalGradient::setAngle(qreal angle) | - | ||||||||||||||||||
| 1215 | { | - | ||||||||||||||||||
| 1216 | ((!(m_type == ConicalGradient)) ? qt_assert("m_type == ConicalGradient",__FILE__,2306) : qt_noop()); | - | ||||||||||||||||||
| 1217 | m_data.conical.angle = angle; | - | ||||||||||||||||||
| 1218 | } never executed: end of block | 0 | ||||||||||||||||||
| 1219 | - | |||||||||||||||||||
| Switch to Source code | Preprocessed file |