Add QRhiTextureSubresourceUploadDescription QByteArray constructor
Change-Id: I1be4ef1a15c4049f19d0401d6a1a62b3117180a0 Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
This commit is contained in:
parent
162a859045
commit
a0aafefd00
@ -1609,6 +1609,16 @@ QRhiTextureSubresourceUploadDescription::QRhiTextureSubresourceUploadDescription
|
||||
{
|
||||
}
|
||||
|
||||
/*!
|
||||
Constructs a mip level description with the image data specified by \a data. This is suitable
|
||||
for floating point and compressed formats as well.
|
||||
*/
|
||||
QRhiTextureSubresourceUploadDescription::QRhiTextureSubresourceUploadDescription(
|
||||
const QByteArray &data)
|
||||
: m_data(data)
|
||||
{
|
||||
}
|
||||
|
||||
/*!
|
||||
\class QRhiTextureUploadEntry
|
||||
\internal
|
||||
@ -5002,7 +5012,8 @@ void QRhiResourceUpdateBatch::uploadTexture(QRhiTexture *tex, const QRhiTextureU
|
||||
*/
|
||||
void QRhiResourceUpdateBatch::uploadTexture(QRhiTexture *tex, const QImage &image)
|
||||
{
|
||||
uploadTexture(tex, QRhiTextureUploadEntry(0, 0, image));
|
||||
uploadTexture(tex,
|
||||
QRhiTextureUploadEntry(0, 0, QRhiTextureSubresourceUploadDescription(image)));
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -505,8 +505,9 @@ class Q_GUI_EXPORT QRhiTextureSubresourceUploadDescription
|
||||
{
|
||||
public:
|
||||
QRhiTextureSubresourceUploadDescription() = default;
|
||||
QRhiTextureSubresourceUploadDescription(const QImage &image);
|
||||
explicit QRhiTextureSubresourceUploadDescription(const QImage &image);
|
||||
QRhiTextureSubresourceUploadDescription(const void *data, int size);
|
||||
explicit QRhiTextureSubresourceUploadDescription(const QByteArray &data);
|
||||
|
||||
QImage image() const { return m_image; }
|
||||
void setImage(const QImage &image) { m_image = image; }
|
||||
|
Loading…
Reference in New Issue
Block a user