30 QRhiTexture *
toTexture(
const QPlatformBackingStore *backingStore,
32 QRhiResourceUpdateBatch *resourceUpdates,
33 const QRegion &dirtyRegion,
34 QPlatformBackingStore::TextureFlags *flags)
const;
38 QRhiSwapChain *swapchain,
40 qreal sourceDevicePixelRatio,
41 const QRegion ®ion,
43 QPlatformTextureList *textures,
44 bool translucentBackground,
45 qreal sourceTransformFactor);
48 enum UpdateUniformOption {
49 NeedsRedBlueSwap = 1 << 0,
50 NeedsAlphaRotate = 1 << 1
52 Q_DECLARE_FLAGS(UpdateUniformOptions, UpdateUniformOption)
56 Q_DECLARE_FLAGS(UpdateQuadDataOptions, UpdateQuadDataOption)
59 QRhiTexture *toTexture(
const QImage &image,
61 QRhiResourceUpdateBatch *resourceUpdates,
62 const QRegion &dirtyRegion,
63 QPlatformBackingStore::TextureFlags *flags)
const;
65 mutable QRhi *m_rhi =
nullptr;
66 mutable std::unique_ptr<QRhiTexture> m_texture;
68 std::unique_ptr<QRhiBuffer> m_vbuf;
69 std::unique_ptr<QRhiSampler> m_samplerNearest;
70 std::unique_ptr<QRhiSampler> m_samplerLinear;
71 std::unique_ptr<QRhiGraphicsPipeline> m_psNoBlend;
72 std::unique_ptr<QRhiGraphicsPipeline> m_psBlend;
73 std::unique_ptr<QRhiGraphicsPipeline> m_psPremulBlend;
76 QRhiBuffer *ubuf =
nullptr;
78 QRhiShaderResourceBindings *srb =
nullptr;
79 QRhiShaderResourceBindings *srbExtra =
nullptr;
80 QRhiTexture *lastUsedTexture =
nullptr;
81 QRhiTexture *lastUsedTextureExtra =
nullptr;
82 QRhiSampler::Filter lastUsedFilter = QRhiSampler::None;
83 bool isValid()
const {
return ubuf && srb; }
93 lastUsedTexture =
nullptr;
94 lastUsedTextureExtra =
nullptr;
95 lastUsedFilter = QRhiSampler::None;
98 PerQuadData m_widgetQuadData;
99 QVarLengthArray<PerQuadData, 8> m_textureQuadData;
101 PerQuadData createPerQuadData(QRhiTexture *texture, QRhiTexture *textureExtra =
nullptr);
102 void updatePerQuadData(PerQuadData *d, QRhiTexture *texture, QRhiTexture *textureExtra =
nullptr,
103 UpdateQuadDataOptions options = {});
104 void updateUniforms(PerQuadData *d, QRhiResourceUpdateBatch *resourceUpdates,
105 const QMatrix4x4 &target,
const QMatrix3x3 &source,
106 UpdateUniformOptions options = {});
QPlatformBackingStore::FlushResult flush(QPlatformBackingStore *backingStore, QRhi *rhi, QRhiSwapChain *swapchain, QWindow *window, qreal sourceDevicePixelRatio, const QRegion ®ion, const QPoint &offset, QPlatformTextureList *textures, bool translucentBackground, qreal sourceTransformFactor)
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
static bool prepareDrawForRenderToTextureWidget(const QPlatformTextureList *textures, int idx, QWindow *window, const QRect &deviceWindowRect, const QPoint &offset, bool invertTargetY, bool invertSource, QMatrix4x4 *target, QMatrix3x3 *source)