6#include <QtGui/QGuiApplication>
8#include <QtQuick/private/qsgbatchrenderer_p.h>
9#include <QtQuick/private/qsgrenderer_p.h>
10#include <QtQuick/private/qsgrhiatlastexture_p.h>
11#include <QtQuick/private/qsgrhidistancefieldglyphcache_p.h>
12#include <QtQuick/private/qsgmaterialshader_p.h>
14#include <QtQuick/private/qsgcompressedtexture_p.h>
16#include <QtQuick/qsgrendererinterface.h>
17#include <QtQuick/qquickgraphicsconfiguration.h>
26 , m_currentFrameCommandBuffer(
nullptr)
27 , m_currentFrameRenderPass(
nullptr)
28 , m_useDepthBufferFor2D(true)
29 , m_glyphCacheResourceUpdates(
nullptr)
44 qFatal(
"QSGDefaultRenderContext: Invalid parameters passed to initialize()");
65 if (!(*it)->isActive()) {
77 if (
it.value() == 0) {
78 it.key()->clearGlyphCache(
this);
79 if (!
it.key()->ref.deref())
128 it.key()->clearGlyphCache(
this);
129 if (!
it.key()->ref.deref())
163 void *callbackUserData)
165 renderer->setRenderTarget(renderTarget);
166 renderer->setRenderPassRecordingCallbacks(mainPassRecordingStart, mainPassRecordingEnd, callbackUserData);
203 texture->setHasAlphaChannel(
false);
240 .
arg(renderTypeQuality);
252 it.value()->processPendingGlyphs();
253 it.value()->update();
303#include "moc_qsgdefaultrendercontext_p.cpp"
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
static QByteArray number(int, int base=10)
Returns a byte-array representing the whole number n as text.
virtual FaceId faceId() const
QString styleName() const
Weight weight() const
Returns the weight of the font, using the same scale as the \l{QFont::Weight} enumeration.
Style style() const
Returns the style of the font.
iterator begin()
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash.
const_iterator constEnd() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the ...
const_iterator constBegin() const noexcept
Returns a const \l{STL-style iterators}{STL-style iterator} pointing to the first item in the hash.
iterator erase(const_iterator it)
T value(const Key &key) const noexcept
iterator end() noexcept
Returns an \l{STL-style iterators}{STL-style iterator} pointing to the imaginary item after the last ...
void clear() noexcept(std::is_nothrow_destructible< Node >::value)
Removes all items from the hash and frees up all memory used by it.
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
void deleteLater()
\threadsafe
QQuickGraphicsConfiguration controls lower level graphics settings for the QQuickWindow.
static QRawFontPrivate * get(const QRawFont &font)
The QRawFont class provides access to a single physical instance of a font.
int resourceLimit(ResourceLimit limit) const
QRhiResourceUpdateBatch * nextResourceUpdateBatch()
The QSGContext holds the scene graph entry points for one QML engine.
virtual void renderContextInitialized(QSGRenderContext *renderContext)
virtual void renderContextInvalidated(QSGRenderContext *renderContext)
static QString fontKey(const QRawFont &font, int renderTypeQuality)
void deferredReleaseGlyphCacheTexture(QRhiTexture *texture)
QRhiResourceUpdateBatch * maybeGlyphCacheResourceUpdates()
void prepareSync(qreal devicePixelRatio, QRhiCommandBuffer *cb, const QQuickGraphicsConfiguration &config) override
void beginNextFrame(QSGRenderer *renderer, const QSGRenderTarget &renderTarget, RenderPassCallback mainPassRecordingStart, RenderPassCallback mainPassRecordingEnd, void *callbackUserData) override
virtual void initializeRhiShader(QSGMaterialShader *shader, QShader::Variant shaderVariant)
void initialize(const QSGRenderContext::InitParams *params) override
Initializes the scene graph render context with the GL context context.
qreal m_currentDevicePixelRatio
QSGRenderer * createRenderer(QSGRendererInterface::RenderMode renderMode=QSGRendererInterface::RenderMode2D) override
void invalidateGlyphCaches() override
QSGTexture * compressedTextureForFactory(const QSGCompressedTextureFactory *factory) const override
Return the texture corresponding to a texture factory.
QSGTexture * createTexture(const QImage &image, uint flags) const override
QSGDefaultRenderContext(QSGContext *context)
QRhiResourceUpdateBatch * m_glyphCacheResourceUpdates
QSGDistanceFieldGlyphCache * distanceFieldGlyphCache(const QRawFont &font, int renderTypeQuality) override
Factory function for scene graph backends of the distance-field glyph cache.
QSet< QRhiTexture * > m_pendingGlyphCacheTextures
QRhiRenderPassDescriptor * m_currentFrameRenderPass
void preprocess() override
Do necessary preprocessing before the frame.
void invalidate() override
bool m_useDepthBufferFor2D
QSGRhiAtlasTexture::Manager * m_rhiAtlasManager
void endNextFrame(QSGRenderer *renderer) override
static const int INIT_PARAMS_MAGIC
void resetGlyphCacheResources()
void renderNextFrame(QSGRenderer *renderer) override
QRhiResourceUpdateBatch * glyphCacheResourceUpdates()
QRhiCommandBuffer * m_currentFrameCommandBuffer
static QSGMaterialShaderPrivate * get(QSGMaterialShader *s)
void prepare(QShader::Variant vertexShaderVariant)
The QSGMaterialShader class represents a graphics API independent shader program.
void setImage(const QImage &image)
QHash< QString, QSGDistanceFieldGlyphCache * > m_glyphCaches
QHash< QObject *, QSGTexture * > m_textures
QHash< QFontEngine *, int > m_fontEnginesToClean
QPointer< QSGContext > m_sg
void(*)(void *) RenderPassCallback
QSet< QSGTexture * > m_texturesToDelete
QRhiRenderPassDescriptor * rpDesc
RenderMode
\value RenderMode2D Normal 2D rendering \value RenderMode2DNoDepthBuffer Normal 2D rendering with dep...
The renderer class is the abstract baseclass used for rendering the QML scene graph.
QSGTexture * create(const QImage &image, bool hasAlphaChannel)
iterator insert(const T &value)
Variant
Describes what kind of shader code an entry contains.
\macro QT_RESTRICTED_CAST_FROM_ASCII
static QString fromLatin1(QByteArrayView ba)
This is an overloaded member function, provided for convenience. It differs from the above function o...
static QString fromUtf8(QByteArrayView utf8)
This is an overloaded member function, provided for convenience. It differs from the above function o...
QString arg(qlonglong a, int fieldwidth=0, int base=10, QChar fillChar=u' ') const
static QThread * currentThread()
qDeleteAll(list.begin(), list.end())
QCache< int, Employee > cache
[0]
QSet< QString >::iterator it
Combined button and popup list for selecting options.
GLfloat GLfloat GLfloat alpha
static QString keyName(const QString &rKey)
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
QItemEditorFactory * factory
QSvgRenderer * renderer
[0]
QSize initialSurfacePixelSize