4#include <QtQuick/private/qsgcontext_p.h>
5#include <QtQuick/private/qsgtexture_p.h>
6#include <QtQuick/private/qsgrenderer_p.h>
7#include <QtQuick/private/qquickpixmap_p.h>
8#include <QtQuick/private/qsgadaptationlayer_p.h>
9#include <QtQuick/private/qsginternaltextnode_p.h>
11#include <QGuiApplication>
13#include <QQuickWindow>
15#include <private/qqmlglobal_p.h>
17#include <QtQuick/private/qsgtexture_p.h>
18#include <QtGui/private/qguiapplication_p.h>
19#include <QtCore/private/qabstractanimation_p.h>
21#include <private/qobject_p.h>
80 qCDebug(QSG_LOG_INFO,
"Using %s",
bool(use) ?
"fixed animation steps" :
"sg animation driver");
98 m_vsync = 1000.0f / float(refreshRate);
140 qCDebug(QSG_LOG_INFO,
"Animation Driver: using vsync: %.2f ms",
m_vsync);
142 qCDebug(QSG_LOG_INFO,
"Animation Driver: using walltime");
190 qCDebug(QSG_LOG_INFO,
"animation driver switched to timer mode");
213 qCDebug(QSG_LOG_INFO,
"animation driver switched to vsync mode");
265 qCDebug(QSG_LOG_INFO,
"Animation Driver: using QElapsedTimer, thread %p %s",
385 if (useElapsedTimerBasedAnimationDriver())
430 qWarning(
"QSGRendererInterface not implemented");
464 void *callbackUserData)
466 renderer->setRenderTarget(renderTarget);
581#include "qsgcontext.moc"
582#include "moc_qsgcontext_p.cpp"
void advanceAnimation()
Advances the animation.
bool isEmpty() const noexcept
Returns true if the byte array has size 0; otherwise returns false.
The QColor class provides colors based on RGB, HSV or CMYK values.
qint64 elapsed() const noexcept
Returns the number of milliseconds since this QElapsedTimer was last started.
qint64 restart() noexcept
Restarts the timer and returns the number of milliseconds elapsed since the previous start.
void start() noexcept
\typealias QElapsedTimer::Duration Synonym for std::chrono::nanoseconds.
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.
QScreen * primaryScreen
the primary (or default) screen of the application.
T take(const Key &key)
Removes the item with the key from the hash and returns the value associated with it.
T value(const Key &key) const noexcept
iterator insert(const Key &key, const T &value)
Inserts a new item with the key and a value of value.
void unlock() noexcept
Unlocks the mutex.
void lock() noexcept
Locks the mutex.
QObject * parent() const
Returns a pointer to the parent object.
static QMetaObject::Connection connect(const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
\threadsafe
void destroyed(QObject *=nullptr)
This signal is emitted immediately before the object obj is destroyed, after any instances of QPointe...
QQuickGraphicsConfiguration controls lower level graphics settings for the QQuickWindow.
The QQuickTextureFactory class provides an interface for loading custom textures from QML....
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
static QRawFontPrivate * get(const QRawFont &font)
The QRawFont class provides access to a single physical instance of a font.
\inmodule QtCore\reentrant
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
QSGAnimationDriver(QObject *parent)
float vsyncInterval() const
virtual bool isVSyncDependent() const =0
The QSGContext holds the scene graph entry points for one QML engine.
virtual void renderContextInitialized(QSGRenderContext *renderContext)
virtual QSGInternalTextNode * createInternalTextNode(QSGRenderContext *renderContext)
virtual float vsyncIntervalForAnimationDriver(QAnimationDriver *driver)
virtual QSGShaderEffectNode * createShaderEffectNode(QSGRenderContext *renderContext)
Creates a new shader effect node.
virtual bool isVSyncDependent(QAnimationDriver *driver)
virtual QSGRendererInterface * rendererInterface(QSGRenderContext *renderContext)
Returns a pointer to the (presumably) global renderer interface.
virtual QSGInternalRectangleNode * createInternalRectangleNode()=0
virtual QAnimationDriver * createAnimationDriver(QObject *parent)
Creates a new animation driver.
virtual QSGTextNode * createTextNode(QSGRenderContext *renderContext)
QSGContext(QObject *parent=nullptr)
virtual QSGGuiThreadShaderEffectManager * createGuiThreadShaderEffectManager()
Creates a new shader effect helper instance.
virtual QSize minimumFBOSize() const
virtual void renderContextInvalidated(QSGRenderContext *renderContext)
qint64 elapsed() const override
Returns the number of milliseconds since the animations was started.
void advance() override
Advances the animation.
QSGDefaultAnimationDriver(QObject *parent)
bool isVSyncDependent() const override
QSGElapsedTimerAnimationDriver(QObject *parent)
bool isVSyncDependent() const override
qint64 elapsed() const override
Returns the number of milliseconds since the animations was started.
void advance() override
Advances the animation.
virtual void setRect(const QRectF &rect)=0
virtual void setColor(const QColor &color)=0
void registerFontengineForCleanup(QFontEngine *engine)
QSGRenderContext(QSGContext *context)
QHash< QObject *, QSGTexture * > m_textures
virtual void endNextFrame(QSGRenderer *renderer)
QHash< QFontEngine *, int > m_fontEnginesToClean
virtual void initialize(const InitParams *params)
virtual void beginNextFrame(QSGRenderer *renderer, const QSGRenderTarget &renderTarget, RenderPassCallback mainPassRecordingStart, RenderPassCallback mainPassRecordingEnd, void *callbackUserData)
void textureFactoryDestroyed(QObject *o)
virtual void invalidateGlyphCaches()
virtual QSGDistanceFieldGlyphCache * distanceFieldGlyphCache(const QRawFont &font, int renderTypeQuality)
Factory function for scene graph backends of the distance-field glyph cache.
virtual void invalidate()
void(*)(void *) RenderPassCallback
virtual QSGCurveGlyphAtlas * curveGlyphAtlas(const QRawFont &font)
Factory function for curve atlases that can be used to provide geometry for the curve renderer for a ...
virtual void preprocess()
Do necessary preprocessing before the frame.
virtual QRhi * rhi() const
void unregisterFontengineForCleanup(QFontEngine *engine)
virtual void prepareSync(qreal devicePixelRatio, QRhiCommandBuffer *cb, const QQuickGraphicsConfiguration &config)
QSGTexture * textureForFactory(QQuickTextureFactory *factory, QQuickWindow *window)
Factory function for the scene graph renderers.
~QSGRenderContext() override
virtual QSGTexture * compressedTextureForFactory(const QSGCompressedTextureFactory *) const
Return the texture corresponding to a texture factory.
QSet< QSGTexture * > m_texturesToDelete
An interface providing access to some of the graphics API specific internals of the scenegraph.
The renderer class is the abstract baseclass used for rendering the QML scene graph.
The QSGTextNode class is a class for drawing text layouts and text documents in the Qt Quick scene gr...
The QScreen class is used to query screen properties. \inmodule QtGui.
qreal refreshRate
the approximate vertical refresh rate of the screen in Hz
static QThread * currentThread()
static QUnifiedTimer * instance()
qDeleteAll(list.begin(), list.end())
Combined button and popup list for selecting options.
#define Q_LOGGING_CATEGORY(name,...)
#define qCDebug(category,...)
GLuint GLuint GLfloat weight
#define DEFINE_BOOL_CONFIG_OPTION(name, var)
bool qsg_useConsistentTiming()
SSL_CTX int(* cb)(SSL *ssl, unsigned char **out, unsigned char *outlen, const unsigned char *in, unsigned int inlen, void *arg)
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
Q_CORE_EXPORT bool qEnvironmentVariableIsEmpty(const char *varName) noexcept
QItemEditorFactory * factory
QSvgRenderer * renderer
[0]
FontKey(const QRawFont &font, int renderTypeQuality)
QFontEngine::FaceId faceId