4#ifndef QSGRHIATLASTEXTURE_P_H
5#define QSGRHIATLASTEXTURE_P_H
18#include <QtCore/QSize>
19#include <QtQuick/private/qsgplaintexture_p.h>
20#include <QtQuick/private/qsgareaallocator_p.h>
21#include <QtGui/QSurface>
26class QSGDefaultRenderContext;
31class QSGCompressedTextureFactory;
53 QSGDefaultRenderContext *m_rc;
55 Atlas *m_atlas =
nullptr;
57 QHash<
unsigned int, QSGCompressedAtlasTexture::Atlas*> m_atlases;
60 int m_atlas_size_limit;
84 QSGDefaultRenderContext *
m_rc;
91 friend class TextureBasePrivate;
94 bool m_allocated =
false;
100 Atlas(QSGDefaultRenderContext *rc,
const QSize &size);
111 QRhiTexture::Format m_format;
112 int m_atlas_transient_image_threshold = 0;
114 uint m_debug_overlay : 1;
159 QRectF m_texture_coords_rect;
161 mutable QSGPlainTexture *m_nonatlas_texture =
nullptr;
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
QSGAreaAllocator m_allocator
QRhiTexture * texture() const
void commitTextureOperations(QRhiResourceUpdateBatch *resourceUpdates)
virtual void enqueueTextureUpload(TextureBase *t, QRhiResourceUpdateBatch *resourceUpdates)=0
QSGDefaultRenderContext * m_rc
void remove(TextureBase *t)
virtual bool generateTexture()=0
QVector< TextureBase * > m_pending_uploads
QSGDefaultRenderContext * renderContext() const
Texture * create(const QImage &image)
Atlas(QSGDefaultRenderContext *rc, const QSize &size)
bool generateTexture() override
void enqueueTextureUpload(TextureBase *t, QRhiResourceUpdateBatch *resourceUpdates) override
QRhiTexture::Format format() const
QSGTexture * create(const QSGCompressedTextureFactory *factory)
QSGTexture * create(const QImage &image, bool hasAlphaChannel)
qint64 comparisonKey() const override
Returns a key suitable for comparing textures.
QRect atlasSubRect() const
bool isAtlasTexture() const override
Returns whether this texture is part of an atlas or not.
QRhiTexture * rhiTexture() const override
void commitTextureOperations(QRhi *rhi, QRhiResourceUpdateBatch *resourceUpdates) override
Call this function to enqueue image upload operations to resourceUpdates, in case there are any pendi...
bool hasAlphaChannel() const override
Returns true if the texture data contains an alpha channel.
QRectF normalizedTextureSubRect() const override
Returns the rectangle inside textureSize() that this texture represents in normalized coordinates.
QRect atlasSubRectWithoutPadding() const
QSGTexture * removedFromAtlas(QRhiResourceUpdateBatch *resourceUpdates) const override
This function returns a copy of the current texture which is removed from its atlas.
QSize textureSize() const override
Returns the size of the texture in pixels.
QRect atlasSubRect() const
void setHasAlphaChannel(bool alpha)
const QImage & image() const
bool hasMipmaps() const override
Returns true if the texture data contains mipmap levels.
QT_BEGIN_NAMESPACE int qt_sg_envInt(const char *name, int defaultValue)
static QElapsedTimer qsg_renderer_timer
DEFINE_BOOL_CONFIG_OPTION(forceDiskCache, QML_FORCE_DISK_CACHE)