aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/scenegraph/qsgdefaultcontext.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/scenegraph/qsgdefaultcontext.cpp')
-rw-r--r--src/quick/scenegraph/qsgdefaultcontext.cpp55
1 files changed, 36 insertions, 19 deletions
diff --git a/src/quick/scenegraph/qsgdefaultcontext.cpp b/src/quick/scenegraph/qsgdefaultcontext.cpp
index f9978e816c..6964b74dc8 100644
--- a/src/quick/scenegraph/qsgdefaultcontext.cpp
+++ b/src/quick/scenegraph/qsgdefaultcontext.cpp
@@ -40,8 +40,8 @@
#include "qsgdefaultcontext_p.h"
#include <QtQuick/private/qsgdistancefieldutil_p.h>
-#include <QtQuick/private/qsgdefaultrectanglenode_p.h>
-#include <QtQuick/private/qsgdefaultimagenode_p.h>
+#include <QtQuick/private/qsgdefaultinternalrectanglenode_p.h>
+#include <QtQuick/private/qsgdefaultinternalimagenode_p.h>
#include <QtQuick/private/qsgdefaultpainternode_p.h>
#include <QtQuick/private/qsgdefaultglyphnode_p.h>
#include <QtQuick/private/qsgdistancefieldglyphnode_p.h>
@@ -49,6 +49,10 @@
#include <QtQuick/private/qsgrenderloop_p.h>
#include <QtQuick/private/qsgdefaultlayer_p.h>
#include <QtQuick/private/qsgdefaultrendercontext_p.h>
+#include <QtQuick/private/qsgdefaultrectanglenode_p.h>
+#include <QtQuick/private/qsgdefaultimagenode_p.h>
+#include <QtQuick/private/qsgdefaultninepatchnode_p.h>
+#include <QtQuick/private/qsgdefaultspritenode_p.h>
#include <QtGui/QOpenGLContext>
#include <QtGui/QOpenGLFramebufferObject>
@@ -60,13 +64,13 @@
QT_BEGIN_NAMESPACE
namespace QSGMultisampleAntialiasing {
- class ImageNode : public QSGDefaultImageNode {
+ class ImageNode : public QSGDefaultInternalImageNode {
public:
void setAntialiasing(bool) { }
};
- class RectangleNode : public QSGDefaultRectangleNode {
+ class RectangleNode : public QSGDefaultInternalRectangleNode {
public:
void setAntialiasing(bool) { }
};
@@ -152,7 +156,9 @@ void QSGDefaultContext::renderContextInitialized(QSGRenderContext *renderContext
qCDebug(QSG_LOG_INFO) << "GL_RENDERER: " << (const char *) funcs->glGetString(GL_RENDERER);
qCDebug(QSG_LOG_INFO) << "GL_VERSION: " << (const char *) funcs->glGetString(GL_VERSION);
QSet<QByteArray> exts = openglRenderContext->openglContext()->extensions();
- QByteArray all; foreach (const QByteArray &e, exts) all += ' ' + e;
+ QByteArray all;
+ for (const QByteArray &e : qAsConst(exts))
+ all += ' ' + e;
qCDebug(QSG_LOG_INFO) << "GL_EXTENSIONS: " << all.constData();
qCDebug(QSG_LOG_INFO) << "Max Texture Size: " << openglRenderContext->maxTextureSize();
qCDebug(QSG_LOG_INFO) << "Debug context: " << format.testOption(QSurfaceFormat::DebugContext);
@@ -170,18 +176,18 @@ QSGRenderContext *QSGDefaultContext::createRenderContext()
return new QSGDefaultRenderContext(this);
}
-QSGRectangleNode *QSGDefaultContext::createRectangleNode()
+QSGInternalRectangleNode *QSGDefaultContext::createInternalRectangleNode()
{
return m_antialiasingMethod == MsaaAntialiasing
? new QSGMultisampleAntialiasing::RectangleNode
- : new QSGDefaultRectangleNode;
+ : new QSGDefaultInternalRectangleNode;
}
-QSGImageNode *QSGDefaultContext::createImageNode()
+QSGInternalImageNode *QSGDefaultContext::createInternalImageNode()
{
return m_antialiasingMethod == MsaaAntialiasing
? new QSGMultisampleAntialiasing::ImageNode
- : new QSGDefaultImageNode;
+ : new QSGDefaultInternalImageNode;
}
QSGPainterNode *QSGDefaultContext::createPainterNode(QQuickPaintedItem *item)
@@ -200,15 +206,6 @@ QSGGlyphNode *QSGDefaultContext::createGlyphNode(QSGRenderContext *rc, bool pref
}
}
-/*!
- * Factory function for scene graph backends of the QStyle stylable elements. Returns a
- * null pointer if the backend doesn't provide its own node type.
- */
-QSGNinePatchNode *QSGDefaultContext::createNinePatchNode()
-{
- return nullptr;
-}
-
QSGLayer *QSGDefaultContext::createLayer(QSGRenderContext *renderContext)
{
return new QSGDefaultLayer(renderContext);
@@ -246,6 +243,26 @@ QSGRendererInterface *QSGDefaultContext::rendererInterface(QSGRenderContext *ren
return this;
}
+QSGRectangleNode *QSGDefaultContext::createRectangleNode()
+{
+ return new QSGDefaultRectangleNode;
+}
+
+QSGImageNode *QSGDefaultContext::createImageNode()
+{
+ return new QSGDefaultImageNode;
+}
+
+QSGNinePatchNode *QSGDefaultContext::createNinePatchNode()
+{
+ return new QSGDefaultNinePatchNode;
+}
+
+QSGSpriteNode *QSGDefaultContext::createSpriteNode()
+{
+ return new QSGDefaultSpriteNode;
+}
+
QSGRendererInterface::GraphicsApi QSGDefaultContext::graphicsApi() const
{
return OpenGL;
@@ -263,7 +280,7 @@ QSGRendererInterface::ShaderCompilationTypes QSGDefaultContext::shaderCompilatio
QSGRendererInterface::ShaderSourceTypes QSGDefaultContext::shaderSourceType() const
{
- return ShaderSourceString;
+ return ShaderSourceString | ShaderSourceFile;
}
QT_END_NAMESPACE