| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quickshapes/qquickshape_p_p.h |
| Switch to Source code | Preprocessed file |
| Line | Source | Count | ||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 1 | - | |||||||||||||
| 2 | - | |||||||||||||
| 3 | - | |||||||||||||
| 4 | class QSGPlainTexture; | - | ||||||||||||
| 5 | - | |||||||||||||
| 6 | class QQuickAbstractPathRenderer | - | ||||||||||||
| 7 | { | - | ||||||||||||
| 8 | public: | - | ||||||||||||
| 9 | enum Flag { | - | ||||||||||||
| 10 | SupportsAsync = 0x01 | - | ||||||||||||
| 11 | }; | - | ||||||||||||
| 12 | typedef QFlags<Flag> Flags; | - | ||||||||||||
| 13 | - | |||||||||||||
| 14 | enum FillGradientType { NoGradient = 0, LinearGradient, RadialGradient, ConicalGradient }; | - | ||||||||||||
| 15 | struct GradientDesc { | - | ||||||||||||
| 16 | QGradientStops stops; | - | ||||||||||||
| 17 | QQuickShapeGradient::SpreadMode spread; | - | ||||||||||||
| 18 | QPointF a; | - | ||||||||||||
| 19 | QPointF b; | - | ||||||||||||
| 20 | qreal v0; | - | ||||||||||||
| 21 | qreal v1; | - | ||||||||||||
| 22 | }; | - | ||||||||||||
| 23 | - | |||||||||||||
| 24 | virtual ~QQuickAbstractPathRenderer() { } | - | ||||||||||||
| 25 | - | |||||||||||||
| 26 | - | |||||||||||||
| 27 | virtual void beginSync(int totalCount) = 0; | - | ||||||||||||
| 28 | virtual void endSync(bool async) = 0; | - | ||||||||||||
| 29 | virtual void setAsyncCallback(void (*)(void *), void *) { } | - | ||||||||||||
| 30 | virtual Flags flags() const { return never executed: 0;return 0;never executed: }return 0; | 0 | ||||||||||||
| 31 | virtual void setPath(int index, const QQuickPath *path) = 0; | - | ||||||||||||
| 32 | virtual void setStrokeColor(int index, const QColor &color) = 0; | - | ||||||||||||
| 33 | virtual void setStrokeWidth(int index, qreal w) = 0; | - | ||||||||||||
| 34 | virtual void setFillColor(int index, const QColor &color) = 0; | - | ||||||||||||
| 35 | virtual void setFillRule(int index, QQuickShapePath::FillRule fillRule) = 0; | - | ||||||||||||
| 36 | virtual void setJoinStyle(int index, QQuickShapePath::JoinStyle joinStyle, int miterLimit) = 0; | - | ||||||||||||
| 37 | virtual void setCapStyle(int index, QQuickShapePath::CapStyle capStyle) = 0; | - | ||||||||||||
| 38 | virtual void setStrokeStyle(int index, QQuickShapePath::StrokeStyle strokeStyle, | - | ||||||||||||
| 39 | qreal dashOffset, const QVector<qreal> &dashPattern) = 0; | - | ||||||||||||
| 40 | virtual void setFillGradient(int index, QQuickShapeGradient *gradient) = 0; | - | ||||||||||||
| 41 | - | |||||||||||||
| 42 | - | |||||||||||||
| 43 | virtual void updateNode() = 0; | - | ||||||||||||
| 44 | }; | - | ||||||||||||
| 45 | - | |||||||||||||
| 46 | constexpr inline QFlags<QQuickAbstractPathRenderer::Flags::enum_type> operator|(QQuickAbstractPathRenderer::Flags::enum_type f1, QQuickAbstractPathRenderer::Flags::enum_type f2) noexcept { return QFlags<QQuickAbstractPathRenderer::Flags::enum_type>(f1) | f2; } constexpr inline QFlags<QQuickAbstractPathRenderer::Flags::enum_type> operator|(QQuickAbstractPathRenderer::Flags::enum_type f1, QFlags<QQuickAbstractPathRenderer::Flags::enum_type> f2) noexcept { return f2 | f1; } constexpr inline QIncompatibleFlag operator|(QQuickAbstractPathRenderer::Flags::enum_type f1, int f2) noexcept { return QIncompatibleFlag(int(f1) | f2); } | - | ||||||||||||
| 47 | - | |||||||||||||
| 48 | struct QQuickShapeStrokeFillParams | - | ||||||||||||
| 49 | { | - | ||||||||||||
| 50 | QQuickShapeStrokeFillParams(); | - | ||||||||||||
| 51 | - | |||||||||||||
| 52 | QColor strokeColor; | - | ||||||||||||
| 53 | qreal strokeWidth; | - | ||||||||||||
| 54 | QColor fillColor; | - | ||||||||||||
| 55 | QQuickShapePath::FillRule fillRule; | - | ||||||||||||
| 56 | QQuickShapePath::JoinStyle joinStyle; | - | ||||||||||||
| 57 | int miterLimit; | - | ||||||||||||
| 58 | QQuickShapePath::CapStyle capStyle; | - | ||||||||||||
| 59 | QQuickShapePath::StrokeStyle strokeStyle; | - | ||||||||||||
| 60 | qreal dashOffset; | - | ||||||||||||
| 61 | QVector<qreal> dashPattern; | - | ||||||||||||
| 62 | QQuickShapeGradient *fillGradient; | - | ||||||||||||
| 63 | }; | - | ||||||||||||
| 64 | - | |||||||||||||
| 65 | class __attribute__((visibility("default"))) QQuickShapePathPrivate : public QQuickPathPrivate | - | ||||||||||||
| 66 | { | - | ||||||||||||
| 67 | inline QQuickShapePath* q_func() { return static_cast<QQuickShapePath *>(q_ptr); } inline const QQuickShapePath* q_func() const { return static_cast<const QQuickShapePath *>(q_ptr); } friend class QQuickShapePath; | - | ||||||||||||
| 68 | - | |||||||||||||
| 69 | public: | - | ||||||||||||
| 70 | enum Dirty { | - | ||||||||||||
| 71 | DirtyPath = 0x01, | - | ||||||||||||
| 72 | DirtyStrokeColor = 0x02, | - | ||||||||||||
| 73 | DirtyStrokeWidth = 0x04, | - | ||||||||||||
| 74 | DirtyFillColor = 0x08, | - | ||||||||||||
| 75 | DirtyFillRule = 0x10, | - | ||||||||||||
| 76 | DirtyStyle = 0x20, | - | ||||||||||||
| 77 | DirtyDash = 0x40, | - | ||||||||||||
| 78 | DirtyFillGradient = 0x80, | - | ||||||||||||
| 79 | - | |||||||||||||
| 80 | DirtyAll = 0xFF | - | ||||||||||||
| 81 | }; | - | ||||||||||||
| 82 | - | |||||||||||||
| 83 | QQuickShapePathPrivate(); | - | ||||||||||||
| 84 | - | |||||||||||||
| 85 | void _q_pathChanged(); | - | ||||||||||||
| 86 | void _q_fillGradientChanged(); | - | ||||||||||||
| 87 | - | |||||||||||||
| 88 | static QQuickShapePathPrivate *get(QQuickShapePath *p) { return executed 1051 times by 2 tests: p->d_func();return p->d_func();Executed by:
executed 1051 times by 2 tests: }return p->d_func();Executed by:
| 1051 | ||||||||||||
| 89 | - | |||||||||||||
| 90 | int dirty; | - | ||||||||||||
| 91 | QQuickShapeStrokeFillParams sfp; | - | ||||||||||||
| 92 | }; | - | ||||||||||||
| 93 | - | |||||||||||||
| 94 | class QQuickShapePrivate : public QQuickItemPrivate | - | ||||||||||||
| 95 | { | - | ||||||||||||
| 96 | inline QQuickShape* q_func() { return static_cast<QQuickShape *>(q_ptr); } inline const QQuickShape* q_func() const { return static_cast<const QQuickShape *>(q_ptr); } friend class QQuickShape; | - | ||||||||||||
| 97 | - | |||||||||||||
| 98 | public: | - | ||||||||||||
| 99 | QQuickShapePrivate(); | - | ||||||||||||
| 100 | ~QQuickShapePrivate(); | - | ||||||||||||
| 101 | - | |||||||||||||
| 102 | void createRenderer(); | - | ||||||||||||
| 103 | QSGNode *createNode(); | - | ||||||||||||
| 104 | void sync(); | - | ||||||||||||
| 105 | - | |||||||||||||
| 106 | void _q_shapePathChanged(); | - | ||||||||||||
| 107 | void setStatus(QQuickShape::Status newStatus); | - | ||||||||||||
| 108 | - | |||||||||||||
| 109 | static QQuickShapePrivate *get(QQuickShape *item) { return executed 1088 times by 2 tests: item->d_func();return item->d_func();Executed by:
executed 1088 times by 2 tests: }return item->d_func();Executed by:
| 1088 | ||||||||||||
| 110 | - | |||||||||||||
| 111 | static void asyncShapeReady(void *data); | - | ||||||||||||
| 112 | - | |||||||||||||
| 113 | int effectRefCount; | - | ||||||||||||
| 114 | QVector<QQuickShapePath *> sp; | - | ||||||||||||
| 115 | QElapsedTimer syncTimer; | - | ||||||||||||
| 116 | QQuickAbstractPathRenderer *renderer = nullptr; | - | ||||||||||||
| 117 | int syncTimingTotalDirty = 0; | - | ||||||||||||
| 118 | int syncTimeCounter = 0; | - | ||||||||||||
| 119 | QQuickShape::Status status = QQuickShape::Null; | - | ||||||||||||
| 120 | QQuickShape::RendererType rendererType = QQuickShape::UnknownRenderer; | - | ||||||||||||
| 121 | QQuickShape::ContainsMode containsMode = QQuickShape::BoundingRectContains; | - | ||||||||||||
| 122 | bool spChanged = false; | - | ||||||||||||
| 123 | bool async = false; | - | ||||||||||||
| 124 | bool enableVendorExts = true; | - | ||||||||||||
| 125 | bool syncTimingActive = false; | - | ||||||||||||
| 126 | }; | - | ||||||||||||
| 127 | - | |||||||||||||
| 128 | - | |||||||||||||
| 129 | - | |||||||||||||
| 130 | class QQuickShapeGradientCache : public QOpenGLSharedResource | - | ||||||||||||
| 131 | { | - | ||||||||||||
| 132 | public: | - | ||||||||||||
| 133 | struct Key { | - | ||||||||||||
| 134 | Key(const QGradientStops &stops, QQuickShapeGradient::SpreadMode spread) | - | ||||||||||||
| 135 | : stops(stops), spread(spread) | - | ||||||||||||
| 136 | { } executed 15 times by 1 test: end of blockExecuted by:
| 15 | ||||||||||||
| 137 | QGradientStops stops; | - | ||||||||||||
| 138 | QQuickShapeGradient::SpreadMode spread; | - | ||||||||||||
| 139 | bool operator==(const Key &other) const | - | ||||||||||||
| 140 | { | - | ||||||||||||
| 141 | return executed 15 times by 1 test: spread == other.spread && stops == other.stops;return spread == other.spread && stops == other.stops;Executed by:
executed 15 times by 1 test: return spread == other.spread && stops == other.stops;Executed by:
| 15 | ||||||||||||
| 142 | } | - | ||||||||||||
| 143 | }; | - | ||||||||||||
| 144 | - | |||||||||||||
| 145 | QQuickShapeGradientCache(QOpenGLContext *context) : QOpenGLSharedResource(context->shareGroup()) { } executed 11 times by 1 test: end of blockExecuted by:
| 11 | ||||||||||||
| 146 | ~QQuickShapeGradientCache(); | - | ||||||||||||
| 147 | - | |||||||||||||
| 148 | void invalidateResource() override; | - | ||||||||||||
| 149 | void freeResource(QOpenGLContext *) override; | - | ||||||||||||
| 150 | - | |||||||||||||
| 151 | QSGTexture *get(const Key &grad); | - | ||||||||||||
| 152 | - | |||||||||||||
| 153 | static QQuickShapeGradientCache *currentCache(); | - | ||||||||||||
| 154 | - | |||||||||||||
| 155 | private: | - | ||||||||||||
| 156 | QHash<Key, QSGPlainTexture *> m_cache; | - | ||||||||||||
| 157 | }; | - | ||||||||||||
| 158 | - | |||||||||||||
| 159 | inline uint qHash(const QQuickShapeGradientCache::Key &v, uint seed = 0) | - | ||||||||||||
| 160 | { | - | ||||||||||||
| 161 | uint h = seed + v.spread; | - | ||||||||||||
| 162 | for (int i = 0; i < 3
| 8-90 | ||||||||||||
| 163 | h += v.stops[i].second.rgba(); executed 82 times by 1 test: h += v.stops[i].second.rgba();Executed by:
| 82 | ||||||||||||
| 164 | return executed 30 times by 1 test: h;return h;Executed by:
executed 30 times by 1 test: return h;Executed by:
| 30 | ||||||||||||
| 165 | } | - | ||||||||||||
| 166 | - | |||||||||||||
| 167 | - | |||||||||||||
| 168 | - | |||||||||||||
| 169 | - | |||||||||||||
| Switch to Source code | Preprocessed file |