From cac1abb0126d50dc9bbb4467e00df7b31a685a2b Mon Sep 17 00:00:00 2001 From: Laszlo Agocs Date: Wed, 15 Mar 2023 12:02:36 +0100 Subject: [PATCH] QOpenGLTexture: Add a doc note about the unavoidable conversion As requested by users. Explicitly stated in the docs that the QImage is going to be converted, to avoid surprises. Pick-to: 6.5 6.2 5.15 Fixes: QTBUG-105364 Change-Id: Ia6a8930bcee8bd3cdbef016083599bd435b37a09 Reviewed-by: Kristoffer Skau Reviewed-by: Andy Nichols --- src/opengl/qopengltexture.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/opengl/qopengltexture.cpp b/src/opengl/qopengltexture.cpp index 6700f0e383..f7053be6dd 100644 --- a/src/opengl/qopengltexture.cpp +++ b/src/opengl/qopengltexture.cpp @@ -2456,6 +2456,9 @@ QOpenGLTexture::QOpenGLTexture(Target target) This does create the underlying OpenGL texture object. Therefore, construction using this constructor does require a valid current OpenGL context. + + \note \a image is automatically converted to QImage::Format_RGBA8888 which + may have performance implications for large images with a different format. */ QOpenGLTexture::QOpenGLTexture(const QImage& image, MipMapGeneration genMipMaps) : QOpenGLTexture(QOpenGLTexture::Target2D) @@ -3610,6 +3613,9 @@ void QOpenGLTexture::setData(int xOffset, int yOffset, int zOffset, The pixel data is contained in \a image. Mipmaps are generated by default. Set \a genMipMaps to \l DontGenerateMipMaps to turn off mipmap generation. + \note \a image is automatically converted to QImage::Format_RGBA8888 which + may have performance implications for large images with a different format. + \overload */ void QOpenGLTexture::setData(const QImage& image, MipMapGeneration genMipMaps)