31 QRhiTexture *
toTexture(
const QPlatformBackingStore *backingStore,
33 QRhiResourceUpdateBatch *resourceUpdates,
34 const QRegion &dirtyRegion,
35 QPlatformBackingStore::TextureFlags *flags)
const;
39 QRhiSwapChain *swapchain,
41 qreal sourceDevicePixelRatio,
42 const QRegion ®ion,
44 QPlatformTextureList *textures,
45 bool translucentBackground,
46 qreal sourceTransformFactor);
49 enum UpdateUniformOption {
50 NeedsRedBlueSwap = 1 << 0,
51 NeedsAlphaRotate = 1 << 1
53 Q_DECLARE_FLAGS(UpdateUniformOptions, UpdateUniformOption)
57 Q_DECLARE_FLAGS(UpdateQuadDataOptions, UpdateQuadDataOption)
60 QRhiTexture *toTexture(
const QImage &image,
62 QRhiResourceUpdateBatch *resourceUpdates,
63 const QRegion &dirtyRegion,
64 QPlatformBackingStore::TextureFlags *flags)
const;
66 mutable QRhi *m_rhi =
nullptr;
67 mutable std::unique_ptr<QRhiTexture> m_texture;
69 std::unique_ptr<QRhiBuffer> m_vbuf;
70 std::unique_ptr<QRhiSampler> m_samplerNearest;
71 std::unique_ptr<QRhiSampler> m_samplerLinear;
72 std::unique_ptr<QRhiGraphicsPipeline> m_psNoBlend;
73 std::unique_ptr<QRhiGraphicsPipeline> m_psBlend;
74 std::unique_ptr<QRhiGraphicsPipeline> m_psPremulBlend;
77 QRhiBuffer *ubuf =
nullptr;
79 QRhiShaderResourceBindings *srb =
nullptr;
80 QRhiShaderResourceBindings *srbExtra =
nullptr;
81 QRhiTexture *lastUsedTexture =
nullptr;
82 QRhiTexture *lastUsedTextureExtra =
nullptr;
83 QRhiSampler::Filter lastUsedFilter = QRhiSampler::None;
84 bool isValid()
const {
return ubuf && srb; }
94 lastUsedTexture =
nullptr;
95 lastUsedTextureExtra =
nullptr;
96 lastUsedFilter = QRhiSampler::None;
99 PerQuadData m_widgetQuadData;
100 QVarLengthArray<PerQuadData, 8> m_textureQuadData;
102 PerQuadData createPerQuadData(QRhiTexture *texture, QRhiTexture *textureExtra =
nullptr);
103 void updatePerQuadData(PerQuadData *d, QRhiTexture *texture, QRhiTexture *textureExtra =
nullptr,
104 UpdateQuadDataOptions options = {});
105 void updateUniforms(PerQuadData *d, QRhiResourceUpdateBatch *resourceUpdates,
106 const QMatrix4x4 &target,
const QMatrix3x3 &source,
107 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)