diff options
author | Jonas Karlsson <jonas.karlsson@qt.io> | 2020-12-22 13:52:29 +0100 |
---|---|---|
committer | Jonas Karlsson <jonas.karlsson@qt.io> | 2020-12-29 09:59:06 +0100 |
commit | 162a859045ec455321909af6aa03b99d9cbbda6e (patch) | |
tree | 6b691d1964590317e3979674094594f952a0b644 /src/gui/util/qtexturefiledata_p.h | |
parent | 89b2b60e6374c62d97b739b3351753e552cd16bb (diff) |
Add getDataView() method to QTextureFileData
This method will return a QByteArrayView of the data range corresponding
to the level. This avoids a leaky abstraction by moving the needed data
pointer arithmetic from the caller to the method. It will also make it
easier adding cubemap support in the future.
Change-Id: I2415bd88365d8d69ba14aefc77f5f1117f9e0033
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/gui/util/qtexturefiledata_p.h')
-rw-r--r-- | src/gui/util/qtexturefiledata_p.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/gui/util/qtexturefiledata_p.h b/src/gui/util/qtexturefiledata_p.h index fb732cd84c..3d75d46c94 100644 --- a/src/gui/util/qtexturefiledata_p.h +++ b/src/gui/util/qtexturefiledata_p.h @@ -84,6 +84,8 @@ public: int dataLength(int level = 0) const; void setDataLength(int length, int level = 0); + QByteArrayView getDataView(int level = 0) const; + int numLevels() const; void setNumLevels(int num); |