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.

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>
(cherry picked from commit 3cc1a32f97d2d3fe4a4c4eb83b46bdeb79cd64c3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Tor Arne Vestbø 2021-11-17 13:37:08 +01:00 committed by Qt Cherry-pick Bot
parent cc021ccf91
commit 1de292d473

View File

@ -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