6#include <QtCore/QVarLengthArray>
7#include <QtCore/QElapsedTimer>
8#include <QtCore/QtMath>
10#include <QtGui/QGuiApplication>
11#include <QtGui/QScreen>
12#include <QtGui/QSurface>
13#include <QtGui/QWindow>
16#include <private/qqmlglobal_p.h>
17#include <private/qquickprofiler_p.h>
18#include <private/qsgtexture_p.h>
19#include <private/qsgcompressedtexture_p.h>
38 QSize paddedSize(((
size.width() + 15) / 16) * 16, ((
size.height() + 15) / 16) * 16);
41 if (
rect.width() > 0 &&
rect.height() > 0) {
64 qCDebug(QSG_LOG_TEXTUREIO,
"Created compressed atlas of size %dx%d for format 0x%x (rhi: %d)",
84 qCDebug(QSG_LOG_TEXTUREIO,
"compressed atlastexture upload, size %dx%d format 0x%x",
85 t->textureSize().width(),
t->textureSize().height(), m_format);
98 m_texture_coords_rect =
QRectF((
r.x() + .5) /
w,
100 (
size.width() - 1.) /
w,
101 (
size.height() - 1.) /
h);
106 delete m_nonatlas_texture;
116 if (m_nonatlas_texture) {
119 return m_nonatlas_texture;
134 return m_nonatlas_texture;
141#include "moc_qsgcompressedatlastexture_p.cpp"
qsizetype size() const noexcept
Returns the number of bytes in this byte array.
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
\inmodule QtCore\reentrant
\inmodule QtCore\reentrant
void uploadTexture(QRhiTexture *tex, const QRhiTextureUploadDescription &desc)
Enqueues uploading the image data for one or more mip levels in one or more layers of the texture tex...
void setDestinationTopLeft(const QPoint &p)
Sets the destination top-left position p.
void setSourceSize(const QSize &size)
Sets the source size in pixels.
virtual bool create()=0
Creates the corresponding native graphics resources.
QRhiTexture * newTexture(QRhiTexture::Format format, const QSize &pixelSize, int sampleCount=1, QRhiTexture::Flags flags={})
QRect allocate(const QSize &size)
bool generateTexture() override
Texture * create(QByteArrayView data, const QSize &size)
void enqueueTextureUpload(QSGRhiAtlasTexture::TextureBase *t, QRhiResourceUpdateBatch *rcub) override
Atlas(QSGDefaultRenderContext *rc, const QSize &size, uint format)
bool hasAlphaChannel() const override
Returns true if the texture data contains an alpha channel.
QSGTexture * removedFromAtlas(QRhiResourceUpdateBatch *) const override
This function returns a copy of the current texture which is removed from its atlas.
Texture(Atlas *atlas, const QRect &textureRect, QByteArrayView data, const QSize &size)
static FormatInfo formatInfo(quint32 glTextureFormat)
static bool formatIsOpaque(quint32 glTextureFormat)
QSGAreaAllocator m_allocator
QVector< TextureBase * > m_pending_uploads
QRect atlasSubRect() const
QSGTexture::Filtering mipmapFiltering() const
Returns whether mipmapping should be used when sampling from this texture.
void setFiltering(Filtering filter)
Sets the sampling mode to filter.
QSGTexture::Filtering filtering() const
Returns the sampling mode to be used for this texture.
void setMipmapFiltering(Filtering filter)
Sets the mipmap sampling mode to filter.
constexpr int height() const noexcept
Returns the height.
constexpr int width() const noexcept
Returns the width.
void setDataLength(int length, int level=0, int face=0)
void setSize(const QSize &size)
void setGLInternalFormat(quint32 format)
void setDataOffset(int offset, int level=0, int face=0)
void setData(const QByteArray &data)
Combined button and popup list for selecting options.
#define qCDebug(category,...)
GLfloat GLfloat GLfloat w
[0]
GLenum GLuint GLintptr GLsizeiptr size
[1]
GLint GLsizei GLsizei GLenum GLenum GLsizei void * data
GLint GLsizei GLsizei GLenum format
GLfloat GLfloat GLfloat GLfloat h
QVideoFrameFormat::PixelFormat fmt