6#include <QtQuick/private/qsgdefaultinternalrectanglenode_p.h>
7#include <QtQuick/private/qsgdefaultinternalimagenode_p.h>
8#include <QtQuick/private/qsgdefaultpainternode_p.h>
9#include <QtQuick/private/qsgdefaultglyphnode_p.h>
10#include <QtQuick/private/qsgdistancefieldglyphnode_p.h>
11#include <QtQuick/private/qsgdistancefieldglyphnode_p_p.h>
12#include <QtQuick/private/qsgrhisupport_p.h>
13#include <QtQuick/private/qsgrhilayer_p.h>
14#include <QtQuick/private/qsgdefaultrendercontext_p.h>
15#include <QtQuick/private/qsgdefaultrectanglenode_p.h>
16#include <QtQuick/private/qsgdefaultimagenode_p.h>
17#include <QtQuick/private/qsgdefaultninepatchnode_p.h>
18#if QT_CONFIG(quick_sprite)
19#include <QtQuick/private/qsgdefaultspritenode_p.h>
21#include <QtQuick/private/qsgrhishadereffectnode_p.h>
23#include <QOpenGLContext>
25#include <QtQuick/private/qquickwindow_p.h>
26#include <QtQuick/private/qquickitem_p.h>
28#include <private/qqmlglobal_p.h>
53 , m_antialiasingMethod(
QSGContext::UndecidedAntialiasing)
54 , m_distanceFieldDisabled(qmlDisableDistanceField())
55 , m_distanceFieldAntialiasing(
QSGGlyphNode::HighQualitySubPixelAntialiasing)
56 , m_distanceFieldAntialiasingDecided(
false)
60 m_distanceFieldAntialiasingDecided =
true;
61 if (
mode ==
"subpixel")
63 else if (
mode ==
"subpixel-lowq")
65 else if (
mode ==
"gray")
94 else if (aaType ==
"vertex")
105 if (!m_distanceFieldAntialiasingDecided) {
106 m_distanceFieldAntialiasingDecided =
true;
148 bool preferNativeGlyphNode,
149 int renderTypeQuality)
151 if (m_distanceFieldDisabled || preferNativeGlyphNode) {
175 if (useDepth &&
format.depthBufferSize() == -1)
176 format.setDepthBufferSize(24);
178 format.setDepthBufferSize(0);
179 if (useStencil &&
format.stencilBufferSize() == -1)
180 format.setStencilBufferSize(8);
181 else if (!useStencil)
182 format.setStencilBufferSize(0);
185 if (QQuickWindow::hasDefaultAlphaBuffer())
186 format.setAlphaBufferSize(8);
189 format.setSwapInterval(0);
195 m_distanceFieldDisabled = !
enabled;
200 return !m_distanceFieldDisabled;
224#if QT_CONFIG(quick_sprite)
225QSGSpriteNode *QSGDefaultContext::createSpriteNode()
263 return window->vulkanInstance();
void unlock() noexcept
Unlocks the mutex.
void lock() noexcept
Locks the mutex.
The QQuickPaintedItem class provides a way to use the QPainter API in the QML Scene Graph.
static QQuickWindowPrivate * get(QQuickWindow *c)
QSGRenderContext * context
\qmltype Window \instantiates QQuickWindow \inqmlmodule QtQuick
\variable QRhiGles2InitParams::format
The QSGContext holds the scene graph entry points for one QML engine.
QSGGlyphNode * createGlyphNode(QSGRenderContext *rc, bool preferNativeGlyphNode, int renderTypeQuality) override
QSGRectangleNode * createRectangleNode() override
QSGInternalRectangleNode * createInternalRectangleNode() override
ShaderCompilationTypes shaderCompilationType() const override
bool isDistanceFieldEnabled() const
QSGImageNode * createImageNode() override
QSGRendererInterface * rendererInterface(QSGRenderContext *renderContext) override
Returns a pointer to the (presumably) global renderer interface.
QSGRenderContext * createRenderContext() override
ShaderSourceTypes shaderSourceType() const override
QSGShaderEffectNode * createShaderEffectNode(QSGRenderContext *renderContext) override
Creates a new shader effect node.
void renderContextInitialized(QSGRenderContext *renderContext) override
QSGGuiThreadShaderEffectManager * createGuiThreadShaderEffectManager() override
Creates a new shader effect helper instance.
QSGNinePatchNode * createNinePatchNode() override
ShaderType shaderType() const override
QSGPainterNode * createPainterNode(QQuickPaintedItem *item) override
QSurfaceFormat defaultSurfaceFormat() const override
void setDistanceFieldEnabled(bool enabled)
QSGInternalImageNode * createInternalImageNode(QSGRenderContext *renderContext) override
QSGLayer * createLayer(QSGRenderContext *renderContext) override
void renderContextInvalidated(QSGRenderContext *) override
GraphicsApi graphicsApi() const override
Returns the graphics API that is in use by the Qt Quick scenegraph.
void * getResource(QQuickWindow *window, Resource resource) const override
Queries a graphics resource in window.
void setRenderTypeQuality(int renderTypeQuality) override
void setPreferredAntialiasingMode(AntialiasingMode mode) override
@ HighQualitySubPixelAntialiasing
@ LowQualitySubPixelAntialiasing
The QSGImageNode class is provided for convenience to easily draw textured content using the QML scen...
ImageNode(QSGDefaultRenderContext *rc)
void setAntialiasing(bool) override
void setAntialiasing(bool) override
The QSGRectangleNode class is a convenience class for drawing solid filled rectangles using scenegrap...
An interface providing access to some of the graphics API specific internals of the scenegraph.
Resource
\value DeviceResource The resource is a pointer to the graphics device, when applicable.
GraphicsApi
\value Unknown An unknown graphics API is in use \value Software The Qt Quick 2D Renderer is in use \...
ShaderType
\value UnknownShadingLanguage Not yet known due to no window and scenegraph associated \value GLSL GL...
const void * rifResource(QSGRendererInterface::Resource res, const QSGDefaultRenderContext *rc, const QQuickWindow *w)
QSGRendererInterface::GraphicsApi graphicsApi() const
static QSGRhiSupport * instance()
Combined button and popup list for selecting options.
Q_CONSTRUCTOR_FUNCTION(initializeStandardUserDefaults)
GLenum GLenum GLsizei const GLuint GLboolean enabled
GLint GLsizei GLsizei GLenum format
#define DEFINE_BOOL_CONFIG_OPTION(name, var)
static QT_END_NAMESPACE void initResources()
Q_CORE_EXPORT QByteArray qgetenv(const char *varName)
Q_CORE_EXPORT bool qEnvironmentVariableIsEmpty(const char *varName) noexcept
Q_CORE_EXPORT bool qEnvironmentVariableIsSet(const char *varName) noexcept
#define Q_INIT_RESOURCE(name)
IUIAutomationTreeWalker __RPC__deref_out_opt IUIAutomationElement ** parent