24 QQuickRhiItemRenderer();
25 virtual ~QQuickRhiItemRenderer();
28 virtual void initialize(QRhiCommandBuffer *cb) = 0;
29 virtual void synchronize(QQuickRhiItem *item) = 0;
30 virtual void render(QRhiCommandBuffer *cb) = 0;
35 QRhiTexture *colorTexture()
const;
36 QRhiRenderBuffer *msaaColorBuffer()
const;
37 QRhiTexture *resolveTexture()
const;
38 QRhiRenderBuffer *depthStencilBuffer()
const;
39 QRhiRenderTarget *renderTarget()
const;
42 QQuickRhiItemNode *node;
43 friend class QQuickRhiItem;
44 friend class QQuickRhiItemNode;
46 Q_DISABLE_COPY_MOVE(QQuickRhiItemRenderer)
52 Q_DECLARE_PRIVATE(QQuickRhiItem)
54 Q_PROPERTY(
int sampleCount READ sampleCount WRITE setSampleCount NOTIFY sampleCountChanged FINAL)
55 Q_PROPERTY(TextureFormat colorBufferFormat READ colorBufferFormat WRITE setColorBufferFormat NOTIFY colorBufferFormatChanged FINAL)
56 Q_PROPERTY(
bool mirrorVertically READ isMirrorVerticallyEnabled WRITE setMirrorVertically NOTIFY mirrorVerticallyChanged FINAL)
57 Q_PROPERTY(
bool alphaBlending READ alphaBlending WRITE setAlphaBlending NOTIFY alphaBlendingChanged FINAL)
58 Q_PROPERTY(
int fixedColorBufferWidth READ fixedColorBufferWidth WRITE setFixedColorBufferWidth NOTIFY fixedColorBufferWidthChanged FINAL)
59 Q_PROPERTY(
int fixedColorBufferHeight READ fixedColorBufferHeight WRITE setFixedColorBufferHeight NOTIFY fixedColorBufferHeightChanged FINAL)
60 Q_PROPERTY(QSize effectiveColorBufferSize READ effectiveColorBufferSize NOTIFY effectiveColorBufferSizeChanged FINAL)
63 enum class TextureFormat {
71 explicit QQuickRhiItem(QQuickItem *parent =
nullptr);
72 ~QQuickRhiItem() override;
74 int sampleCount()
const;
75 void setSampleCount(
int samples);
77 TextureFormat colorBufferFormat()
const;
78 void setColorBufferFormat(TextureFormat format);
80 bool isMirrorVerticallyEnabled()
const;
81 void setMirrorVertically(
bool enable);
83 bool alphaBlending()
const;
84 void setAlphaBlending(
bool enable);
86 int fixedColorBufferWidth()
const;
87 void setFixedColorBufferWidth(
int width);
88 int fixedColorBufferHeight()
const;
89 void setFixedColorBufferHeight(
int height);
91 QSize effectiveColorBufferSize()
const;
93 bool isTextureProvider()
const override;
94 QSGTextureProvider *textureProvider()
const override;
97 void sampleCountChanged();
98 void colorBufferFormatChanged();
99 void autoRenderTargetChanged();
100 void mirrorVerticallyChanged();
101 void alphaBlendingChanged();
102 void fixedColorBufferWidthChanged();
103 void fixedColorBufferHeightChanged();
104 void effectiveColorBufferSizeChanged();
107 explicit QQuickRhiItem(QQuickRhiItemPrivate &dd, QQuickItem *parent =
nullptr);
109 virtual QQuickRhiItemRenderer *createRenderer() = 0;
111 bool isAutoRenderTargetEnabled()
const;
112 void setAutoRenderTarget(
bool enabled);
114 QSGNode *updatePaintNode(QSGNode *, UpdatePaintNodeData *) override;
115 bool event(QEvent *) override;
116 void geometryChange(
const QRectF &newGeometry,
const QRectF &oldGeometry) override;
117 void releaseResources() override;
120 void invalidateSceneGraph();
122 friend class QQuickRhiItemNode;
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h