diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2021-11-02 13:55:06 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2021-11-02 22:21:06 +0100 |
commit | ace53d282d610dc2a4e96fbe1b84f5b39e93dc77 (patch) | |
tree | 54d34048ced3b24e5b2f628cfd05b81664bad6a2 /src/gui/rhi | |
parent | 711c55b63226c30532b39ec8d5191330512eb2e0 (diff) |
rhi: Extend docs regarding QImage and data lifetime
Change-Id: I45e0e53af7e6ba084f6305c3097c6a0ff65fb458
Pick-to: 6.2
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/gui/rhi')
-rw-r--r-- | src/gui/rhi/qrhi.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/gui/rhi/qrhi.cpp b/src/gui/rhi/qrhi.cpp index e6bc19acde..efa3c1893d 100644 --- a/src/gui/rhi/qrhi.cpp +++ b/src/gui/rhi/qrhi.cpp @@ -1655,6 +1655,17 @@ QRhiTextureRenderTargetDescription::QRhiTextureRenderTargetDescription(const QRh QRhi::ImageDataStride is reported as \l{QRhi::isFeatureSupported()}{supported}. In practice this can be expected to be supported everywhere except for OpenGL ES 2.0. + + \note When a QImage is given, the stride returned from + QImage::bytesPerLine() is taken into account automatically. + + \warning When a QImage is given and the QImage does not own the underlying + pixel data, it is up to the caller to ensure that the associated data stays + valid until the end of the frame. (just submitting the resource update batch + is not sufficient, the data must stay valid until QRhi::endFrame() is called + in order to be portable across all backends) If this cannot be ensured, the + caller is strongly encouraged to call QImage::detach() on the image before + passing it to uploadTexture(). */ /*! |