Absolute File Name: | /home/opencoverage/opencoverage/guest-scripts/qtdeclarative/src/qtdeclarative/src/quick/items/context2d/qquickcanvasitem_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 | class QQuickCanvasContext; | - |
8 | - | |
9 | class QQuickCanvasItemPrivate; | - |
10 | class QQuickPixmap; | - |
11 | - | |
12 | class QQuickCanvasPixmap : public QQmlRefCount | - |
13 | { | - |
14 | public: | - |
15 | QQuickCanvasPixmap(const QImage& image); | - |
16 | QQuickCanvasPixmap(QQuickPixmap *pixmap); | - |
17 | ~QQuickCanvasPixmap(); | - |
18 | - | |
19 | QImage image(); | - |
20 | - | |
21 | qreal width() const; | - |
22 | qreal height() const; | - |
23 | bool isValid() const; | - |
24 | QQuickPixmap *pixmap() const { return never executed: m_pixmap;return m_pixmap; never executed: }return m_pixmap; | 0 |
25 | - | |
26 | private: | - |
27 | QQuickPixmap *m_pixmap; | - |
28 | QImage m_image; | - |
29 | }; | - |
30 | - | |
31 | class QQuickCanvasItem : public QQuickItem | - |
32 | { | - |
33 | public: | - |
34 | #pragma GCC diagnostic push | - |
35 | - | |
36 | #pragma GCC diagnostic ignored "-Wsuggest-override" | - |
37 | 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: | - |
38 | #pragma GCC diagnostic ignored "-Wattributes" | - |
39 | __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); | - |
40 | #pragma GCC diagnostic pop | - |
41 | struct QPrivateSignal {}; | - |
42 | - | |
43 | - | |
44 | - | |
45 | - | |
46 | - | |
47 | - | |
48 | - | |
49 | - | |
50 | - | |
51 | - | |
52 | public: | - |
53 | enum RenderTarget { | - |
54 | Image, | - |
55 | FramebufferObject | - |
56 | }; | - |
57 | friend constexpr const QMetaObject *qt_getEnumMetaObject(RenderTarget) noexcept { return &staticMetaObject; } friend constexpr const char *qt_getEnumName(RenderTarget) noexcept { return "RenderTarget"; } | - |
58 | - | |
59 | enum RenderStrategy { | - |
60 | Immediate, | - |
61 | Threaded, | - |
62 | Cooperative | - |
63 | }; | - |
64 | friend constexpr const QMetaObject *qt_getEnumMetaObject(RenderStrategy) noexcept { return &staticMetaObject; } friend constexpr const char *qt_getEnumName(RenderStrategy) noexcept { return "RenderStrategy"; } | - |
65 | - | |
66 | QQuickCanvasItem(QQuickItem *parent = nullptr); | - |
67 | ~QQuickCanvasItem(); | - |
68 | - | |
69 | bool isAvailable() const; | - |
70 | - | |
71 | QString contextType() const; | - |
72 | void setContextType(const QString &contextType); | - |
73 | - | |
74 | QQmlV4Handle context() const; | - |
75 | - | |
76 | QSizeF canvasSize() const; | - |
77 | void setCanvasSize(const QSizeF &); | - |
78 | - | |
79 | QSize tileSize() const; | - |
80 | void setTileSize(const QSize &); | - |
81 | - | |
82 | QRectF canvasWindow() const; | - |
83 | void setCanvasWindow(const QRectF& rect); | - |
84 | - | |
85 | RenderTarget renderTarget() const; | - |
86 | void setRenderTarget(RenderTarget target); | - |
87 | - | |
88 | RenderStrategy renderStrategy() const; | - |
89 | void setRenderStrategy(RenderStrategy strategy); | - |
90 | - | |
91 | QQuickCanvasContext *rawContext() const; | - |
92 | - | |
93 | QImage toImage(const QRectF& rect = QRectF()) const; | - |
94 | - | |
95 | void getContext(QQmlV4Function *args); | - |
96 | - | |
97 | void requestAnimationFrame(QQmlV4Function *args); | - |
98 | void cancelRequestAnimationFrame(QQmlV4Function *args); | - |
99 | - | |
100 | void requestPaint(); | - |
101 | void markDirty(const QRectF& dirtyRect = QRectF()); | - |
102 | - | |
103 | bool save(const QString &filename) const; | - |
104 | QString toDataURL(const QString& type = QLatin1String("image/png")) const; | - |
105 | QQmlRefPointer<QQuickCanvasPixmap> loadedPixmap(const QUrl& url); | - |
106 | - | |
107 | bool isTextureProvider() const override; | - |
108 | QSGTextureProvider *textureProvider() const override; | - |
109 | - | |
110 | public : | - |
111 | void paint(const QRect ®ion); | - |
112 | void painted(); | - |
113 | void availableChanged(); | - |
114 | void contextTypeChanged(); | - |
115 | void contextChanged(); | - |
116 | void canvasSizeChanged(); | - |
117 | void tileSizeChanged(); | - |
118 | void canvasWindowChanged(); | - |
119 | void renderTargetChanged(); | - |
120 | void renderStrategyChanged(); | - |
121 | void imageLoaded(); | - |
122 | - | |
123 | public : | - |
124 | void loadImage(const QUrl& url); | - |
125 | void unloadImage(const QUrl& url); | - |
126 | bool isImageLoaded(const QUrl& url) const; | - |
127 | bool isImageLoading(const QUrl& url) const; | - |
128 | bool isImageError(const QUrl& url) const; | - |
129 | - | |
130 | private : | - |
131 | void sceneGraphInitialized(); | - |
132 | void checkAnimationCallbacks(); | - |
133 | void invalidateSceneGraph(); | - |
134 | void schedulePolish(); | - |
135 | - | |
136 | protected: | - |
137 | void componentComplete() override; | - |
138 | void itemChange(QQuickItem::ItemChange, const QQuickItem::ItemChangeData &) override; | - |
139 | void updatePolish() override; | - |
140 | QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override; | - |
141 | void geometryChanged(const QRectF &newGeometry, const QRectF &oldGeometry) override; | - |
142 | void releaseResources() override; | - |
143 | bool event(QEvent *event) override; | - |
144 | private: | - |
145 | inline QQuickCanvasItemPrivate* d_func() { return never executed: reinterpret_cast<QQuickCanvasItemPrivate *>(qGetPtrHelper(d_ptr));return reinterpret_cast<QQuickCanvasItemPrivate *>(qGetPtrHelper(d_ptr)); never executed: } inline const QQuickCanvasItemPrivate* d_func() const { returnreturn reinterpret_cast<QQuickCanvasItemPrivate *>(qGetPtrHelper(d_ptr)); never executed: reinterpret_cast<const QQuickCanvasItemPrivate *>(qGetPtrHelper(d_ptr));return reinterpret_cast<const QQuickCanvasItemPrivate *>(qGetPtrHelper(d_ptr)); never executed: } friend class QQuickCanvasItemPrivate;return reinterpret_cast<const QQuickCanvasItemPrivate *>(qGetPtrHelper(d_ptr)); | 0 |
146 | void delayedCreate(); | - |
147 | bool createContext(const QString &contextType); | - |
148 | void initializeContext(QQuickCanvasContext *context, const QVariantMap &args = QVariantMap()); | - |
149 | static QRect tiledRect(const QRectF &window, const QSize &tileSize); | - |
150 | bool isPaintConnected(); | - |
151 | }; | - |
152 | - | |
153 | class QQuickContext2DRenderThread : public QThread | - |
154 | { | - |
155 | public: | - |
156 | #pragma GCC diagnostic push | - |
157 | - | |
158 | #pragma GCC diagnostic ignored "-Wsuggest-override" | - |
159 | 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: | - |
160 | #pragma GCC diagnostic ignored "-Wattributes" | - |
161 | __attribute__((visibility("hidden"))) static void qt_static_metacall(QObject *, QMetaObject::Call, int, void **); | - |
162 | #pragma GCC diagnostic pop | - |
163 | struct QPrivateSignal {}; | - |
164 | public: | - |
165 | QQuickContext2DRenderThread(QQmlEngine *eng); | - |
166 | ~QQuickContext2DRenderThread(); | - |
167 | - | |
168 | static QQuickContext2DRenderThread *instance(QQmlEngine *engine); | - |
169 | - | |
170 | private: | - |
171 | QQmlEngine *m_engine; | - |
172 | QObject *m_eventLoopQuitHack; | - |
173 | static QHash<QQmlEngine *,QQuickContext2DRenderThread*> renderThreads; | - |
174 | static QMutex renderThreadsMutex; | - |
175 | }; | - |
176 | - | |
177 | - | |
178 | - | |
179 | template <> struct QMetaTypeId< QQuickCanvasItem * > { 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< QQuickCanvasItem * >("QQuickCanvasItem *", reinterpret_cast< QQuickCanvasItem * *>(quintptr(-1))); metatype_id.storeRelease(newId); return newId; } }; template <> struct QMetaTypeId< QQmlListProperty<QQuickCanvasItem> > { 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<QQuickCanvasItem> >("QQmlListProperty<QQuickCanvasItem>", reinterpret_cast< QQmlListProperty<QQuickCanvasItem> *>(quintptr(-1))); metatype_id.storeRelease(newId); return newId; } }; | - |
Switch to Source code | Preprocessed file |