| Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/context2d/qquickcontext2d_p.h |
| Switch to Source code | Preprocessed file |
| Line | Source | Count |
|---|---|---|
| 1 | - | |
| 2 | static_assert(bool(1 == 1), "Required feature " "quick_canvas" " for file " __FILE__ " not available."); | - |
| 3 | - | |
| 4 | - | |
| 5 | - | |
| 6 | - | |
| 7 | - | |
| 8 | - | |
| 9 | - | |
| 10 | - | |
| 11 | - | |
| 12 | - | |
| 13 | - | |
| 14 | class QQuickContext2DCommandBuffer; | - |
| 15 | class QQuickContext2DTexture; | - |
| 16 | class QQuickPixmap; | - |
| 17 | class QSGTexture; | - |
| 18 | class QSurface; | - |
| 19 | class QOpenGLContext; | - |
| 20 | - | |
| 21 | class QQuickContext2D : public QQuickCanvasContext | - |
| 22 | { | - |
| 23 | public: | - |
| 24 | #pragma GCC diagnostic push | - |
| 25 | - | |
| 26 | #pragma GCC diagnostic ignored "-Wsuggest-override" | - |
| 27 | static const QMetaObject staticMetaObject; virtual const QMetaObject *metaObject() const; virtual void *qt_metacast(const char *); virtual int qt_metacall(QMetaObject::Call, int, void **); static inline QString tr(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } __attribute__ ((__deprecated__)) static inline QString trUtf8(const char *s, const char *c = nullptr, int n = -1) { return staticMetaObject.tr(s, c, n); } private: | - |
| 28 | #pragma GCC diagnostic ignored "-Wattributes" | - |
| 29 | __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); | - |
| 30 | #pragma GCC diagnostic pop | - |
| 31 | struct QPrivateSignal {}; | - |
| 32 | - | |
| 33 | public: | - |
| 34 | QQuickContext2D(const QQuickContext2D &) = delete; QQuickContext2D &operator=(const QQuickContext2D &) = delete; | - |
| 35 | - | |
| 36 | enum TextBaseLineType { Alphabetic=0, Top, Middle, Bottom, Hanging}; | - |
| 37 | enum TextAlignType { Start=0, End, Left, Right, Center}; | - |
| 38 | enum PaintCommand { | - |
| 39 | Invalid = 0, | - |
| 40 | UpdateMatrix, | - |
| 41 | ClearRect, | - |
| 42 | FillRect, | - |
| 43 | StrokeRect, | - |
| 44 | Fill, | - |
| 45 | Stroke, | - |
| 46 | Clip, | - |
| 47 | UpdateBrush, | - |
| 48 | GlobalAlpha, | - |
| 49 | GlobalCompositeOperation, | - |
| 50 | StrokeStyle, | - |
| 51 | FillStyle, | - |
| 52 | LineWidth, | - |
| 53 | LineCap, | - |
| 54 | LineJoin, | - |
| 55 | MiterLimit, | - |
| 56 | ShadowOffsetX, | - |
| 57 | ShadowOffsetY, | - |
| 58 | ShadowBlur, | - |
| 59 | ShadowColor, | - |
| 60 | Font, | - |
| 61 | TextBaseline, | - |
| 62 | TextAlign, | - |
| 63 | FillText, | - |
| 64 | StrokeText, | - |
| 65 | DrawImage, | - |
| 66 | DrawPixmap, | - |
| 67 | GetImageData | - |
| 68 | }; | - |
| 69 | - | |
| 70 | struct State { | - |
| 71 | State() | - |
| 72 | : strokeStyle(QColor(Qt::black)) | - |
| 73 | , fillStyle(QColor(Qt::black)) | - |
| 74 | , fillPatternRepeatX(false) | - |
| 75 | , fillPatternRepeatY(false) | - |
| 76 | , strokePatternRepeatX(false) | - |
| 77 | , strokePatternRepeatY(false) | - |
| 78 | , invertibleCTM(true) | - |
| 79 | , clip(false) | - |
| 80 | , fillRule(Qt::WindingFill) | - |
| 81 | , globalAlpha(1.0) | - |
| 82 | , lineWidth(1) | - |
| 83 | , lineCap(Qt::FlatCap) | - |
| 84 | , lineJoin(Qt::MiterJoin) | - |
| 85 | , miterLimit(10) | - |
| 86 | , shadowOffsetX(0) | - |
| 87 | , shadowOffsetY(0) | - |
| 88 | , shadowBlur(0) | - |
| 89 | , shadowColor(qRgba(0, 0, 0, 0)) | - |
| 90 | , globalCompositeOperation(QPainter::CompositionMode_SourceOver) | - |
| 91 | , font(QFont(QLatin1String("sans-serif"))) | - |
| 92 | , textAlign(QQuickContext2D::Start) | - |
| 93 | , textBaseline(QQuickContext2D::Alphabetic) | - |
| 94 | { | - |
| 95 | font.setPixelSize(10); | - |
| 96 | } never executed: end of block | 0 |
| 97 | - | |
| 98 | QTransform matrix; | - |
| 99 | QPainterPath clipPath; | - |
| 100 | QBrush strokeStyle; | - |
| 101 | QBrush fillStyle; | - |
| 102 | bool fillPatternRepeatX:1; | - |
| 103 | bool fillPatternRepeatY:1; | - |
| 104 | bool strokePatternRepeatX:1; | - |
| 105 | bool strokePatternRepeatY:1; | - |
| 106 | bool invertibleCTM:1; | - |
| 107 | bool clip:1; | - |
| 108 | Qt::FillRule fillRule; | - |
| 109 | qreal globalAlpha; | - |
| 110 | qreal lineWidth; | - |
| 111 | Qt::PenCapStyle lineCap; | - |
| 112 | Qt::PenJoinStyle lineJoin; | - |
| 113 | qreal miterLimit; | - |
| 114 | qreal shadowOffsetX; | - |
| 115 | qreal shadowOffsetY; | - |
| 116 | qreal shadowBlur; | - |
| 117 | QColor shadowColor; | - |
| 118 | QPainter::CompositionMode globalCompositeOperation; | - |
| 119 | QFont font; | - |
| 120 | QQuickContext2D::TextAlignType textAlign; | - |
| 121 | QQuickContext2D::TextBaseLineType textBaseline; | - |
| 122 | }; | - |
| 123 | - | |
| 124 | QQuickContext2D(QObject *parent = nullptr); | - |
| 125 | ~QQuickContext2D(); | - |
| 126 | - | |
| 127 | QStringList contextNames() const override; | - |
| 128 | void init(QQuickCanvasItem *canvasItem, const QVariantMap &args) override; | - |
| 129 | void prepare(const QSize& canvasSize, const QSize& tileSize, const QRect& canvasWindow, const QRect& dirtyRect, bool smooth, bool antialiasing) override; | - |
| 130 | void flush() override; | - |
| 131 | void sync(); | - |
| 132 | QThread *thread() const { return never executed: m_thread;return m_thread;never executed: }return m_thread; | 0 |
| 133 | QQuickContext2DTexture *texture() const; | - |
| 134 | QImage toImage(const QRectF& bounds) override; | - |
| 135 | - | |
| 136 | QV4::ReturnedValue v4value() const override; | - |
| 137 | void setV4Engine(QV4::ExecutionEngine *eng) override; | - |
| 138 | - | |
| 139 | QQuickCanvasItem* canvas() const { return never executed: m_canvas;return m_canvas;never executed: }return m_canvas; | 0 |
| 140 | QQuickContext2DCommandBuffer* buffer() const { return never executed: m_buffer;return m_buffer;never executed: }return m_buffer; | 0 |
| 141 | - | |
| 142 | bool bufferValid() const { return never executed: m_buffer != nullptr;return m_buffer != nullptr;never executed: }return m_buffer != nullptr; | 0 |
| 143 | void popState(); | - |
| 144 | void pushState(); | - |
| 145 | void reset(); | - |
| 146 | - | |
| 147 | void fill(); | - |
| 148 | void clip(); | - |
| 149 | void stroke(); | - |
| 150 | void fillRect(qreal x, qreal y, qreal w, qreal h); | - |
| 151 | void strokeRect(qreal x, qreal y, qreal w, qreal h); | - |
| 152 | void clearRect(qreal x, qreal y, qreal w, qreal h); | - |
| 153 | void drawText(const QString& text, qreal x, qreal y, bool fill); | - |
| 154 | - | |
| 155 | - | |
| 156 | void scale(qreal x, qreal y); | - |
| 157 | void rotate(qreal angle); | - |
| 158 | void shear(qreal h, qreal v); | - |
| 159 | void translate(qreal x, qreal y); | - |
| 160 | void transform(qreal a, qreal b, qreal c, qreal d, qreal e, qreal f); | - |
| 161 | void setTransform(qreal a, qreal b, qreal c, qreal d, qreal e, qreal f); | - |
| 162 | - | |
| 163 | - | |
| 164 | void beginPath(); | - |
| 165 | void closePath(); | - |
| 166 | void moveTo(qreal x, qreal y); | - |
| 167 | void lineTo(qreal x, qreal y); | - |
| 168 | void quadraticCurveTo(qreal cpx, qreal cpy, qreal x, qreal y); | - |
| 169 | void bezierCurveTo(qreal cp1x, qreal cp1y, | - |
| 170 | qreal cp2x, qreal cp2y, qreal x, qreal y); | - |
| 171 | void arcTo(qreal x1, qreal y1, qreal x2, qreal y2, qreal radius); | - |
| 172 | void rect(qreal x, qreal y, qreal w, qreal h); | - |
| 173 | void roundedRect(qreal x, qreal y,qreal w, qreal h, qreal xr, qreal yr); | - |
| 174 | void ellipse(qreal x, qreal y,qreal w, qreal h); | - |
| 175 | void text(const QString& str, qreal x, qreal y); | - |
| 176 | void arc(qreal x, qreal y, qreal radius, | - |
| 177 | qreal startAngle, qreal endAngle, | - |
| 178 | bool anticlockwise); | - |
| 179 | void addArcTo(const QPointF& p1, const QPointF& p2, float radius); | - |
| 180 | - | |
| 181 | bool isPointInPath(qreal x, qreal y) const; | - |
| 182 | - | |
| 183 | QPainterPath createTextGlyphs(qreal x, qreal y, const QString& text); | - |
| 184 | QQmlRefPointer<QQuickCanvasPixmap> createPixmap(const QUrl& url); | - |
| 185 | - | |
| 186 | QOpenGLContext *glContext() const { return never executed: m_glContext;return m_glContext;never executed: }return m_glContext; | 0 |
| 187 | QSurface *surface() const { return never executed: m_surface.data();return m_surface.data();never executed: }return m_surface.data(); | 0 |
| 188 | void setGrabbedImage(const QImage& grab); | - |
| 189 | - | |
| 190 | State state; | - |
| 191 | QStack<QQuickContext2D::State> m_stateStack; | - |
| 192 | QQuickCanvasItem* m_canvas; | - |
| 193 | QQuickContext2DCommandBuffer* m_buffer; | - |
| 194 | QPainterPath m_path; | - |
| 195 | QV4::PersistentValue m_fillStyle; | - |
| 196 | QV4::PersistentValue m_strokeStyle; | - |
| 197 | QV4::PersistentValue m_v4path; | - |
| 198 | QV4::ExecutionEngine *m_v4engine; | - |
| 199 | QScopedPointer<QOffscreenSurface> m_surface; | - |
| 200 | QOpenGLContext *m_glContext; | - |
| 201 | QV4::PersistentValue m_v4value; | - |
| 202 | QQuickContext2DTexture *m_texture; | - |
| 203 | QQuickCanvasItem::RenderTarget m_renderTarget; | - |
| 204 | QQuickCanvasItem::RenderStrategy m_renderStrategy; | - |
| 205 | QQueue<QQuickContext2DCommandBuffer*> m_bufferQueue; | - |
| 206 | QThread *m_thread; | - |
| 207 | QImage m_grabbedImage; | - |
| 208 | bool m_grabbed:1; | - |
| 209 | - | |
| 210 | static QMutex mutex; | - |
| 211 | }; | - |
| 212 | - | |
| 213 | - | |
| 214 | - | |
| 215 | template <> struct QMetaTypeId< QQuickContext2D * > { enum { Defined = 1 }; static int qt_metatype_id() { static QBasicAtomicInt metatype_id = { 0 }; if (const int id = metatype_id.loadAcquire()) return id; const int newId = qRegisterMetaType< QQuickContext2D * >("QQuickContext2D *", reinterpret_cast< QQuickContext2D * *>(quintptr(-1))); metatype_id.storeRelease(newId); return newId; } }; template <> struct QMetaTypeId< QQmlListProperty<QQuickContext2D> > { enum { Defined = 1 }; static int qt_metatype_id() { static QBasicAtomicInt metatype_id = { 0 }; if (const int id = metatype_id.loadAcquire()) return id; const int newId = qRegisterMetaType< QQmlListProperty<QQuickContext2D> >("QQmlListProperty<QQuickContext2D>", reinterpret_cast< QQmlListProperty<QQuickContext2D> *>(quintptr(-1))); metatype_id.storeRelease(newId); return newId; } }; | - |
| Switch to Source code | Preprocessed file |