summaryrefslogtreecommitdiffstats
path: root/src/gui/painting
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-11-17 13:37:08 +0100
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2021-11-18 23:41:02 +0100
commit3cc1a32f97d2d3fe4a4c4eb83b46bdeb79cd64c3 (patch)
treefc2c4a91f66a1591040663acfd77adca011a21f5 /src/gui/painting
parent71f75bf6c5140920227f6019716c05fe7bfb0b20 (diff)
Clarify validity of image returned from QPlatformBackingStore::toImage()
The backingstore may reconfigure the internal data, so clients should not assume that the image is valid beyond any new operations on the backingstore. Pick-to: 6.2 Change-Id: I137ad4f2adb45ec8bb78a989fbb5bac1e72965ce Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io> Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Diffstat (limited to 'src/gui/painting')
-rw-r--r--src/gui/painting/qplatformbackingstore.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/painting/qplatformbackingstore.cpp b/src/gui/painting/qplatformbackingstore.cpp
index bf7dc55644..3bd9746441 100644
--- a/src/gui/painting/qplatformbackingstore.cpp
+++ b/src/gui/painting/qplatformbackingstore.cpp
@@ -217,12 +217,17 @@ void QPlatformBackingStore::composeAndFlush(QWindow *window, const QRegion &regi
If QPlatformIntegration::RasterGLSurface is supported, either this function or
toTexture() must be implemented.
+ The returned image is only valid until the next operation (resize, paint, scroll,
+ or flush) on the backingstore. The caller must not store the return value between
+ calls, but instead call this function before each use, or make an explicit copy.
+
\sa toTexture()
*/
QImage QPlatformBackingStore::toImage() const
{
return QImage();
}
+
#ifndef QT_NO_OPENGL
/*!
May be reimplemented in subclasses to return the content of the