aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgcontext_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/scenegraph/qsgcontext_p.h')
-rw-r--r--src/quick/scenegraph/qsgcontext_p.h28
1 files changed, 20 insertions, 8 deletions
diff --git a/src/quick/scenegraph/qsgcontext_p.h b/src/quick/scenegraph/qsgcontext_p.h
index 2fef0ff1e8..899278843e 100644
--- a/src/quick/scenegraph/qsgcontext_p.h
+++ b/src/quick/scenegraph/qsgcontext_p.h
@@ -66,11 +66,10 @@
QT_BEGIN_NAMESPACE
class QSGContextPrivate;
-class QSGRectangleNode;
-class QSGImageNode;
+class QSGInternalRectangleNode;
+class QSGInternalImageNode;
class QSGPainterNode;
class QSGGlyphNode;
-class QSGNinePatchNode;
class QSGRenderer;
class QSGDistanceFieldGlyphCache;
class QQuickWindow;
@@ -85,6 +84,10 @@ class QQuickPaintedItem;
class QSGRendererInterface;
class QSGShaderEffectNode;
class QSGGuiThreadShaderEffectManager;
+class QSGRectangleNode;
+class QSGImageNode;
+class QSGNinePatchNode;
+class QSGSpriteNode;
Q_DECLARE_LOGGING_CATEGORY(QSG_LOG_TIME_RENDERLOOP)
Q_DECLARE_LOGGING_CATEGORY(QSG_LOG_TIME_COMPILATION)
@@ -122,6 +125,10 @@ public:
virtual QSGTexture *createTexture(const QImage &image, uint flags = CreateTexture_Alpha) const = 0;
virtual QSGRenderer *createRenderer() = 0;
+ virtual void setAttachToGraphicsContext(bool attach) { Q_UNUSED(attach); }
+
+ virtual int maxTextureSize() const = 0;
+
void registerFontengineForCleanup(QFontEngine *engine);
Q_SIGNALS:
@@ -132,7 +139,8 @@ public Q_SLOTS:
void textureFactoryDestroyed(QObject *o);
protected:
- QSGContext *m_sg;
+ // Hold m_sg with QPointer in the rare case it gets deleted before us.
+ QPointer<QSGContext> m_sg;
QMutex m_mutex;
QHash<QQuickTextureFactory *, QSGTexture *> m_textures;
@@ -161,16 +169,16 @@ public:
virtual void renderContextInvalidated(QSGRenderContext *renderContext);
virtual QSGRenderContext *createRenderContext() = 0;
- QSGRectangleNode *createRectangleNode(const QRectF &rect, const QColor &c);
- virtual QSGRectangleNode *createRectangleNode() = 0;
- virtual QSGImageNode *createImageNode() = 0;
+ QSGInternalRectangleNode *createInternalRectangleNode(const QRectF &rect, const QColor &c);
+ virtual QSGInternalRectangleNode *createInternalRectangleNode() = 0;
+ virtual QSGInternalImageNode *createInternalImageNode() = 0;
virtual QSGPainterNode *createPainterNode(QQuickPaintedItem *item) = 0;
virtual QSGGlyphNode *createGlyphNode(QSGRenderContext *rc, bool preferNativeGlyphNode) = 0;
- virtual QSGNinePatchNode *createNinePatchNode() = 0;
virtual QSGLayer *createLayer(QSGRenderContext *renderContext) = 0;
virtual QSGGuiThreadShaderEffectManager *createGuiThreadShaderEffectManager();
virtual QSGShaderEffectNode *createShaderEffectNode(QSGRenderContext *renderContext,
QSGGuiThreadShaderEffectManager *mgr);
+ virtual QSGSpriteNode *createSpriteNode() = 0;
virtual QAnimationDriver *createAnimationDriver(QObject *parent);
virtual QSize minimumFBOSize() const;
@@ -178,6 +186,10 @@ public:
virtual QSGRendererInterface *rendererInterface(QSGRenderContext *renderContext);
+ virtual QSGRectangleNode *createRectangleNode() = 0;
+ virtual QSGImageNode *createImageNode() = 0;
+ virtual QSGNinePatchNode *createNinePatchNode() = 0;
+
static QSGContext *createDefaultContext();
static QQuickTextureFactory *createTextureFactoryFromImage(const QImage &image);
static QSGRenderLoop *createWindowManager();