diff options
author | Eirik Aavitsland <[email protected]> | 2018-07-03 12:41:34 +0200 |
---|---|---|
committer | Eirik Aavitsland <[email protected]> | 2018-08-09 07:44:38 +0000 |
commit | abba0b6e2c00df2df39ad16a20eba3870e68f252 (patch) | |
tree | 1bac2923c62b4975bb9a9224caf90a39f09e4456 /src/quick/scenegraph/util/qsgatlastexture.cpp | |
parent | 1c731335dcd90fd817180a623e489edcc31f5151 (diff) |
Compressed textures: Replace file decoding code with QtGui functionality
The functionality for reading and decoding texture files (currently
pkm and ktx formats) is now available in QtGui util API. Utilize that
instead of keeping equivalent code here.
Task-number: QTBUG-67026
Change-Id: Icb7c348eaa51cd15e41031508ef54164fc876c9e
Reviewed-by: Laszlo Agocs <[email protected]>
Diffstat (limited to 'src/quick/scenegraph/util/qsgatlastexture.cpp')
-rw-r--r-- | src/quick/scenegraph/util/qsgatlastexture.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/quick/scenegraph/util/qsgatlastexture.cpp b/src/quick/scenegraph/util/qsgatlastexture.cpp index 97203db867..66c6d3a882 100644 --- a/src/quick/scenegraph/util/qsgatlastexture.cpp +++ b/src/quick/scenegraph/util/qsgatlastexture.cpp @@ -143,11 +143,11 @@ QSGTexture *Manager::create(const QImage &image, bool hasAlphaChannel) QSGTexture *Manager::create(const QSGCompressedTextureFactory *factory) { QSGTexture *t = nullptr; - if (!qsgEnableCompressedAtlas() || !factory->m_textureData || !factory->m_textureData->isValid()) + if (!qsgEnableCompressedAtlas() || !factory->m_textureData.isValid()) return t; // TODO: further abstract the atlas and remove this restriction - unsigned int format = factory->m_textureData->format; + unsigned int format = factory->m_textureData.glInternalFormat(); switch (format) { case QOpenGLTexture::RGB8_ETC1: case QOpenGLTexture::RGB8_ETC2: @@ -158,15 +158,15 @@ QSGTexture *Manager::create(const QSGCompressedTextureFactory *factory) return t; } - QSize size = factory->m_textureData->size; + QSize size = factory->m_textureData.size(); if (size.width() < m_atlas_size_limit && size.height() < m_atlas_size_limit) { QHash<unsigned int, QSGCompressedAtlasTexture::Atlas*>::iterator i = m_atlases.find(format); if (i == m_atlases.end()) i = m_atlases.insert(format, new QSGCompressedAtlasTexture::Atlas(m_atlas_size, format)); // must be multiple of 4 QSize paddedSize(((size.width() + 3) / 4) * 4, ((size.height() + 3) / 4) * 4); - QByteArray data = factory->m_textureData->data; - t = i.value()->create(data, factory->m_textureData->sizeInBytes(), factory->m_textureData->dataOffset, size, paddedSize); + QByteArray data = factory->m_textureData.data(); + t = i.value()->create(data, factory->m_textureData.dataLength(), factory->m_textureData.dataOffset(), size, paddedSize); } return t; } |