diff options
author | Andy Nichols <andy.nichols@theqtcompany.com> | 2016-03-08 17:14:39 +0100 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@theqtcompany.com> | 2016-03-09 15:08:26 +0000 |
commit | de892ec347997d9cfb14c40bf6fd47f6f97bb225 (patch) | |
tree | 425e0e37e24084657a98da277d1545e0353e60fd /src/plugins/scenegraph | |
parent | fab04939800c0e5ff82fb447611996470cdf614f (diff) |
2DRenderer: Rename classes to match scenegraph adaptation naming scheme
Change-Id: I648112a3bdfd3b518fcd69eb8c1a781682753c33
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/plugins/scenegraph')
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgabstractsoftwarerenderer.cpp (renamed from src/plugins/scenegraph/softwarecontext/abstractsoftwarerenderer.cpp) | 56 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgabstractsoftwarerenderer_p.h (renamed from src/plugins/scenegraph/softwarecontext/abstractsoftwarerenderer.h) | 28 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwarecontext.cpp (renamed from src/plugins/scenegraph/softwarecontext/context.cpp) | 64 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwarecontext_p.h (renamed from src/plugins/scenegraph/softwarecontext/context.h) | 16 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwarecontextplugin.cpp (renamed from src/plugins/scenegraph/softwarecontext/pluginmain.cpp) | 20 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwarecontextplugin_p.h (renamed from src/plugins/scenegraph/softwarecontext/pluginmain.h) | 8 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwareglyphnode.cpp (renamed from src/plugins/scenegraph/softwarecontext/glyphnode.cpp) | 20 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwareglyphnode_p.h (renamed from src/plugins/scenegraph/softwarecontext/glyphnode.h) | 10 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwareimagenode.cpp (renamed from src/plugins/scenegraph/softwarecontext/imagenode.cpp) | 42 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwareimagenode_p.h (renamed from src/plugins/scenegraph/softwarecontext/imagenode.h) | 10 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwarelayer.cpp (renamed from src/plugins/scenegraph/softwarecontext/softwarelayer.cpp) | 54 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwarelayer_p.h (renamed from src/plugins/scenegraph/softwarecontext/softwarelayer.h) | 16 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwareninepatchnode.cpp (renamed from src/plugins/scenegraph/softwarecontext/ninepatchnode.cpp) | 24 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwareninepatchnode_p.h (renamed from src/plugins/scenegraph/softwarecontext/ninepatchnode.h) | 10 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwarepainternode.cpp (renamed from src/plugins/scenegraph/softwarecontext/painternode.cpp) | 40 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwarepainternode_p.h (renamed from src/plugins/scenegraph/softwarecontext/painternode.h) | 12 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwarepixmaprenderer.cpp (renamed from src/plugins/scenegraph/softwarecontext/pixmaprenderer.cpp) | 16 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwarepixmaprenderer_p.h (renamed from src/plugins/scenegraph/softwarecontext/pixmaprenderer.h) | 14 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwarepixmaptexture.cpp (renamed from src/plugins/scenegraph/softwarecontext/pixmaptexture.cpp) | 16 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwarepixmaptexture_p.h (renamed from src/plugins/scenegraph/softwarecontext/pixmaptexture.h) | 12 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwarerectanglenode.cpp (renamed from src/plugins/scenegraph/softwarecontext/rectanglenode.cpp) | 30 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwarerectanglenode_p.h (renamed from src/plugins/scenegraph/softwarecontext/rectanglenode.h) | 10 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderablenode.cpp (renamed from src/plugins/scenegraph/softwarecontext/renderablenode.cpp) | 100 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderablenode_p.h (renamed from src/plugins/scenegraph/softwarecontext/renderablenode.h) | 32 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderablenodeupdater.cpp (renamed from src/plugins/scenegraph/softwarecontext/renderablenodeupdater.cpp) | 78 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderablenodeupdater_p.h (renamed from src/plugins/scenegraph/softwarecontext/renderablenodeupdater.h) | 24 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderer.cpp (renamed from src/plugins/scenegraph/softwarecontext/renderer.cpp) | 22 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderer_p.h (renamed from src/plugins/scenegraph/softwarecontext/renderer.h) | 14 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderlistbuilder.cpp (renamed from src/plugins/scenegraph/softwarecontext/renderlistbuilder.cpp) | 62 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderlistbuilder_p.h (renamed from src/plugins/scenegraph/softwarecontext/renderlistbuilder.h) | 14 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderloop.cpp (renamed from src/plugins/scenegraph/softwarecontext/renderloop.cpp) | 30 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderloop_p.h (renamed from src/plugins/scenegraph/softwarecontext/renderloop.h) | 12 | ||||
-rw-r--r-- | src/plugins/scenegraph/softwarecontext/softwarecontext.pro | 64 |
33 files changed, 490 insertions, 490 deletions
diff --git a/src/plugins/scenegraph/softwarecontext/abstractsoftwarerenderer.cpp b/src/plugins/scenegraph/softwarecontext/qsgabstractsoftwarerenderer.cpp index 8404360470..9c9ca6154c 100644 --- a/src/plugins/scenegraph/softwarecontext/abstractsoftwarerenderer.cpp +++ b/src/plugins/scenegraph/softwarecontext/qsgabstractsoftwarerenderer.cpp @@ -37,12 +37,12 @@ ** ****************************************************************************/ -#include "abstractsoftwarerenderer.h" +#include "qsgabstractsoftwarerenderer_p.h" -#include "renderablenodeupdater.h" -#include "renderlistbuilder.h" -#include "context.h" -#include "renderablenode.h" +#include "qsgsoftwarerenderablenodeupdater_p.h" +#include "qsgsoftwarerenderlistbuilder_p.h" +#include "qsgsoftwarecontext_p.h" +#include "qsgsoftwarerenderablenode_p.h" #include <QtCore/QLoggingCategory> #include <QtGui/QWindow> @@ -54,44 +54,44 @@ QT_BEGIN_NAMESPACE namespace SoftwareContext{ -AbstractSoftwareRenderer::AbstractSoftwareRenderer(QSGRenderContext *context) +QSGAbstractSoftwareRenderer::QSGAbstractSoftwareRenderer(QSGRenderContext *context) : QSGRenderer(context) , m_background(new QSGSimpleRectNode) - , m_nodeUpdater(new RenderableNodeUpdater(this)) + , m_nodeUpdater(new QSGSoftwareRenderableNodeUpdater(this)) { // Setup special background node - auto backgroundRenderable = new RenderableNode(RenderableNode::SimpleRect, m_background); + auto backgroundRenderable = new QSGSoftwareRenderableNode(QSGSoftwareRenderableNode::SimpleRect, m_background); addNodeMapping(m_background, backgroundRenderable); } -AbstractSoftwareRenderer::~AbstractSoftwareRenderer() +QSGAbstractSoftwareRenderer::~QSGAbstractSoftwareRenderer() { // Cleanup RenderableNodes delete m_background; - for (RenderableNode *node : m_nodes.values()) { + for (QSGSoftwareRenderableNode *node : m_nodes.values()) { delete node; } delete m_nodeUpdater; } -RenderableNode *AbstractSoftwareRenderer::renderableNode(QSGNode *node) const +QSGSoftwareRenderableNode *QSGAbstractSoftwareRenderer::renderableNode(QSGNode *node) const { return m_nodes.value(node, nullptr); } -void AbstractSoftwareRenderer::addNodeMapping(QSGNode *node, RenderableNode *renderableNode) +void QSGAbstractSoftwareRenderer::addNodeMapping(QSGNode *node, QSGSoftwareRenderableNode *renderableNode) { m_nodes.insert(node, renderableNode); } -void AbstractSoftwareRenderer::appendRenderableNode(RenderableNode *node) +void QSGAbstractSoftwareRenderer::appendRenderableNode(QSGSoftwareRenderableNode *node) { m_renderableNodes.append(node); } -void AbstractSoftwareRenderer::nodeChanged(QSGNode *node, QSGNode::DirtyState state) +void QSGAbstractSoftwareRenderer::nodeChanged(QSGNode *node, QSGNode::DirtyState state) { if (state & QSGNode::DirtyGeometry) { nodeGeometryUpdated(node); @@ -120,7 +120,7 @@ void AbstractSoftwareRenderer::nodeChanged(QSGNode *node, QSGNode::DirtyState st QSGRenderer::nodeChanged(node, state); } -QRegion AbstractSoftwareRenderer::renderNodes(QPainter *painter) +QRegion QSGAbstractSoftwareRenderer::renderNodes(QPainter *painter) { QRegion dirtyRegion; // If there are no nodes, do nothing @@ -141,17 +141,17 @@ QRegion AbstractSoftwareRenderer::renderNodes(QPainter *painter) return dirtyRegion; } -void AbstractSoftwareRenderer::buildRenderList() +void QSGAbstractSoftwareRenderer::buildRenderList() { // Clear the previous renderlist m_renderableNodes.clear(); // Add the background renderable (always first) m_renderableNodes.append(renderableNode(m_background)); // Build the renderlist - RenderListBuilder(this).visitChildren(rootNode()); + QSGSoftwareRenderListBuilder(this).visitChildren(rootNode()); } -void AbstractSoftwareRenderer::optimizeRenderList() +void QSGAbstractSoftwareRenderer::optimizeRenderList() { // Iterate through the renderlist from front to back // Objective is to update the dirty status and rects. @@ -219,7 +219,7 @@ void AbstractSoftwareRenderer::optimizeRenderList() m_obscuredRegion = QRegion(); } -void AbstractSoftwareRenderer::setBackgroundColor(const QColor &color) +void QSGAbstractSoftwareRenderer::setBackgroundColor(const QColor &color) { if (m_background->color() == color) return; @@ -227,7 +227,7 @@ void AbstractSoftwareRenderer::setBackgroundColor(const QColor &color) renderableNode(m_background)->markMaterialDirty(); } -void AbstractSoftwareRenderer::setBackgroundSize(const QSize &size) +void QSGAbstractSoftwareRenderer::setBackgroundSize(const QSize &size) { if (m_background->rect().size().toSize() == size) return; @@ -237,24 +237,24 @@ void AbstractSoftwareRenderer::setBackgroundSize(const QSize &size) m_dirtyRegion = QRegion(m_background->rect().toRect()); } -QColor AbstractSoftwareRenderer::backgroundColor() +QColor QSGAbstractSoftwareRenderer::backgroundColor() { return m_background->color(); } -QSize AbstractSoftwareRenderer::backgroundSize() +QSize QSGAbstractSoftwareRenderer::backgroundSize() { return m_background->rect().size().toSize(); } -void AbstractSoftwareRenderer::nodeAdded(QSGNode *node) +void QSGAbstractSoftwareRenderer::nodeAdded(QSGNode *node) { qCDebug(lc2DRender) << "nodeAdded" << (void*)node; m_nodeUpdater->updateNodes(node); } -void AbstractSoftwareRenderer::nodeRemoved(QSGNode *node) +void QSGAbstractSoftwareRenderer::nodeRemoved(QSGNode *node) { qCDebug(lc2DRender) << "nodeRemoved" << (void*)node; @@ -278,7 +278,7 @@ void AbstractSoftwareRenderer::nodeRemoved(QSGNode *node) m_nodeUpdater->updateNodes(node, true); } -void AbstractSoftwareRenderer::nodeGeometryUpdated(QSGNode *node) +void QSGAbstractSoftwareRenderer::nodeGeometryUpdated(QSGNode *node) { qCDebug(lc2DRender) << "nodeGeometryUpdated"; @@ -291,7 +291,7 @@ void AbstractSoftwareRenderer::nodeGeometryUpdated(QSGNode *node) } } -void AbstractSoftwareRenderer::nodeMaterialUpdated(QSGNode *node) +void QSGAbstractSoftwareRenderer::nodeMaterialUpdated(QSGNode *node) { qCDebug(lc2DRender) << "nodeMaterialUpdated"; @@ -304,7 +304,7 @@ void AbstractSoftwareRenderer::nodeMaterialUpdated(QSGNode *node) } } -void AbstractSoftwareRenderer::nodeMatrixUpdated(QSGNode *node) +void QSGAbstractSoftwareRenderer::nodeMatrixUpdated(QSGNode *node) { qCDebug(lc2DRender) << "nodeMaterialUpdated"; @@ -312,7 +312,7 @@ void AbstractSoftwareRenderer::nodeMatrixUpdated(QSGNode *node) m_nodeUpdater->updateNodes(node); } -void AbstractSoftwareRenderer::nodeOpacityUpdated(QSGNode *node) +void QSGAbstractSoftwareRenderer::nodeOpacityUpdated(QSGNode *node) { qCDebug(lc2DRender) << "nodeOpacityUpdated"; diff --git a/src/plugins/scenegraph/softwarecontext/abstractsoftwarerenderer.h b/src/plugins/scenegraph/softwarecontext/qsgabstractsoftwarerenderer_p.h index dff8d99767..886a8a509d 100644 --- a/src/plugins/scenegraph/softwarecontext/abstractsoftwarerenderer.h +++ b/src/plugins/scenegraph/softwarecontext/qsgabstractsoftwarerenderer_p.h @@ -37,8 +37,8 @@ ** ****************************************************************************/ -#ifndef ABSTRACTSOFTWARERENDERER_H -#define ABSTRACTSOFTWARERENDERER_H +#ifndef QSGABSTRACTSOFTWARERENDERER_H +#define QSGABSTRACTSOFTWARERENDERER_H #include <private/qsgrenderer_p.h> @@ -51,18 +51,18 @@ class QSGSimpleRectNode; namespace SoftwareContext{ -class RenderableNode; -class RenderableNodeUpdater; +class QSGSoftwareRenderableNode; +class QSGSoftwareRenderableNodeUpdater; -class AbstractSoftwareRenderer : public QSGRenderer +class QSGAbstractSoftwareRenderer : public QSGRenderer { public: - AbstractSoftwareRenderer(QSGRenderContext *context); - virtual ~AbstractSoftwareRenderer(); + QSGAbstractSoftwareRenderer(QSGRenderContext *context); + virtual ~QSGAbstractSoftwareRenderer(); - RenderableNode *renderableNode(QSGNode *node) const; - void addNodeMapping(QSGNode *node, RenderableNode *renderableNode); - void appendRenderableNode(RenderableNode *node); + QSGSoftwareRenderableNode *renderableNode(QSGNode *node) const; + void addNodeMapping(QSGNode *node, QSGSoftwareRenderableNode *renderableNode); + void appendRenderableNode(QSGSoftwareRenderableNode *node); void nodeChanged(QSGNode *node, QSGNode::DirtyState state) override; @@ -84,19 +84,19 @@ private: void nodeMatrixUpdated(QSGNode *node); void nodeOpacityUpdated(QSGNode *node); - QHash<QSGNode*, RenderableNode*> m_nodes; - QLinkedList<RenderableNode*> m_renderableNodes; + QHash<QSGNode*, QSGSoftwareRenderableNode*> m_nodes; + QLinkedList<QSGSoftwareRenderableNode*> m_renderableNodes; QSGSimpleRectNode *m_background; QRegion m_dirtyRegion; QRegion m_obscuredRegion; - RenderableNodeUpdater *m_nodeUpdater; + QSGSoftwareRenderableNodeUpdater *m_nodeUpdater; }; } // namespace QT_END_NAMESPACE -#endif // ABSTRACTSOFTWARERENDERER_H +#endif // QSGABSTRACTSOFTWARERENDERER_H diff --git a/src/plugins/scenegraph/softwarecontext/context.cpp b/src/plugins/scenegraph/softwarecontext/qsgsoftwarecontext.cpp index 189d6c2b32..f1e2f38ab0 100644 --- a/src/plugins/scenegraph/softwarecontext/context.cpp +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwarecontext.cpp @@ -37,16 +37,16 @@ ** ****************************************************************************/ -#include "context.h" +#include "qsgsoftwarecontext_p.h" -#include "rectanglenode.h" -#include "imagenode.h" -#include "painternode.h" -#include "pixmaptexture.h" -#include "glyphnode.h" -#include "ninepatchnode.h" -#include "softwarelayer.h" -#include "renderer.h" +#include "qsgsoftwarerectanglenode_p.h" +#include "qsgsoftwareimagenode_p.h" +#include "qsgsoftwarepainternode_p.h" +#include "qsgsoftwarepixmaptexture_p.h" +#include "qsgsoftwareglyphnode_p.h" +#include "qsgsoftwareninepatchnode_p.h" +#include "qsgsoftwarelayer_p.h" +#include "qsgsoftwarerenderer_p.h" #include <QtCore/QCoreApplication> #include <QtCore/QElapsedTimer> @@ -94,51 +94,51 @@ QT_BEGIN_NAMESPACE namespace SoftwareContext { -RenderContext::RenderContext(QSGContext *ctx) +QSGSoftwareRenderContext::QSGSoftwareRenderContext(QSGContext *ctx) : QSGRenderContext(ctx) , currentWindow(0) , m_initialized(false) { } -Context::Context(QObject *parent) +QSGSoftwareContext::QSGSoftwareContext(QObject *parent) : QSGContext(parent) { setDistanceFieldEnabled(false); } -QSGRectangleNode *Context::createRectangleNode() +QSGRectangleNode *QSGSoftwareContext::createRectangleNode() { - return new RectangleNode(); + return new QSGSoftwareRectangleNode(); } -QSGImageNode *Context::createImageNode() +QSGImageNode *QSGSoftwareContext::createImageNode() { - return new ImageNode(); + return new QSGSoftwareImageNode(); } -QSGPainterNode *Context::createPainterNode(QQuickPaintedItem *item) +QSGPainterNode *QSGSoftwareContext::createPainterNode(QQuickPaintedItem *item) { - return new PainterNode(item); + return new QSGSoftwarePainterNode(item); } -QSGGlyphNode *Context::createGlyphNode(QSGRenderContext *rc, bool preferNativeGlyphNode) +QSGGlyphNode *QSGSoftwareContext::createGlyphNode(QSGRenderContext *rc, bool preferNativeGlyphNode) { Q_UNUSED(rc); Q_UNUSED(preferNativeGlyphNode); - return new GlyphNode(); + return new QSGSoftwareGlyphNode(); } -QSGNinePatchNode *Context::createNinePatchNode() +QSGNinePatchNode *QSGSoftwareContext::createNinePatchNode() { - return new NinePatchNode(); + return new QSGSoftwareNinePatchNode(); } -QSGLayer *Context::createLayer(QSGRenderContext *renderContext) +QSGLayer *QSGSoftwareContext::createLayer(QSGRenderContext *renderContext) { - return new SoftwareLayer(renderContext); + return new QSGSoftwareLayer(renderContext); } -QSurfaceFormat Context::defaultSurfaceFormat() const +QSurfaceFormat QSGSoftwareContext::defaultSurfaceFormat() const { QSurfaceFormat format = QSurfaceFormat::defaultFormat(); format.setRenderableType(QSurfaceFormat::DefaultRenderableType); @@ -147,13 +147,13 @@ QSurfaceFormat Context::defaultSurfaceFormat() const return format; } -void RenderContext::initialize(QOpenGLContext *context) +void QSGSoftwareRenderContext::initialize(QOpenGLContext *context) { Q_UNUSED(context) Q_UNREACHABLE(); } -void RenderContext::initializeIfNeeded() +void QSGSoftwareRenderContext::initializeIfNeeded() { if (m_initialized) return; @@ -161,24 +161,24 @@ void RenderContext::initializeIfNeeded() emit initialized(); } -void RenderContext::invalidate() +void QSGSoftwareRenderContext::invalidate() { QSGRenderContext::invalidate(); } -QSGTexture *RenderContext::createTexture(const QImage &image, uint flags) const +QSGTexture *QSGSoftwareRenderContext::createTexture(const QImage &image, uint flags) const { Q_UNUSED(flags) - return new PixmapTexture(image); + return new QSGSoftwarePixmapTexture(image); } -QSGRenderer *RenderContext::createRenderer() +QSGRenderer *QSGSoftwareRenderContext::createRenderer() { - return new Renderer(this); + return new QSGSoftwareRenderer(this); } -void RenderContext::renderNextFrame(QSGRenderer *renderer, GLuint fbo) +void QSGSoftwareRenderContext::renderNextFrame(QSGRenderer *renderer, GLuint fbo) { QSGRenderContext::renderNextFrame(renderer, fbo); } diff --git a/src/plugins/scenegraph/softwarecontext/context.h b/src/plugins/scenegraph/softwarecontext/qsgsoftwarecontext_p.h index 3cd5c3bc4a..f03145ddc8 100644 --- a/src/plugins/scenegraph/softwarecontext/context.h +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwarecontext_p.h @@ -37,8 +37,8 @@ ** ****************************************************************************/ -#ifndef CONTEXT_H -#define CONTEXT_H +#ifndef QSGSOFTWARECONTEXT_H +#define QSGSOFTWARECONTEXT_H #include <private/qsgcontext_p.h> #include <private/qsgadaptationlayer_p.h> @@ -56,10 +56,10 @@ QT_BEGIN_NAMESPACE namespace SoftwareContext { -class RenderContext : public QSGRenderContext +class QSGSoftwareRenderContext : public QSGRenderContext { public: - RenderContext(QSGContext *ctx); + QSGSoftwareRenderContext(QSGContext *ctx); void initialize(QOpenGLContext *context) override; void initializeIfNeeded(); void invalidate() override; @@ -71,13 +71,13 @@ public: bool m_initialized; }; -class Context : public QSGContext +class QSGSoftwareContext : public QSGContext { Q_OBJECT public: - explicit Context(QObject *parent = nullptr); + explicit QSGSoftwareContext(QObject *parent = nullptr); - QSGRenderContext *createRenderContext() override { return new RenderContext(this); } + QSGRenderContext *createRenderContext() override { return new QSGSoftwareRenderContext(this); } QSGRectangleNode *createRectangleNode() override; QSGImageNode *createImageNode() override; QSGPainterNode *createPainterNode(QQuickPaintedItem *item) override; @@ -91,4 +91,4 @@ public: QT_END_NAMESPACE -#endif // CONTEXT_H +#endif // QSGSOFTWARECONTEXT_H diff --git a/src/plugins/scenegraph/softwarecontext/pluginmain.cpp b/src/plugins/scenegraph/softwarecontext/qsgsoftwarecontextplugin.cpp index 8b30d1bf6a..865f3e0450 100644 --- a/src/plugins/scenegraph/softwarecontext/pluginmain.cpp +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwarecontextplugin.cpp @@ -37,37 +37,37 @@ ** ****************************************************************************/ -#include "pluginmain.h" -#include "context.h" -#include "renderloop.h" +#include "qsgsoftwarecontextplugin_p.h" +#include "qsgsoftwarecontext_p.h" +#include "qsgsoftwarerenderloop_p.h" #include <private/qguiapplication_p.h> #include <qpa/qplatformintegration.h> QT_BEGIN_NAMESPACE -ContextPlugin::ContextPlugin(QObject *parent) +QSGSoftwareContextPlugin::QSGSoftwareContextPlugin(QObject *parent) : QSGContextPlugin(parent) { } -QStringList ContextPlugin::keys() const +QStringList QSGSoftwareContextPlugin::keys() const { return QStringList() << QLatin1String("softwarecontext"); } -QSGContext *ContextPlugin::create(const QString &) const +QSGContext *QSGSoftwareContextPlugin::create(const QString &) const { if (!instance) - instance = new SoftwareContext::Context(); + instance = new SoftwareContext::QSGSoftwareContext(); return instance; } -QSGRenderLoop *ContextPlugin::createWindowManager() +QSGRenderLoop *QSGSoftwareContextPlugin::createWindowManager() { - return new RenderLoop(); + return new QSGSoftwareRenderLoop(); } -SoftwareContext::Context *ContextPlugin::instance = 0; +SoftwareContext::QSGSoftwareContext *QSGSoftwareContextPlugin::instance = 0; QT_END_NAMESPACE diff --git a/src/plugins/scenegraph/softwarecontext/pluginmain.h b/src/plugins/scenegraph/softwarecontext/qsgsoftwarecontextplugin_p.h index 5ab10d87de..17e0e9315b 100644 --- a/src/plugins/scenegraph/softwarecontext/pluginmain.h +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwarecontextplugin_p.h @@ -45,24 +45,24 @@ #include <qplugin.h> -#include "context.h" +#include "qsgsoftwarecontext_p.h" QT_BEGIN_NAMESPACE -class ContextPlugin : public QSGContextPlugin +class QSGSoftwareContextPlugin : public QSGContextPlugin { Q_OBJECT Q_PLUGIN_METADATA(IID "org.qt-project.Qt.QSGContextFactoryInterface" FILE "softwarecontext.json") public: - ContextPlugin(QObject *parent = 0); + QSGSoftwareContextPlugin(QObject *parent = 0); QStringList keys() const override; QSGContext *create(const QString &key) const override; QSGRenderLoop *createWindowManager() override; - static SoftwareContext::Context *instance; + static SoftwareContext::QSGSoftwareContext *instance; }; QT_END_NAMESPACE diff --git a/src/plugins/scenegraph/softwarecontext/glyphnode.cpp b/src/plugins/scenegraph/softwarecontext/qsgsoftwareglyphnode.cpp index dc3e1285f6..d22830a831 100644 --- a/src/plugins/scenegraph/softwarecontext/glyphnode.cpp +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwareglyphnode.cpp @@ -37,11 +37,11 @@ ** ****************************************************************************/ -#include "glyphnode.h" +#include "qsgsoftwareglyphnode_p.h" QT_BEGIN_NAMESPACE -GlyphNode::GlyphNode() +QSGSoftwareGlyphNode::QSGSoftwareGlyphNode() : m_geometry(QSGGeometry::defaultAttributes_TexturedPoint2D(), 0) , m_style(QQuickText::Normal) { @@ -50,42 +50,42 @@ GlyphNode::GlyphNode() } -void GlyphNode::setGlyphs(const QPointF &position, const QGlyphRun &glyphs) +void QSGSoftwareGlyphNode::setGlyphs(const QPointF &position, const QGlyphRun &glyphs) { m_position = position; m_glyphRun = glyphs; m_bounding_rect = glyphs.boundingRect().translated(m_position - QPointF(0.0, glyphs.rawFont().ascent())); } -void GlyphNode::setColor(const QColor &color) +void QSGSoftwareGlyphNode::setColor(const QColor &color) { m_color = color; } -void GlyphNode::setStyle(QQuickText::TextStyle style) +void QSGSoftwareGlyphNode::setStyle(QQuickText::TextStyle style) { m_style = style; } -void GlyphNode::setStyleColor(const QColor &color) +void QSGSoftwareGlyphNode::setStyleColor(const QColor &color) { m_styleColor = color; } -QPointF GlyphNode::baseLine() const +QPointF QSGSoftwareGlyphNode::baseLine() const { return QPointF(); } -void GlyphNode::setPreferredAntialiasingMode(QSGGlyphNode::AntialiasingMode) +void QSGSoftwareGlyphNode::setPreferredAntialiasingMode(QSGGlyphNode::AntialiasingMode) { } -void GlyphNode::update() +void QSGSoftwareGlyphNode::update() { } -void GlyphNode::paint(QPainter *painter) +void QSGSoftwareGlyphNode::paint(QPainter *painter) { painter->setBrush(QBrush()); QPointF pos = m_position - QPointF(0, m_glyphRun.rawFont().ascent()); diff --git a/src/plugins/scenegraph/softwarecontext/glyphnode.h b/src/plugins/scenegraph/softwarecontext/qsgsoftwareglyphnode_p.h index 13c53bfb49..e7efc6da9d 100644 --- a/src/plugins/scenegraph/softwarecontext/glyphnode.h +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwareglyphnode_p.h @@ -37,17 +37,17 @@ ** ****************************************************************************/ -#ifndef GLYPHNODE_H -#define GLYPHNODE_H +#ifndef QSGSOFTWAREGLYPHNODE_H +#define QSGSOFTWAREGLYPHNODE_H #include <private/qsgadaptationlayer_p.h> QT_BEGIN_NAMESPACE -class GlyphNode : public QSGGlyphNode +class QSGSoftwareGlyphNode : public QSGGlyphNode { public: - GlyphNode(); + QSGSoftwareGlyphNode(); void setGlyphs(const QPointF &position, const QGlyphRun &glyphs) override; void setColor(const QColor &color) override; @@ -70,4 +70,4 @@ private: QT_END_NAMESPACE -#endif // GLYPHNODE_H +#endif // QSGSOFTWAREGLYPHNODE_H diff --git a/src/plugins/scenegraph/softwarecontext/imagenode.cpp b/src/plugins/scenegraph/softwarecontext/qsgsoftwareimagenode.cpp index 1844cdeafe..e4c689e41e 100644 --- a/src/plugins/scenegraph/softwarecontext/imagenode.cpp +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwareimagenode.cpp @@ -37,10 +37,10 @@ ** ****************************************************************************/ -#include "imagenode.h" +#include "qsgsoftwareimagenode_p.h" -#include "pixmaptexture.h" -#include "softwarelayer.h" +#include "qsgsoftwarepixmaptexture_p.h" +#include "qsgsoftwarelayer_p.h" #include <QPainter> #include <qmath.h> @@ -316,7 +316,7 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin } -ImageNode::ImageNode() +QSGSoftwareImageNode::QSGSoftwareImageNode() : m_innerSourceRect(0, 0, 1, 1) , m_subSourceRect(0, 0, 1, 1) , m_texture(0) @@ -331,7 +331,7 @@ ImageNode::ImageNode() } -void ImageNode::setTargetRect(const QRectF &rect) +void QSGSoftwareImageNode::setTargetRect(const QRectF &rect) { if (rect == m_targetRect) return; @@ -339,7 +339,7 @@ void ImageNode::setTargetRect(const QRectF &rect) markDirty(DirtyGeometry); } -void ImageNode::setInnerTargetRect(const QRectF &rect) +void QSGSoftwareImageNode::setInnerTargetRect(const QRectF &rect) { if (rect == m_innerTargetRect) return; @@ -347,7 +347,7 @@ void ImageNode::setInnerTargetRect(const QRectF &rect) markDirty(DirtyGeometry); } -void ImageNode::setInnerSourceRect(const QRectF &rect) +void QSGSoftwareImageNode::setInnerSourceRect(const QRectF &rect) { if (rect == m_innerSourceRect) return; @@ -355,7 +355,7 @@ void ImageNode::setInnerSourceRect(const QRectF &rect) markDirty(DirtyGeometry); } -void ImageNode::setSubSourceRect(const QRectF &rect) +void QSGSoftwareImageNode::setSubSourceRect(const QRectF &rect) { if (rect == m_subSourceRect) return; @@ -363,7 +363,7 @@ void ImageNode::setSubSourceRect(const QRectF &rect) markDirty(DirtyGeometry); } -void ImageNode::setTexture(QSGTexture *texture) +void QSGSoftwareImageNode::setTexture(QSGTexture *texture) { if (m_texture != texture) { m_texture = texture; @@ -372,7 +372,7 @@ void ImageNode::setTexture(QSGTexture *texture) } } -void ImageNode::setMirror(bool mirror) +void QSGSoftwareImageNode::setMirror(bool mirror) { if (m_mirror != mirror) { m_mirror = mirror; @@ -381,11 +381,11 @@ void ImageNode::setMirror(bool mirror) } } -void ImageNode::setMipmapFiltering(QSGTexture::Filtering /*filtering*/) +void QSGSoftwareImageNode::setMipmapFiltering(QSGTexture::Filtering /*filtering*/) { } -void ImageNode::setFiltering(QSGTexture::Filtering filtering) +void QSGSoftwareImageNode::setFiltering(QSGTexture::Filtering filtering) { bool smooth = (filtering == QSGTexture::Linear); if (smooth == m_smooth) @@ -395,7 +395,7 @@ void ImageNode::setFiltering(QSGTexture::Filtering filtering) markDirty(DirtyMaterial); } -void ImageNode::setHorizontalWrapMode(QSGTexture::WrapMode wrapMode) +void QSGSoftwareImageNode::setHorizontalWrapMode(QSGTexture::WrapMode wrapMode) { bool tileHorizontal = (wrapMode == QSGTexture::Repeat); if (tileHorizontal == m_tileHorizontal) @@ -405,7 +405,7 @@ void ImageNode::setHorizontalWrapMode(QSGTexture::WrapMode wrapMode) markDirty(DirtyMaterial); } -void ImageNode::setVerticalWrapMode(QSGTexture::WrapMode wrapMode) +void QSGSoftwareImageNode::setVerticalWrapMode(QSGTexture::WrapMode wrapMode) { bool tileVertical = (wrapMode == QSGTexture::Repeat); if (tileVertical == m_tileVertical) @@ -415,7 +415,7 @@ void ImageNode::setVerticalWrapMode(QSGTexture::WrapMode wrapMode) markDirty(DirtyMaterial); } -void ImageNode::update() +void QSGSoftwareImageNode::update() { if (m_cachedMirroredPixmapIsDirty) { if (m_mirror) { @@ -429,7 +429,7 @@ void ImageNode::update() } } -void ImageNode::preprocess() +void QSGSoftwareImageNode::preprocess() { bool doDirty = false; QSGLayer *t = qobject_cast<QSGLayer *>(m_texture); @@ -453,7 +453,7 @@ static Qt::TileRule getTileRule(qreal factor) } -void ImageNode::paint(QPainter *painter) +void QSGSoftwareImageNode::paint(QPainter *painter) { painter->setRenderHint(QPainter::SmoothPixmapTransform, m_smooth); @@ -486,16 +486,16 @@ void ImageNode::paint(QPainter *painter) } } -QRectF ImageNode::rect() const +QRectF QSGSoftwareImageNode::rect() const { return m_targetRect; } -const QPixmap &ImageNode::pixmap() const +const QPixmap &QSGSoftwareImageNode::pixmap() const { - if (PixmapTexture *pt = qobject_cast<PixmapTexture*>(m_texture)) { + if (QSGSoftwarePixmapTexture *pt = qobject_cast<QSGSoftwarePixmapTexture*>(m_texture)) { return pt->pixmap(); - } else if (SoftwareLayer *layer = qobject_cast<SoftwareLayer*>(m_texture)) { + } else if (QSGSoftwareLayer *layer = qobject_cast<QSGSoftwareLayer*>(m_texture)) { return layer->pixmap(); } else { qFatal("Image used with invalid texture format."); diff --git a/src/plugins/scenegraph/softwarecontext/imagenode.h b/src/plugins/scenegraph/softwarecontext/qsgsoftwareimagenode_p.h index ab0f341428..67cadae459 100644 --- a/src/plugins/scenegraph/softwarecontext/imagenode.h +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwareimagenode_p.h @@ -37,8 +37,8 @@ ** ****************************************************************************/ -#ifndef IMAGENODE_H -#define IMAGENODE_H +#ifndef QSGSOFTWAREIMAGENODE_H +#define QSGSOFTWAREIMAGENODE_H #include <private/qsgadaptationlayer_p.h> #include <private/qsgtexturematerial_p.h> @@ -90,10 +90,10 @@ void qDrawBorderPixmap(QPainter *painter, const QRect &targetRect, const QMargin } -class ImageNode : public QSGImageNode +class QSGSoftwareImageNode : public QSGImageNode { public: - ImageNode(); + QSGSoftwareImageNode(); void setTargetRect(const QRectF &rect) override; void setInnerTargetRect(const QRectF &rect) override; @@ -133,4 +133,4 @@ private: QT_END_NAMESPACE -#endif // IMAGENODE_H +#endif // QSGSOFTWAREIMAGENODE_H diff --git a/src/plugins/scenegraph/softwarecontext/softwarelayer.cpp b/src/plugins/scenegraph/softwarecontext/qsgsoftwarelayer.cpp index 5840486612..a53142f113 100644 --- a/src/plugins/scenegraph/softwarecontext/softwarelayer.cpp +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwarelayer.cpp @@ -37,14 +37,14 @@ ** ****************************************************************************/ -#include "softwarelayer.h" +#include "qsgsoftwarelayer_p.h" -#include "context.h" -#include "pixmaprenderer.h" +#include "qsgsoftwarecontext_p.h" +#include "qsgsoftwarepixmaprenderer_p.h" QT_BEGIN_NAMESPACE -SoftwareLayer::SoftwareLayer(QSGRenderContext *renderContext) +QSGSoftwareLayer::QSGSoftwareLayer(QSGRenderContext *renderContext) : m_item(0) , m_context(renderContext) , m_renderer(0) @@ -59,36 +59,36 @@ SoftwareLayer::SoftwareLayer(QSGRenderContext *renderContext) } -SoftwareLayer::~SoftwareLayer() +QSGSoftwareLayer::~QSGSoftwareLayer() { invalidated(); } -int SoftwareLayer::textureId() const +int QSGSoftwareLayer::textureId() const { return 0; } -QSize SoftwareLayer::textureSize() const +QSize QSGSoftwareLayer::textureSize() const { return m_pixmap.size(); } -bool SoftwareLayer::hasAlphaChannel() const +bool QSGSoftwareLayer::hasAlphaChannel() const { return m_pixmap.hasAlphaChannel(); } -bool SoftwareLayer::hasMipmaps() const +bool QSGSoftwareLayer::hasMipmaps() const { return false; } -void SoftwareLayer::bind() +void QSGSoftwareLayer::bind() { } -bool SoftwareLayer::updateTexture() +bool QSGSoftwareLayer::updateTexture() { bool doGrab = (m_live || m_grab) && m_dirtyTexture; if (doGrab) @@ -99,7 +99,7 @@ bool SoftwareLayer::updateTexture() return doGrab; } -void SoftwareLayer::setItem(QSGNode *item) +void QSGSoftwareLayer::setItem(QSGNode *item) { if (item == m_item) return; @@ -111,7 +111,7 @@ void SoftwareLayer::setItem(QSGNode *item) markDirtyTexture(); } -void SoftwareLayer::setRect(const QRectF &rect) +void QSGSoftwareLayer::setRect(const QRectF &rect) { if (rect == m_rect) return; @@ -119,7 +119,7 @@ void SoftwareLayer::setRect(const QRectF &rect) markDirtyTexture(); } -void SoftwareLayer::setSize(const QSize &size) +void QSGSoftwareLayer::setSize(const QSize &size) { if (size == m_size) return; @@ -131,7 +131,7 @@ void SoftwareLayer::setSize(const QSize &size) markDirtyTexture(); } -void SoftwareLayer::scheduleUpdate() +void QSGSoftwareLayer::scheduleUpdate() { if (m_grab) return; @@ -141,12 +141,12 @@ void SoftwareLayer::scheduleUpdate() } } -QImage SoftwareLayer::toImage() const +QImage QSGSoftwareLayer::toImage() const { return m_pixmap.toImage(); } -void SoftwareLayer::setLive(bool live) +void QSGSoftwareLayer::setLive(bool live) { if (live == m_live) return; @@ -158,25 +158,25 @@ void SoftwareLayer::setLive(bool live) markDirtyTexture(); } -void SoftwareLayer::setRecursive(bool recursive) +void QSGSoftwareLayer::setRecursive(bool recursive) { m_recursive = recursive; } -void SoftwareLayer::setFormat(GLenum) +void QSGSoftwareLayer::setFormat(GLenum) { } -void SoftwareLayer::setHasMipmaps(bool) +void QSGSoftwareLayer::setHasMipmaps(bool) { } -void SoftwareLayer::setDevicePixelRatio(qreal ratio) +void QSGSoftwareLayer::setDevicePixelRatio(qreal ratio) { m_device_pixel_ratio = ratio; } -void SoftwareLayer::setMirrorHorizontal(bool mirror) +void QSGSoftwareLayer::setMirrorHorizontal(bool mirror) { if (m_mirrorHorizontal == mirror) return; @@ -184,7 +184,7 @@ void SoftwareLayer::setMirrorHorizontal(bool mirror) markDirtyTexture(); } -void SoftwareLayer::setMirrorVertical(bool mirror) +void QSGSoftwareLayer::setMirrorVertical(bool mirror) { if (m_mirrorVertical == mirror) return; @@ -192,7 +192,7 @@ void SoftwareLayer::setMirrorVertical(bool mirror) markDirtyTexture(); } -void SoftwareLayer::markDirtyTexture() +void QSGSoftwareLayer::markDirtyTexture() { m_dirtyTexture = true; if (m_live || m_grab) { @@ -200,13 +200,13 @@ void SoftwareLayer::markDirtyTexture() } } -void SoftwareLayer::invalidated() +void QSGSoftwareLayer::invalidated() { delete m_renderer; m_renderer = 0; } -void SoftwareLayer::grab() +void QSGSoftwareLayer::grab() { if (!m_item || m_size.isNull()) { m_pixmap = QPixmap(); @@ -220,7 +220,7 @@ void SoftwareLayer::grab() return; if (!m_renderer) { - m_renderer = new SoftwareContext::PixmapRenderer(m_context); + m_renderer = new SoftwareContext::QSGSoftwarePixmapRenderer(m_context); connect(m_renderer, SIGNAL(sceneGraphChanged()), this, SLOT(markDirtyTexture())); } m_renderer->setDevicePixelRatio(m_device_pixel_ratio); diff --git a/src/plugins/scenegraph/softwarecontext/softwarelayer.h b/src/plugins/scenegraph/softwarecontext/qsgsoftwarelayer_p.h index 4ae9a7b015..39cb4ced22 100644 --- a/src/plugins/scenegraph/softwarecontext/softwarelayer.h +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwarelayer_p.h @@ -37,8 +37,8 @@ ** ****************************************************************************/ -#ifndef SOFTWARELAYER_H -#define SOFTWARELAYER_H +#ifndef QSGSOFTWARELAYER_H +#define QSGSOFTWARELAYER_H #include <private/qsgadaptationlayer_p.h> #include <private/qsgcontext_p.h> @@ -46,15 +46,15 @@ QT_BEGIN_NAMESPACE namespace SoftwareContext { -class PixmapRenderer; +class QSGSoftwarePixmapRenderer; } -class SoftwareLayer : public QSGLayer +class QSGSoftwareLayer : public QSGLayer { Q_OBJECT public: - SoftwareLayer(QSGRenderContext *renderContext); - ~SoftwareLayer(); + QSGSoftwareLayer(QSGRenderContext *renderContext); + ~QSGSoftwareLayer(); const QPixmap &pixmap() const { return m_pixmap; } @@ -94,7 +94,7 @@ private: QSGNode *m_item; QSGRenderContext *m_context; - SoftwareContext::PixmapRenderer *m_renderer; + SoftwareContext::QSGSoftwarePixmapRenderer *m_renderer; QRectF m_rect; QSize m_size; QPixmap m_pixmap; @@ -109,4 +109,4 @@ private: QT_END_NAMESPACE -#endif // SOFTWARELAYER_H +#endif // QSGSOFTWARELAYER_H diff --git a/src/plugins/scenegraph/softwarecontext/ninepatchnode.cpp b/src/plugins/scenegraph/softwarecontext/qsgsoftwareninepatchnode.cpp index d2ef95786b..24bf9d9e4a 100644 --- a/src/plugins/scenegraph/softwarecontext/ninepatchnode.cpp +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwareninepatchnode.cpp @@ -37,21 +37,21 @@ ** ****************************************************************************/ -#include "ninepatchnode.h" -#include "pixmaptexture.h" -#include "imagenode.h" +#include "qsgsoftwareninepatchnode_p.h" +#include "qsgsoftwarepixmaptexture_p.h" +#include "qsgsoftwareimagenode_p.h" QT_BEGIN_NAMESPACE -NinePatchNode::NinePatchNode() +QSGSoftwareNinePatchNode::QSGSoftwareNinePatchNode() { setMaterial((QSGMaterial*)1); setGeometry((QSGGeometry*)1); } -void NinePatchNode::setTexture(QSGTexture *texture) +void QSGSoftwareNinePatchNode::setTexture(QSGTexture *texture) { - PixmapTexture *pt = qobject_cast<PixmapTexture*>(texture); + QSGSoftwarePixmapTexture *pt = qobject_cast<QSGSoftwarePixmapTexture*>(texture); if (!pt) { qWarning() << "Image used with invalid texture format."; return; @@ -60,7 +60,7 @@ void NinePatchNode::setTexture(QSGTexture *texture) markDirty(DirtyMaterial); } -void NinePatchNode::setBounds(const QRectF &bounds) +void QSGSoftwareNinePatchNode::setBounds(const QRectF &bounds) { if (m_bounds == bounds) return; @@ -69,7 +69,7 @@ void NinePatchNode::setBounds(const QRectF &bounds) markDirty(DirtyGeometry); } -void NinePatchNode::setDevicePixelRatio(qreal ratio) +void QSGSoftwareNinePatchNode::setDevicePixelRatio(qreal ratio) { if (m_pixelRatio == ratio) return; @@ -78,7 +78,7 @@ void NinePatchNode::setDevicePixelRatio(qreal ratio) markDirty(DirtyGeometry); } -void NinePatchNode::setPadding(qreal left, qreal top, qreal right, qreal bottom) +void QSGSoftwareNinePatchNode::setPadding(qreal left, qreal top, qreal right, qreal bottom) { QMargins margins(qRound(left), qRound(top), qRound(right), qRound(bottom)); if (m_margins == margins) @@ -88,11 +88,11 @@ void NinePatchNode::setPadding(qreal left, qreal top, qreal right, qreal bottom) markDirty(DirtyGeometry); } -void NinePatchNode::update() +void QSGSoftwareNinePatchNode::update() { } -void NinePatchNode::paint(QPainter *painter) +void QSGSoftwareNinePatchNode::paint(QPainter *painter) { if (m_margins.isNull()) painter->drawPixmap(m_bounds, m_pixmap, QRectF(0, 0, m_pixmap.width(), m_pixmap.height())); @@ -101,7 +101,7 @@ void NinePatchNode::paint(QPainter *painter) m_margins, Qt::StretchTile, QDrawBorderPixmap::DrawingHints(0)); } -QRectF NinePatchNode::bounds() const +QRectF QSGSoftwareNinePatchNode::bounds() const { return m_bounds; } diff --git a/src/plugins/scenegraph/softwarecontext/ninepatchnode.h b/src/plugins/scenegraph/softwarecontext/qsgsoftwareninepatchnode_p.h index 3616dcd062..68db5e1284 100644 --- a/src/plugins/scenegraph/softwarecontext/ninepatchnode.h +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwareninepatchnode_p.h @@ -37,17 +37,17 @@ ** ****************************************************************************/ -#ifndef NINEPATCHNODE_H -#define NINEPATCHNODE_H +#ifndef QSGSOFTWARENINEPATCHNODE_H +#define QSGSOFTWARENINEPATCHNODE_H #include <private/qsgadaptationlayer_p.h> QT_BEGIN_NAMESPACE -class NinePatchNode : public QSGNinePatchNode +class QSGSoftwareNinePatchNode : public QSGNinePatchNode { public: - NinePatchNode(); + QSGSoftwareNinePatchNode(); void setTexture(QSGTexture *texture) override; void setBounds(const QRectF &bounds) override; @@ -68,4 +68,4 @@ private: QT_END_NAMESPACE -#endif // NINEPATCHNODE_H +#endif // QSGSOFTWARENINEPATCHNODE_H diff --git a/src/plugins/scenegraph/softwarecontext/painternode.cpp b/src/plugins/scenegraph/softwarecontext/qsgsoftwarepainternode.cpp index c6b0988959..dc244d0894 100644 --- a/src/plugins/scenegraph/softwarecontext/painternode.cpp +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwarepainternode.cpp @@ -37,13 +37,13 @@ ** ****************************************************************************/ -#include "painternode.h" -#include "pixmaptexture.h" +#include "qsgsoftwarepainternode_p.h" +#include "qsgsoftwarepixmaptexture_p.h" #include <qmath.h> QT_BEGIN_NAMESPACE -PainterNode::PainterNode(QQuickPaintedItem *item) +QSGSoftwarePainterNode::QSGSoftwarePainterNode(QQuickPaintedItem *item) : QSGPainterNode() , m_preferredRenderTarget(QQuickPaintedItem::Image) , m_actualRenderTarget(QQuickPaintedItem::Image) @@ -65,12 +65,12 @@ PainterNode::PainterNode(QQuickPaintedItem *item) setGeometry((QSGGeometry*)1); } -PainterNode::~PainterNode() +QSGSoftwarePainterNode::~QSGSoftwarePainterNode() { delete m_texture; } -void PainterNode::setPreferredRenderTarget(QQuickPaintedItem::RenderTarget target) +void QSGSoftwarePainterNode::setPreferredRenderTarget(QQuickPaintedItem::RenderTarget target) { if (m_preferredRenderTarget == target) return; @@ -78,7 +78,7 @@ void PainterNode::setPreferredRenderTarget(QQuickPaintedItem::RenderTarget targe m_preferredRenderTarget = target; } -void PainterNode::setSize(const QSize &size) +void QSGSoftwarePainterNode::setSize(const QSize &size) { if (size == m_size) return; @@ -88,14 +88,14 @@ void PainterNode::setSize(const QSize &size) m_dirtyGeometry = true; } -void PainterNode::setDirty(const QRect &dirtyRect) +void QSGSoftwarePainterNode::setDirty(const QRect &dirtyRect) { m_dirtyContents = true; m_dirtyRect = dirtyRect; markDirty(DirtyMaterial); } -void PainterNode::setOpaquePainting(bool opaque) +void QSGSoftwarePainterNode::setOpaquePainting(bool opaque) { if (opaque == m_opaquePainting) return; @@ -103,7 +103,7 @@ void PainterNode::setOpaquePainting(bool opaque) m_opaquePainting = opaque; } -void PainterNode::setLinearFiltering(bool linearFiltering) +void QSGSoftwarePainterNode::setLinearFiltering(bool linearFiltering) { if (linearFiltering == m_linear_filtering) return; @@ -111,7 +111,7 @@ void PainterNode::setLinearFiltering(bool linearFiltering) m_linear_filtering = linearFiltering; } -void PainterNode::setMipmapping(bool mipmapping) +void QSGSoftwarePainterNode::setMipmapping(bool mipmapping) { if (mipmapping == m_mipmapping) return; @@ -119,7 +119,7 @@ void PainterNode::setMipmapping(bool mipmapping) m_mipmapping = mipmapping; } -void PainterNode::setSmoothPainting(bool s) +void QSGSoftwarePainterNode::setSmoothPainting(bool s) { if (s == m_smoothPainting) return; @@ -127,7 +127,7 @@ void PainterNode::setSmoothPainting(bool s) m_smoothPainting = s; } -void PainterNode::setFillColor(const QColor &c) +void QSGSoftwarePainterNode::setFillColor(const QColor &c) { if (c == m_fillColor) return; @@ -136,7 +136,7 @@ void PainterNode::setFillColor(const QColor &c) markDirty(DirtyMaterial); } -void PainterNode::setContentsScale(qreal s) +void QSGSoftwarePainterNode::setContentsScale(qreal s) { if (s == m_contentsScale) return; @@ -145,17 +145,17 @@ void PainterNode::setContentsScale(qreal s) markDirty(DirtyMaterial); } -void PainterNode::setFastFBOResizing(bool dynamic) +void QSGSoftwarePainterNode::setFastFBOResizing(bool dynamic) { m_fastFBOResizing = dynamic; } -QImage PainterNode::toImage() const +QImage QSGSoftwarePainterNode::toImage() const { return m_pixmap.toImage(); } -void PainterNode::update() +void QSGSoftwarePainterNode::update() { if (m_dirtyGeometry) { m_pixmap = QPixmap(m_textureSize); @@ -164,7 +164,7 @@ void PainterNode::update() if (m_texture) delete m_texture; - m_texture = new PixmapTexture(m_pixmap); + m_texture = new QSGSoftwarePixmapTexture(m_pixmap); } if (m_dirtyContents) @@ -174,12 +174,12 @@ void PainterNode::update() m_dirtyContents = false; } -void PainterNode::paint(QPainter *painter) +void QSGSoftwarePainterNode::paint(QPainter *painter) { painter->drawPixmap(0, 0, m_size.width(), m_size.height(), m_pixmap); } -void PainterNode::paint() +void QSGSoftwarePainterNode::paint() { QRect dirtyRect = m_dirtyRect.isNull() ? QRect(0, 0, m_size.width(), m_size.height()) : m_dirtyRect; @@ -222,7 +222,7 @@ void PainterNode::paint() } -void PainterNode::setTextureSize(const QSize &size) +void QSGSoftwarePainterNode::setTextureSize(const QSize &size) { if (size == m_textureSize) return; diff --git a/src/plugins/scenegraph/softwarecontext/painternode.h b/src/plugins/scenegraph/softwarecontext/qsgsoftwarepainternode_p.h index bb1f4137f1..27f6f1cc0a 100644 --- a/src/plugins/scenegraph/softwarecontext/painternode.h +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwarepainternode_p.h @@ -37,8 +37,8 @@ ** ****************************************************************************/ -#ifndef PAINTERNODE_H -#define PAINTERNODE_H +#ifndef QSGSOFTWAREPAINTERNODE_H +#define QSGSOFTWAREPAINTERNODE_H #include <private/qsgadaptationlayer_p.h> #include <QtQuick/qquickpainteditem.h> @@ -47,11 +47,11 @@ QT_BEGIN_NAMESPACE -class PainterNode : public QSGPainterNode +class QSGSoftwarePainterNode : public QSGPainterNode { public: - PainterNode(QQuickPaintedItem *item); - ~PainterNode(); + QSGSoftwarePainterNode(QQuickPaintedItem *item); + ~QSGSoftwarePainterNode(); void setPreferredRenderTarget(QQuickPaintedItem::RenderTarget target) override; @@ -121,4 +121,4 @@ private: QT_END_NAMESPACE -#endif // PAINTERNODE_H +#endif // QSGSOFTWAREPAINTERNODE_H diff --git a/src/plugins/scenegraph/softwarecontext/pixmaprenderer.cpp b/src/plugins/scenegraph/softwarecontext/qsgsoftwarepixmaprenderer.cpp index af201628ef..f860d7db68 100644 --- a/src/plugins/scenegraph/softwarecontext/pixmaprenderer.cpp +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwarepixmaprenderer.cpp @@ -37,7 +37,7 @@ ** ****************************************************************************/ -#include "pixmaprenderer.h" +#include "qsgsoftwarepixmaprenderer_p.h" #include <QtQuick/QSGSimpleRectNode> @@ -49,18 +49,18 @@ QT_BEGIN_NAMESPACE namespace SoftwareContext { -PixmapRenderer::PixmapRenderer(QSGRenderContext *context) - : AbstractSoftwareRenderer(context) +QSGSoftwarePixmapRenderer::QSGSoftwarePixmapRenderer(QSGRenderContext *context) + : QSGAbstractSoftwareRenderer(context) { } -PixmapRenderer::~PixmapRenderer() +QSGSoftwarePixmapRenderer::~QSGSoftwarePixmapRenderer() { } -void PixmapRenderer::renderScene(GLuint) +void QSGSoftwarePixmapRenderer::renderScene(GLuint) { class B : public QSGBindable { @@ -70,12 +70,12 @@ void PixmapRenderer::renderScene(GLuint) QSGRenderer::renderScene(bindable); } -void PixmapRenderer::render() +void QSGSoftwarePixmapRenderer::render() { } -void PixmapRenderer::render(QPixmap *target) +void QSGSoftwarePixmapRenderer::render(QPixmap *target) { QElapsedTimer renderTimer; @@ -105,7 +105,7 @@ void PixmapRenderer::render(QPixmap *target) qCDebug(lcPixmapRenderer) << "pixmapRender" << paintedRegion << buildRenderListTime << optimizeRenderListTime << renderTime; } -void PixmapRenderer::setProjectionRect(const QRect &projectionRect) +void QSGSoftwarePixmapRenderer::setProjectionRect(const QRect &projectionRect) { m_projectionRect = projectionRect; } diff --git a/src/plugins/scenegraph/softwarecontext/pixmaprenderer.h b/src/plugins/scenegraph/softwarecontext/qsgsoftwarepixmaprenderer_p.h index 4fd39d628c..b20c095bff 100644 --- a/src/plugins/scenegraph/softwarecontext/pixmaprenderer.h +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwarepixmaprenderer_p.h @@ -37,20 +37,20 @@ ** ****************************************************************************/ -#ifndef PIXMAPRENDERER_H -#define PIXMAPRENDERER_H +#ifndef QSGSOFTWAREPIXMAPRENDERER_H +#define QSGSOFTWAREPIXMAPRENDERER_H -#include "abstractsoftwarerenderer.h" +#include "qsgabstractsoftwarerenderer_p.h" QT_BEGIN_NAMESPACE namespace SoftwareContext { -class PixmapRenderer : public AbstractSoftwareRenderer +class QSGSoftwarePixmapRenderer : public QSGAbstractSoftwareRenderer { public: - PixmapRenderer(QSGRenderContext *context); - virtual ~PixmapRenderer(); + QSGSoftwarePixmapRenderer(QSGRenderContext *context); + virtual ~QSGSoftwarePixmapRenderer(); void renderScene(GLuint fboId = 0) final; void render() final; @@ -66,4 +66,4 @@ private: QT_END_NAMESPACE -#endif // PIXMAPRENDERER_H +#endif // QSGSOFTWAREPIXMAPRENDERER_H diff --git a/src/plugins/scenegraph/softwarecontext/pixmaptexture.cpp b/src/plugins/scenegraph/softwarecontext/qsgsoftwarepixmaptexture.cpp index 363646d47e..e04c400af3 100644 --- a/src/plugins/scenegraph/softwarecontext/pixmaptexture.cpp +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwarepixmaptexture.cpp @@ -37,44 +37,44 @@ ** ****************************************************************************/ -#include "pixmaptexture.h" +#include "qsgsoftwarepixmaptexture_p.h" QT_BEGIN_NAMESPACE -PixmapTexture::PixmapTexture(const QImage &image) +QSGSoftwarePixmapTexture::QSGSoftwarePixmapTexture(const QImage &image) // Prevent pixmap format conversion to reduce memory consumption // and surprises in calling code. (See QTBUG-47328) : m_pixmap(QPixmap::fromImage(image, Qt::NoFormatConversion)) { } -PixmapTexture::PixmapTexture(const QPixmap &pixmap) +QSGSoftwarePixmapTexture::QSGSoftwarePixmapTexture(const QPixmap &pixmap) : m_pixmap(pixmap) { } -int PixmapTexture::textureId() const +int QSGSoftwarePixmapTexture::textureId() const { return 0; } -QSize PixmapTexture::textureSize() const +QSize QSGSoftwarePixmapTexture::textureSize() const { return m_pixmap.size(); } -bool PixmapTexture::hasAlphaChannel() const +bool QSGSoftwarePixmapTexture::hasAlphaChannel() const { return m_pixmap.hasAlphaChannel(); } -bool PixmapTexture::hasMipmaps() const +bool QSGSoftwarePixmapTexture::hasMipmaps() const { return false; } -void PixmapTexture::bind() +void QSGSoftwarePixmapTexture::bind() { Q_UNREACHABLE(); } diff --git a/src/plugins/scenegraph/softwarecontext/pixmaptexture.h b/src/plugins/scenegraph/softwarecontext/qsgsoftwarepixmaptexture_p.h index 0eeb5df3e4..0ddbadedae 100644 --- a/src/plugins/scenegraph/softwarecontext/pixmaptexture.h +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwarepixmaptexture_p.h @@ -37,19 +37,19 @@ ** ****************************************************************************/ -#ifndef PIXMAPTEXTURE_H -#define PIXMAPTEXTURE_H +#ifndef QSGSOFTWAREPIXMAPTEXTURE_H +#define QSGSOFTWAREPIXMAPTEXTURE_H #include <private/qsgtexture_p.h> QT_BEGIN_NAMESPACE -class PixmapTexture : public QSGTexture +class QSGSoftwarePixmapTexture : public QSGTexture { Q_OBJECT public: - PixmapTexture(const QImage &image); - PixmapTexture(const QPixmap &pixmap); + QSGSoftwarePixmapTexture(const QImage &image); + QSGSoftwarePixmapTexture(const QPixmap &pixmap); int textureId() const override; QSize textureSize() const override; @@ -65,4 +65,4 @@ private: QT_END_NAMESPACE -#endif // PIXMAPTEXTURE_H +#endif // QSGSOFTWAREPIXMAPTEXTURE_H diff --git a/src/plugins/scenegraph/softwarecontext/rectanglenode.cpp b/src/plugins/scenegraph/softwarecontext/qsgsoftwarerectanglenode.cpp index f6cef20a8e..4acb25204e 100644 --- a/src/plugins/scenegraph/softwarecontext/rectanglenode.cpp +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwarerectanglenode.cpp @@ -37,14 +37,14 @@ ** ****************************************************************************/ -#include "rectanglenode.h" +#include "qsgsoftwarerectanglenode_p.h" #include <qmath.h> #include <QtGui/QPainter> QT_BEGIN_NAMESPACE -RectangleNode::RectangleNode() +QSGSoftwareRectangleNode::QSGSoftwareRectangleNode() : m_penWidth(0) , m_radius(0) , m_cornerPixmapIsDirty(true) @@ -56,7 +56,7 @@ RectangleNode::RectangleNode() setGeometry((QSGGeometry*)1); } -void RectangleNode::setRect(const QRectF &rect) +void QSGSoftwareRectangleNode::setRect(const QRectF &rect) { QRect alignedRect = rect.toAlignedRect(); if (m_rect != alignedRect) { @@ -65,7 +65,7 @@ void RectangleNode::setRect(const QRectF &rect) } } -void RectangleNode::setColor(const QColor &color) +void QSGSoftwareRectangleNode::setColor(const QColor &color) { if (m_color != color) { m_color = color; @@ -74,7 +74,7 @@ void RectangleNode::setColor(const QColor &color) } } -void RectangleNode::setPenColor(const QColor &color) +void QSGSoftwareRectangleNode::setPenColor(const QColor &color) { if (m_penColor != color) { m_penColor = color; @@ -83,7 +83,7 @@ void RectangleNode::setPenColor(const QColor &color) } } -void RectangleNode::setPenWidth(qreal width) +void QSGSoftwareRectangleNode::setPenWidth(qreal width) { if (m_penWidth != width) { m_penWidth = width; @@ -113,7 +113,7 @@ static QGradientStop interpolateStop(const QGradientStop &firstStop, const QGrad return newStop; } -void RectangleNode::setGradientStops(const QGradientStops &stops) +void QSGSoftwareRectangleNode::setGradientStops(const QGradientStops &stops) { //normalize stops bool needsNormalization = false; @@ -186,7 +186,7 @@ void RectangleNode::setGradientStops(const QGradientStops &stops) markDirty(DirtyMaterial); } -void RectangleNode::setRadius(qreal radius) +void QSGSoftwareRectangleNode::setRadius(qreal radius) { if (m_radius != radius) { m_radius = radius; @@ -195,11 +195,11 @@ void RectangleNode::setRadius(qreal radius) } } -void RectangleNode::setAligned(bool /*aligned*/) +void QSGSoftwareRectangleNode::setAligned(bool /*aligned*/) { } -void RectangleNode::update() +void QSGSoftwareRectangleNode::update() { if (!m_penWidth || m_penColor == Qt::transparent) { m_pen = Qt::NoPen; @@ -223,7 +223,7 @@ void RectangleNode::update() } } -void RectangleNode::paint(QPainter *painter) +void QSGSoftwareRectangleNode::paint(QPainter *painter) { //We can only check for a device pixel ratio change when we know what //paint device is being used. @@ -265,7 +265,7 @@ void RectangleNode::paint(QPainter *painter) } -bool RectangleNode::isOpaque() const +bool QSGSoftwareRectangleNode::isOpaque() const { if (m_radius > 0.0f) return false; @@ -283,13 +283,13 @@ bool RectangleNode::isOpaque() const return true; } -QRectF RectangleNode::rect() const +QRectF QSGSoftwareRectangleNode::rect() const { //TODO: double check that this is correct. return m_rect; } -void RectangleNode::paintRectangle(QPainter *painter, const QRect &rect) +void QSGSoftwareRectangleNode::paintRectangle(QPainter *painter, const QRect &rect) { //Radius should never exceeds half of the width or half of the height int radius = qFloor(qMin(qMin(rect.width(), rect.height()) * 0.5, m_radius)); @@ -412,7 +412,7 @@ void RectangleNode::paintRectangle(QPainter *painter, const QRect &rect) painter->setRenderHints(previousRenderHints); } -void RectangleNode::generateCornerPixmap() +void QSGSoftwareRectangleNode::generateCornerPixmap() { //Generate new corner Pixmap int radius = qFloor(qMin(qMin(m_rect.width(), m_rect.height()) * 0.5, m_radius)); diff --git a/src/plugins/scenegraph/softwarecontext/rectanglenode.h b/src/plugins/scenegraph/softwarecontext/qsgsoftwarerectanglenode_p.h index d47ad2088f..3af3b39aac 100644 --- a/src/plugins/scenegraph/softwarecontext/rectanglenode.h +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwarerectanglenode_p.h @@ -37,8 +37,8 @@ ** ****************************************************************************/ -#ifndef RECTANGLENODE_H -#define RECTANGLENODE_H +#ifndef QSGSOFTWARERECTANGLENODE_H +#define QSGSOFTWARERECTANGLENODE_H #include <private/qsgadaptationlayer_p.h> @@ -48,10 +48,10 @@ QT_BEGIN_NAMESPACE -class RectangleNode : public QSGRectangleNode +class QSGSoftwareRectangleNode : public QSGRectangleNode { public: - RectangleNode(); + QSGSoftwareRectangleNode(); void setRect(const QRectF &rect) override; void setColor(const QColor &color) override; @@ -89,4 +89,4 @@ private: QT_END_NAMESPACE -#endif // RECTANGLENODE_H +#endif // QSGSOFTWARERECTANGLENODE_H diff --git a/src/plugins/scenegraph/softwarecontext/renderablenode.cpp b/src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderablenode.cpp index 04c575776b..b136a9a489 100644 --- a/src/plugins/scenegraph/softwarecontext/renderablenode.cpp +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderablenode.cpp @@ -37,14 +37,14 @@ ** ****************************************************************************/ -#include "renderablenode.h" +#include "qsgsoftwarerenderablenode_p.h" -#include "imagenode.h" -#include "rectanglenode.h" -#include "glyphnode.h" -#include "ninepatchnode.h" -#include "painternode.h" -#include "pixmaptexture.h" +#include "qsgsoftwareimagenode_p.h" +#include "qsgsoftwarerectanglenode_p.h" +#include "qsgsoftwareglyphnode_p.h" +#include "qsgsoftwareninepatchnode_p.h" +#include "qsgsoftwarepainternode_p.h" +#include "qsgsoftwarepixmaptexture_p.h" #include <QtQuick/QSGSimpleRectNode> #include <QtQuick/qsgsimpletexturenode.h> @@ -57,46 +57,46 @@ QT_BEGIN_NAMESPACE namespace SoftwareContext{ -RenderableNode::RenderableNode(NodeType type, QSGNode *node) +QSGSoftwareRenderableNode::QSGSoftwareRenderableNode(NodeType type, QSGNode *node) : m_nodeType(type) , m_isOpaque(true) , m_isDirty(true) , m_opacity(1.0f) { switch (m_nodeType) { - case RenderableNode::SimpleRect: + case QSGSoftwareRenderableNode::SimpleRect: m_handle.simpleRectNode = static_cast<QSGSimpleRectNode*>(node); break; - case RenderableNode::SimpleTexture: + case QSGSoftwareRenderableNode::SimpleTexture: m_handle.simpleTextureNode = static_cast<QSGSimpleTextureNode*>(node); break; - case RenderableNode::Image: - m_handle.imageNode = static_cast<ImageNode*>(node); + case QSGSoftwareRenderableNode::Image: + m_handle.imageNode = static_cast<QSGSoftwareImageNode*>(node); break; - case RenderableNode::Painter: - m_handle.painterNode = static_cast<PainterNode*>(node); + case QSGSoftwareRenderableNode::Painter: + m_handle.painterNode = static_cast<QSGSoftwarePainterNode*>(node); break; - case RenderableNode::Rectangle: - m_handle.rectangleNode = static_cast<RectangleNode*>(node); + case QSGSoftwareRenderableNode::Rectangle: + m_handle.rectangleNode = static_cast<QSGSoftwareRectangleNode*>(node); break; - case RenderableNode::Glyph: - m_handle.glpyhNode = static_cast<GlyphNode*>(node); + case QSGSoftwareRenderableNode::Glyph: + m_handle.glpyhNode = static_cast<QSGSoftwareGlyphNode*>(node); break; - case RenderableNode::NinePatch: - m_handle.ninePatchNode = static_cast<NinePatchNode*>(node); + case QSGSoftwareRenderableNode::NinePatch: + m_handle.ninePatchNode = static_cast<QSGSoftwareNinePatchNode*>(node); break; - case RenderableNode::Invalid: + case QSGSoftwareRenderableNode::Invalid: m_handle.simpleRectNode = nullptr; break; } } -RenderableNode::~RenderableNode() +QSGSoftwareRenderableNode::~QSGSoftwareRenderableNode() { } -void RenderableNode::update() +void QSGSoftwareRenderableNode::update() { // Update the Node properties m_isDirty = true; @@ -104,7 +104,7 @@ void RenderableNode::update() QRect boundingRect; switch (m_nodeType) { - case RenderableNode::SimpleRect: + case QSGSoftwareRenderableNode::SimpleRect: if (m_handle.simpleRectNode->color().alpha() == 255 && !m_transform.isRotating()) m_isOpaque = true; else @@ -112,7 +112,7 @@ void RenderableNode::update() boundingRect = m_handle.simpleRectNode->rect().toRect(); break; - case RenderableNode::SimpleTexture: + case QSGSoftwareRenderableNode::SimpleTexture: if (!m_handle.simpleTextureNode->texture()->hasAlphaChannel() && !m_transform.isRotating()) m_isOpaque = true; else @@ -120,13 +120,13 @@ void RenderableNode::update() boundingRect = m_handle.simpleTextureNode->rect().toRect(); break; - case RenderableNode::Image: + case QSGSoftwareRenderableNode::Image: // There isn't a way to tell, so assume it's not m_isOpaque = false; boundingRect = m_handle.imageNode->rect().toRect(); break; - case RenderableNode::Painter: + case QSGSoftwareRenderableNode::Painter: if (m_handle.painterNode->opaquePainting() && !m_transform.isRotating()) m_isOpaque = true; else @@ -134,7 +134,7 @@ void RenderableNode::update() boundingRect = QRect(0, 0, m_handle.painterNode->size().width(), m_handle.painterNode->size().height()); break; - case RenderableNode::Rectangle: + case QSGSoftwareRenderableNode::Rectangle: if (m_handle.rectangleNode->isOpaque() && !m_transform.isRotating()) m_isOpaque = true; else @@ -142,13 +142,13 @@ void RenderableNode::update() boundingRect = m_handle.rectangleNode->rect().toRect(); break; - case RenderableNode::Glyph: + case QSGSoftwareRenderableNode::Glyph: // Always has alpha m_isOpaque = false; boundingRect = m_handle.glpyhNode->boundingRect().toAlignedRect(); break; - case RenderableNode::NinePatch: + case QSGSoftwareRenderableNode::NinePatch: // Difficult to tell, assume non-opaque m_isOpaque = false; @@ -171,7 +171,7 @@ void RenderableNode::update() m_dirtyRegion = QRegion(m_boundingRect); } -QRegion RenderableNode::renderNode(QPainter *painter, bool forceOpaquePainting) +QRegion QSGSoftwareRenderableNode::renderNode(QPainter *painter, bool forceOpaquePainting) { Q_ASSERT(painter); @@ -194,13 +194,13 @@ QRegion RenderableNode::renderNode(QPainter *painter, bool forceOpaquePainting) painter->setCompositionMode(QPainter::CompositionMode_Source); switch (m_nodeType) { - case RenderableNode::SimpleRect: + case QSGSoftwareRenderableNode::SimpleRect: painter->fillRect(m_handle.simpleRectNode->rect(), m_handle.simpleRectNode->color()); break; - case RenderableNode::SimpleTexture: + case QSGSoftwareRenderableNode::SimpleTexture: { QSGTexture *texture = m_handle.simpleTextureNode->texture(); - if (PixmapTexture *pt = dynamic_cast<PixmapTexture *>(texture)) { + if (QSGSoftwarePixmapTexture *pt = dynamic_cast<QSGSoftwarePixmapTexture *>(texture)) { const QPixmap &pm = pt->pixmap(); painter->drawPixmap(m_handle.simpleTextureNode->rect(), pm, QRectF(0, 0, pm.width(), pm.height())); } else if (QSGPlainTexture *pt = dynamic_cast<QSGPlainTexture *>(texture)) { @@ -209,19 +209,19 @@ QRegion RenderableNode::renderNode(QPainter *painter, bool forceOpaquePainting) } } break; - case RenderableNode::Image: + case QSGSoftwareRenderableNode::Image: m_handle.imageNode->paint(painter); break; - case RenderableNode::Painter: + case QSGSoftwareRenderableNode::Painter: m_handle.painterNode->paint(painter); break; - case RenderableNode::Rectangle: + case QSGSoftwareRenderableNode::Rectangle: m_handle.rectangleNode->paint(painter); break; - case RenderableNode::Glyph: + case QSGSoftwareRenderableNode::Glyph: m_handle.glpyhNode->paint(painter); break; - case RenderableNode::NinePatch: + case QSGSoftwareRenderableNode::NinePatch: m_handle.ninePatchNode->paint(painter); break; default: @@ -238,18 +238,18 @@ QRegion RenderableNode::renderNode(QPainter *painter, bool forceOpaquePainting) return areaToBeFlushed; } -QRect RenderableNode::boundingRect() const +QRect QSGSoftwareRenderableNode::boundingRect() const { // This returns the bounding area of a renderable node in world coordinates return m_boundingRect; } -bool RenderableNode::isDirtyRegionEmpty() const +bool QSGSoftwareRenderableNode::isDirtyRegionEmpty() const { return m_dirtyRegion.isEmpty(); } -void RenderableNode::setTransform(const QTransform &transform) +void QSGSoftwareRenderableNode::setTransform(const QTransform &transform) { if (m_transform == transform) return; @@ -257,7 +257,7 @@ void RenderableNode::setTransform(const QTransform &transform) update(); } -void RenderableNode::setClipRect(const QRectF &clipRect) +void QSGSoftwareRenderableNode::setClipRect(const QRectF &clipRect) { if (m_clipRect == clipRect) return; @@ -266,7 +266,7 @@ void RenderableNode::setClipRect(const QRectF &clipRect) update(); } -void RenderableNode::setOpacity(float opacity) +void QSGSoftwareRenderableNode::setOpacity(float opacity) { if (qFuzzyCompare(m_opacity, opacity)) return; @@ -275,17 +275,17 @@ void RenderableNode::setOpacity(float opacity) update(); } -void RenderableNode::markGeometryDirty() +void QSGSoftwareRenderableNode::markGeometryDirty() { update(); } -void RenderableNode::markMaterialDirty() +void QSGSoftwareRenderableNode::markMaterialDirty() { update(); } -void RenderableNode::addDirtyRegion(const QRegion &dirtyRegion, bool forceDirty) +void QSGSoftwareRenderableNode::addDirtyRegion(const QRegion &dirtyRegion, bool forceDirty) { // Check if the dirty region applys to this node QRegion prev = m_dirtyRegion; @@ -297,7 +297,7 @@ void RenderableNode::addDirtyRegion(const QRegion &dirtyRegion, bool forceDirty) qCDebug(lcRenderable) << "addDirtyRegion: " << dirtyRegion << "old dirtyRegion: " << prev << "new dirtyRegion: " << m_dirtyRegion; } -void RenderableNode::subtractDirtyRegion(const QRegion &dirtyRegion) +void QSGSoftwareRenderableNode::subtractDirtyRegion(const QRegion &dirtyRegion) { QRegion prev = m_dirtyRegion; if (m_isDirty) { @@ -311,12 +311,12 @@ void RenderableNode::subtractDirtyRegion(const QRegion &dirtyRegion) qCDebug(lcRenderable) << "subtractDirtyRegion: " << dirtyRegion << "old dirtyRegion" << prev << "new dirtyRegion: " << m_dirtyRegion; } -QRegion RenderableNode::previousDirtyRegion() const +QRegion QSGSoftwareRenderableNode::previousDirtyRegion() const { return m_previousDirtyRegion.subtracted(QRegion(m_boundingRect)); } -QRegion RenderableNode::dirtyRegion() const +QRegion QSGSoftwareRenderableNode::dirtyRegion() const { return m_dirtyRegion; } diff --git a/src/plugins/scenegraph/softwarecontext/renderablenode.h b/src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderablenode_p.h index 1973a310de..3c1b39cd3b 100644 --- a/src/plugins/scenegraph/softwarecontext/renderablenode.h +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderablenode_p.h @@ -37,8 +37,8 @@ ** ****************************************************************************/ -#ifndef RENDERABLENODE_H -#define RENDERABLENODE_H +#ifndef QSGSOFTWARERENDERABLENODE_H +#define QSGSOFTWARERENDERABLENODE_H #include <QtGui/QRegion> #include <QtCore/QRect> @@ -49,15 +49,15 @@ QT_BEGIN_NAMESPACE class QSGNode; class QSGSimpleRectNode; class QSGSimpleTextureNode; -class ImageNode; -class PainterNode; -class RectangleNode; -class GlyphNode; -class NinePatchNode; +class QSGSoftwareImageNode; +class QSGSoftwarePainterNode; +class QSGSoftwareRectangleNode; +class QSGSoftwareGlyphNode; +class QSGSoftwareNinePatchNode; namespace SoftwareContext{ -class RenderableNode +class QSGSoftwareRenderableNode { public: enum NodeType { @@ -71,8 +71,8 @@ public: NinePatch }; - RenderableNode(NodeType type, QSGNode *node); - ~RenderableNode(); + QSGSoftwareRenderableNode(NodeType type, QSGNode *node); + ~QSGSoftwareRenderableNode(); void update(); @@ -103,11 +103,11 @@ private: union RenderableNodeHandle { QSGSimpleRectNode *simpleRectNode; QSGSimpleTextureNode *simpleTextureNode; - ImageNode *imageNode; - PainterNode *painterNode; - RectangleNode *rectangleNode; - GlyphNode *glpyhNode; - NinePatchNode *ninePatchNode; + QSGSoftwareImageNode *imageNode; + QSGSoftwarePainterNode *painterNode; + QSGSoftwareRectangleNode *rectangleNode; + QSGSoftwareGlyphNode *glpyhNode; + QSGSoftwareNinePatchNode *ninePatchNode; }; const NodeType m_nodeType; @@ -130,4 +130,4 @@ private: QT_END_NAMESPACE -#endif // RENDERABLENODE_H +#endif // QSGSOFTWARERENDERABLENODE_H diff --git a/src/plugins/scenegraph/softwarecontext/renderablenodeupdater.cpp b/src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderablenodeupdater.cpp index 037cba413d..3f739f6e73 100644 --- a/src/plugins/scenegraph/softwarecontext/renderablenodeupdater.cpp +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderablenodeupdater.cpp @@ -37,15 +37,15 @@ ** ****************************************************************************/ -#include "renderablenodeupdater.h" +#include "qsgsoftwarerenderablenodeupdater_p.h" -#include "abstractsoftwarerenderer.h" -#include "imagenode.h" -#include "rectanglenode.h" -#include "glyphnode.h" -#include "ninepatchnode.h" -#include "painternode.h" -#include "pixmaptexture.h" +#include "qsgabstractsoftwarerenderer_p.h" +#include "qsgsoftwareimagenode_p.h" +#include "qsgsoftwarerectanglenode_p.h" +#include "qsgsoftwareglyphnode_p.h" +#include "qsgsoftwareninepatchnode_p.h" +#include "qsgsoftwarepainternode_p.h" +#include "qsgsoftwarepixmaptexture_p.h" #include <QtQuick/QSGSimpleRectNode> #include <QtQuick/qsgsimpletexturenode.h> @@ -54,7 +54,7 @@ QT_BEGIN_NAMESPACE namespace SoftwareContext { -RenderableNodeUpdater::RenderableNodeUpdater(AbstractSoftwareRenderer *renderer) +QSGSoftwareRenderableNodeUpdater::QSGSoftwareRenderableNodeUpdater(QSGAbstractSoftwareRenderer *renderer) : m_renderer(renderer) { m_opacityState.push(1.0f); @@ -63,24 +63,24 @@ RenderableNodeUpdater::RenderableNodeUpdater(AbstractSoftwareRenderer *renderer) m_transformState.push(QTransform()); } -RenderableNodeUpdater::~RenderableNodeUpdater() +QSGSoftwareRenderableNodeUpdater::~QSGSoftwareRenderableNodeUpdater() { } -bool RenderableNodeUpdater::visit(QSGTransformNode *node) +bool QSGSoftwareRenderableNodeUpdater::visit(QSGTransformNode *node) { m_transformState.push(node->matrix().toTransform() * m_transformState.top()); m_stateMap[node] = currentState(node); return true; } -void RenderableNodeUpdater::endVisit(QSGTransformNode *) +void QSGSoftwareRenderableNodeUpdater::endVisit(QSGTransformNode *) { m_transformState.pop(); } -bool RenderableNodeUpdater::visit(QSGClipNode *node) +bool QSGSoftwareRenderableNodeUpdater::visit(QSGClipNode *node) { // Make sure to translate the clip rect into world coordinates if (!m_clipState.top().isValid()) @@ -91,95 +91,95 @@ bool RenderableNodeUpdater::visit(QSGClipNode *node) return true; } -void RenderableNodeUpdater::endVisit(QSGClipNode *) +void QSGSoftwareRenderableNodeUpdater::endVisit(QSGClipNode *) { m_clipState.pop(); } -bool RenderableNodeUpdater::visit(QSGGeometryNode *node) +bool QSGSoftwareRenderableNodeUpdater::visit(QSGGeometryNode *node) { if (QSGSimpleRectNode *rectNode = dynamic_cast<QSGSimpleRectNode *>(node)) { - return updateRenderableNode(RenderableNode::SimpleRect, rectNode); + return updateRenderableNode(QSGSoftwareRenderableNode::SimpleRect, rectNode); } else if (QSGSimpleTextureNode *tn = dynamic_cast<QSGSimpleTextureNode *>(node)) { - return updateRenderableNode(RenderableNode::SimpleTexture, tn); + return updateRenderableNode(QSGSoftwareRenderableNode::SimpleTexture, tn); } else { // We dont know, so skip return false; } } -void RenderableNodeUpdater::endVisit(QSGGeometryNode *) +void QSGSoftwareRenderableNodeUpdater::endVisit(QSGGeometryNode *) { } -bool RenderableNodeUpdater::visit(QSGOpacityNode *node) +bool QSGSoftwareRenderableNodeUpdater::visit(QSGOpacityNode *node) { m_opacityState.push(m_opacityState.top() * node->opacity()); m_stateMap[node] = currentState(node); return true; } -void RenderableNodeUpdater::endVisit(QSGOpacityNode *) +void QSGSoftwareRenderableNodeUpdater::endVisit(QSGOpacityNode *) { m_opacityState.pop(); } -bool RenderableNodeUpdater::visit(QSGImageNode *node) +bool QSGSoftwareRenderableNodeUpdater::visit(QSGImageNode *node) { - return updateRenderableNode(RenderableNode::Image, node); + return updateRenderableNode(QSGSoftwareRenderableNode::Image, node); } -void RenderableNodeUpdater::endVisit(QSGImageNode *) +void QSGSoftwareRenderableNodeUpdater::endVisit(QSGImageNode *) { } -bool RenderableNodeUpdater::visit(QSGPainterNode *node) +bool QSGSoftwareRenderableNodeUpdater::visit(QSGPainterNode *node) { - return updateRenderableNode(RenderableNode::Painter, node); + return updateRenderableNode(QSGSoftwareRenderableNode::Painter, node); } -void RenderableNodeUpdater::endVisit(QSGPainterNode *) +void QSGSoftwareRenderableNodeUpdater::endVisit(QSGPainterNode *) { } -bool RenderableNodeUpdater::visit(QSGRectangleNode *node) +bool QSGSoftwareRenderableNodeUpdater::visit(QSGRectangleNode *node) { - return updateRenderableNode(RenderableNode::Rectangle, node); + return updateRenderableNode(QSGSoftwareRenderableNode::Rectangle, node); } -void RenderableNodeUpdater::endVisit(QSGRectangleNode *) +void QSGSoftwareRenderableNodeUpdater::endVisit(QSGRectangleNode *) { } -bool RenderableNodeUpdater::visit(QSGGlyphNode *node) +bool QSGSoftwareRenderableNodeUpdater::visit(QSGGlyphNode *node) { - return updateRenderableNode(RenderableNode::Glyph, node); + return updateRenderableNode(QSGSoftwareRenderableNode::Glyph, node); } -void RenderableNodeUpdater::endVisit(QSGGlyphNode *) +void QSGSoftwareRenderableNodeUpdater::endVisit(QSGGlyphNode *) { } -bool RenderableNodeUpdater::visit(QSGNinePatchNode *node) +bool QSGSoftwareRenderableNodeUpdater::visit(QSGNinePatchNode *node) { - return updateRenderableNode(RenderableNode::NinePatch, node); + return updateRenderableNode(QSGSoftwareRenderableNode::NinePatch, node); } -void RenderableNodeUpdater::endVisit(QSGNinePatchNode *) +void QSGSoftwareRenderableNodeUpdater::endVisit(QSGNinePatchNode *) { } -bool RenderableNodeUpdater::visit(QSGRootNode *node) +bool QSGSoftwareRenderableNodeUpdater::visit(QSGRootNode *node) { m_stateMap[node] = currentState(node); return true; } -void RenderableNodeUpdater::endVisit(QSGRootNode *) +void QSGSoftwareRenderableNodeUpdater::endVisit(QSGRootNode *) { } -void RenderableNodeUpdater::updateNodes(QSGNode *node, bool isNodeRemoved) +void QSGSoftwareRenderableNodeUpdater::updateNodes(QSGNode *node, bool isNodeRemoved) { m_opacityState.clear(); m_clipState.clear(); @@ -264,7 +264,7 @@ void RenderableNodeUpdater::updateNodes(QSGNode *node, bool isNodeRemoved) } } -RenderableNodeUpdater::NodeState RenderableNodeUpdater::currentState(QSGNode *node) const +QSGSoftwareRenderableNodeUpdater::NodeState QSGSoftwareRenderableNodeUpdater::currentState(QSGNode *node) const { NodeState state; state.opacity = m_opacityState.top(); diff --git a/src/plugins/scenegraph/softwarecontext/renderablenodeupdater.h b/src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderablenodeupdater_p.h index d7b76bcfa0..e1bfcadc05 100644 --- a/src/plugins/scenegraph/softwarecontext/renderablenodeupdater.h +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderablenodeupdater_p.h @@ -37,11 +37,11 @@ ** ****************************************************************************/ -#ifndef RENDERABLENODEUPDATER_H -#define RENDERABLENODEUPDATER_H +#ifndef QSGSOFTWARERENDERABLENODEUPDATER_H +#define QSGSOFTWARERENDERABLENODEUPDATER_H -#include "renderablenode.h" -#include "abstractsoftwarerenderer.h" +#include "qsgsoftwarerenderablenode_p.h" +#include "qsgabstractsoftwarerenderer_p.h" #include <private/qsgadaptationlayer_p.h> @@ -53,11 +53,11 @@ QT_BEGIN_NAMESPACE namespace SoftwareContext { -class RenderableNodeUpdater : public QSGNodeVisitorEx +class QSGSoftwareRenderableNodeUpdater : public QSGNodeVisitorEx { public: - RenderableNodeUpdater(AbstractSoftwareRenderer *renderer); - virtual ~RenderableNodeUpdater(); + QSGSoftwareRenderableNodeUpdater(QSGAbstractSoftwareRenderer *renderer); + virtual ~QSGSoftwareRenderableNodeUpdater(); bool visit(QSGTransformNode *) override; void endVisit(QSGTransformNode *) override; @@ -93,9 +93,9 @@ private: NodeState currentState(QSGNode *node) const; template<class NODE> - bool updateRenderableNode(RenderableNode::NodeType type, NODE *node); + bool updateRenderableNode(QSGSoftwareRenderableNode::NodeType type, NODE *node); - AbstractSoftwareRenderer *m_renderer; + QSGAbstractSoftwareRenderer *m_renderer; QStack<float> m_opacityState; QStack<QRectF> m_clipState; QStack<QTransform> m_transformState; @@ -103,12 +103,12 @@ private: }; template<class NODE> -bool RenderableNodeUpdater::updateRenderableNode(RenderableNode::NodeType type, NODE *node) +bool QSGSoftwareRenderableNodeUpdater::updateRenderableNode(QSGSoftwareRenderableNode::NodeType type, NODE *node) { //Check if we already know about node auto renderableNode = m_renderer->renderableNode(node); if (renderableNode == nullptr) { - renderableNode = new RenderableNode(type, node); + renderableNode = new QSGSoftwareRenderableNode(type, node); m_renderer->addNodeMapping(node, renderableNode); } @@ -127,4 +127,4 @@ bool RenderableNodeUpdater::updateRenderableNode(RenderableNode::NodeType type, QT_END_NAMESPACE -#endif // RENDERABLENODEUPDATER_H +#endif // QSGSOFTWARERENDERABLENODEUPDATER_H diff --git a/src/plugins/scenegraph/softwarecontext/renderer.cpp b/src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderer.cpp index 28bf9fd09a..8c41968fab 100644 --- a/src/plugins/scenegraph/softwarecontext/renderer.cpp +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderer.cpp @@ -37,12 +37,12 @@ ** ****************************************************************************/ -#include "renderer.h" +#include "qsgsoftwarerenderer_p.h" -#include "renderablenodeupdater.h" -#include "renderlistbuilder.h" -#include "context.h" -#include "renderablenode.h" +#include "qsgsoftwarerenderablenodeupdater_p.h" +#include "qsgsoftwarerenderlistbuilder_p.h" +#include "qsgsoftwarecontext_p.h" +#include "qsgsoftwarerenderablenode_p.h" #include <QtGui/QWindow> #include <QtQuick/QSGSimpleRectNode> @@ -55,16 +55,16 @@ QT_BEGIN_NAMESPACE namespace SoftwareContext { -Renderer::Renderer(QSGRenderContext *context) - : AbstractSoftwareRenderer(context) +QSGSoftwareRenderer::QSGSoftwareRenderer(QSGRenderContext *context) + : QSGAbstractSoftwareRenderer(context) { } -Renderer::~Renderer() +QSGSoftwareRenderer::~QSGSoftwareRenderer() { } -void Renderer::renderScene(GLuint) +void QSGSoftwareRenderer::renderScene(GLuint) { class B : public QSGBindable { @@ -74,11 +74,11 @@ void Renderer::renderScene(GLuint) QSGRenderer::renderScene(bindable); } -void Renderer::render() +void QSGSoftwareRenderer::render() { QElapsedTimer renderTimer; - QWindow *currentWindow = static_cast<RenderContext*>(m_context)->currentWindow; + QWindow *currentWindow = static_cast<QSGSoftwareRenderContext*>(m_context)->currentWindow; if (!m_backingStore) m_backingStore.reset(new QBackingStore(currentWindow)); diff --git a/src/plugins/scenegraph/softwarecontext/renderer.h b/src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderer_p.h index 9018c284ee..a5f6b1349c 100644 --- a/src/plugins/scenegraph/softwarecontext/renderer.h +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderer_p.h @@ -37,10 +37,10 @@ ** ****************************************************************************/ -#ifndef RENDERER_H -#define RENDERER_H +#ifndef QSGSOFTWARERENDERER_H +#define QSGSOFTWARERENDERER_H -#include "abstractsoftwarerenderer.h" +#include "qsgabstractsoftwarerenderer_p.h" #include <QtGui/QBackingStore> @@ -54,11 +54,11 @@ class QSGSimpleRectNode; namespace SoftwareContext{ -class Renderer : public AbstractSoftwareRenderer +class QSGSoftwareRenderer : public QSGAbstractSoftwareRenderer { public: - Renderer(QSGRenderContext *context); - virtual ~Renderer(); + QSGSoftwareRenderer(QSGRenderContext *context); + virtual ~QSGSoftwareRenderer(); QBackingStore *backingStore() const { return m_backingStore.data(); } @@ -79,4 +79,4 @@ private: QT_END_NAMESPACE -#endif // RENDERER_H +#endif // QSGSOFTWARERENDERER_H diff --git a/src/plugins/scenegraph/softwarecontext/renderlistbuilder.cpp b/src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderlistbuilder.cpp index 4e4405ef07..208b2811ca 100644 --- a/src/plugins/scenegraph/softwarecontext/renderlistbuilder.cpp +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderlistbuilder.cpp @@ -37,16 +37,16 @@ ** ****************************************************************************/ -#include "renderlistbuilder.h" +#include "qsgsoftwarerenderlistbuilder_p.h" -#include "renderablenode.h" -#include "abstractsoftwarerenderer.h" -#include "imagenode.h" -#include "rectanglenode.h" -#include "glyphnode.h" -#include "ninepatchnode.h" -#include "painternode.h" -#include "pixmaptexture.h" +#include "qsgsoftwarerenderablenode_p.h" +#include "qsgabstractsoftwarerenderer_p.h" +#include "qsgsoftwareimagenode_p.h" +#include "qsgsoftwarerectanglenode_p.h" +#include "qsgsoftwareglyphnode_p.h" +#include "qsgsoftwareninepatchnode_p.h" +#include "qsgsoftwarepainternode_p.h" +#include "qsgsoftwarepixmaptexture_p.h" #include <QtQuick/QSGSimpleRectNode> #include <QtQuick/qsgsimpletexturenode.h> @@ -56,103 +56,103 @@ QT_BEGIN_NAMESPACE namespace SoftwareContext { -RenderListBuilder::RenderListBuilder(AbstractSoftwareRenderer *renderer) +QSGSoftwareRenderListBuilder::QSGSoftwareRenderListBuilder(QSGAbstractSoftwareRenderer *renderer) : m_renderer(renderer) { } -bool RenderListBuilder::visit(QSGTransformNode *) +bool QSGSoftwareRenderListBuilder::visit(QSGTransformNode *) { return true; } -void RenderListBuilder::endVisit(QSGTransformNode *) +void QSGSoftwareRenderListBuilder::endVisit(QSGTransformNode *) { } -bool RenderListBuilder::visit(QSGClipNode *) +bool QSGSoftwareRenderListBuilder::visit(QSGClipNode *) { return true; } -void RenderListBuilder::endVisit(QSGClipNode *) +void QSGSoftwareRenderListBuilder::endVisit(QSGClipNode *) { } -bool RenderListBuilder::visit(QSGGeometryNode *node) +bool QSGSoftwareRenderListBuilder::visit(QSGGeometryNode *node) { return addRenderableNode(node); } -void RenderListBuilder::endVisit(QSGGeometryNode *) +void QSGSoftwareRenderListBuilder::endVisit(QSGGeometryNode *) { } -bool RenderListBuilder::visit(QSGOpacityNode *) +bool QSGSoftwareRenderListBuilder::visit(QSGOpacityNode *) { return true; } -void RenderListBuilder::endVisit(QSGOpacityNode *) +void QSGSoftwareRenderListBuilder::endVisit(QSGOpacityNode *) { } -bool RenderListBuilder::visit(QSGImageNode *node) +bool QSGSoftwareRenderListBuilder::visit(QSGImageNode *node) { return addRenderableNode(node); } -void RenderListBuilder::endVisit(QSGImageNode *) +void QSGSoftwareRenderListBuilder::endVisit(QSGImageNode *) { } -bool RenderListBuilder::visit(QSGPainterNode *node) +bool QSGSoftwareRenderListBuilder::visit(QSGPainterNode *node) { return addRenderableNode(node); } -void RenderListBuilder::endVisit(QSGPainterNode *) +void QSGSoftwareRenderListBuilder::endVisit(QSGPainterNode *) { } -bool RenderListBuilder::visit(QSGRectangleNode *node) +bool QSGSoftwareRenderListBuilder::visit(QSGRectangleNode *node) { return addRenderableNode(node); } -void RenderListBuilder::endVisit(QSGRectangleNode *) +void QSGSoftwareRenderListBuilder::endVisit(QSGRectangleNode *) { } -bool RenderListBuilder::visit(QSGGlyphNode *node) +bool QSGSoftwareRenderListBuilder::visit(QSGGlyphNode *node) { return addRenderableNode(node); } -void RenderListBuilder::endVisit(QSGGlyphNode *) +void QSGSoftwareRenderListBuilder::endVisit(QSGGlyphNode *) { } -bool RenderListBuilder::visit(QSGNinePatchNode *node) +bool QSGSoftwareRenderListBuilder::visit(QSGNinePatchNode *node) { return addRenderableNode(node); } -void RenderListBuilder::endVisit(QSGNinePatchNode *) +void QSGSoftwareRenderListBuilder::endVisit(QSGNinePatchNode *) { } -bool RenderListBuilder::visit(QSGRootNode *) +bool QSGSoftwareRenderListBuilder::visit(QSGRootNode *) { return true; } -void RenderListBuilder::endVisit(QSGRootNode *) +void QSGSoftwareRenderListBuilder::endVisit(QSGRootNode *) { } -bool RenderListBuilder::addRenderableNode(QSGNode *node) +bool QSGSoftwareRenderListBuilder::addRenderableNode(QSGNode *node) { auto renderableNode = m_renderer->renderableNode(node); if (renderableNode == nullptr) { diff --git a/src/plugins/scenegraph/softwarecontext/renderlistbuilder.h b/src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderlistbuilder_p.h index 6ef8391605..1c9614c90b 100644 --- a/src/plugins/scenegraph/softwarecontext/renderlistbuilder.h +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderlistbuilder_p.h @@ -37,8 +37,8 @@ ** ****************************************************************************/ -#ifndef RENDERLISTBUILDER_H -#define RENDERLISTBUILDER_H +#ifndef QSGSOFTWARERENDERLISTBUILDER_H +#define QSGSOFTWARERENDERLISTBUILDER_H #include <private/qsgadaptationlayer_p.h> @@ -46,12 +46,12 @@ QT_BEGIN_NAMESPACE namespace SoftwareContext { -class AbstractSoftwareRenderer; +class QSGAbstractSoftwareRenderer; -class RenderListBuilder : public QSGNodeVisitorEx +class QSGSoftwareRenderListBuilder : public QSGNodeVisitorEx { public: - RenderListBuilder(AbstractSoftwareRenderer *renderer); + QSGSoftwareRenderListBuilder(QSGAbstractSoftwareRenderer *renderer); bool visit(QSGTransformNode *) override; void endVisit(QSGTransformNode *) override; @@ -77,11 +77,11 @@ public: private: bool addRenderableNode(QSGNode *node); - AbstractSoftwareRenderer *m_renderer; + QSGAbstractSoftwareRenderer *m_renderer; }; } QT_END_NAMESPACE -#endif // RENDERLISTBUILDER_H +#endif // QSGSOFTWARERENDERLISTBUILDER_H diff --git a/src/plugins/scenegraph/softwarecontext/renderloop.cpp b/src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderloop.cpp index 0e8c248bcc..b46f521a7b 100644 --- a/src/plugins/scenegraph/softwarecontext/renderloop.cpp +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderloop.cpp @@ -37,9 +37,9 @@ ** ****************************************************************************/ -#include "renderloop.h" +#include "qsgsoftwarerenderloop_p.h" -#include "context.h" +#include "qsgsoftwarecontext_p.h" #include <QtCore/QCoreApplication> @@ -49,19 +49,19 @@ QT_BEGIN_NAMESPACE -RenderLoop::RenderLoop() +QSGSoftwareRenderLoop::QSGSoftwareRenderLoop() { sg = QSGContext::createDefaultContext(); rc = sg->createRenderContext(); } -RenderLoop::~RenderLoop() +QSGSoftwareRenderLoop::~QSGSoftwareRenderLoop() { delete rc; delete sg; } -void RenderLoop::show(QQuickWindow *window) +void QSGSoftwareRenderLoop::show(QQuickWindow *window) { WindowData data; data.updatePending = false; @@ -71,13 +71,13 @@ void RenderLoop::show(QQuickWindow *window) maybeUpdate(window); } -void RenderLoop::hide(QQuickWindow *window) +void QSGSoftwareRenderLoop::hide(QQuickWindow *window) { QQuickWindowPrivate *cd = QQuickWindowPrivate::get(window); cd->fireAboutToStop(); } -void RenderLoop::windowDestroyed(QQuickWindow *window) +void QSGSoftwareRenderLoop::windowDestroyed(QQuickWindow *window) { m_windows.remove(window); hide(window); @@ -91,7 +91,7 @@ void RenderLoop::windowDestroyed(QQuickWindow *window) } } -void RenderLoop::renderWindow(QQuickWindow *window) +void QSGSoftwareRenderLoop::renderWindow(QQuickWindow *window) { QQuickWindowPrivate *cd = QQuickWindowPrivate::get(window); if (!cd->isRenderable() || !m_windows.contains(window)) @@ -100,7 +100,7 @@ void RenderLoop::renderWindow(QQuickWindow *window) WindowData &data = const_cast<WindowData &>(m_windows[window]); // ### create QPainter and set up pointer to current window/painter - SoftwareContext::RenderContext *ctx = static_cast<SoftwareContext::RenderContext*>(cd->context); + SoftwareContext::QSGSoftwareRenderContext *ctx = static_cast<SoftwareContext::QSGSoftwareRenderContext*>(cd->context); ctx->currentWindow = window; ctx->initializeIfNeeded(); @@ -174,7 +174,7 @@ void RenderLoop::renderWindow(QQuickWindow *window) maybeUpdate(window); } -void RenderLoop::exposureChanged(QQuickWindow *window) +void QSGSoftwareRenderLoop::exposureChanged(QQuickWindow *window) { if (window->isExposed()) { m_windows[window].updatePending = true; @@ -182,7 +182,7 @@ void RenderLoop::exposureChanged(QQuickWindow *window) } } -QImage RenderLoop::grab(QQuickWindow *window) +QImage QSGSoftwareRenderLoop::grab(QQuickWindow *window) { if (!m_windows.contains(window)) return QImage(); @@ -198,7 +198,7 @@ QImage RenderLoop::grab(QQuickWindow *window) -void RenderLoop::maybeUpdate(QQuickWindow *window) +void QSGSoftwareRenderLoop::maybeUpdate(QQuickWindow *window) { if (!m_windows.contains(window)) return; @@ -207,20 +207,20 @@ void RenderLoop::maybeUpdate(QQuickWindow *window) window->requestUpdate(); } -QSurface::SurfaceType RenderLoop::windowSurfaceType() const +QSurface::SurfaceType QSGSoftwareRenderLoop::windowSurfaceType() const { return QSurface::RasterSurface; } -QSGContext *RenderLoop::sceneGraphContext() const +QSGContext *QSGSoftwareRenderLoop::sceneGraphContext() const { return sg; } -void RenderLoop::handleUpdateRequest(QQuickWindow *window) +void QSGSoftwareRenderLoop::handleUpdateRequest(QQuickWindow *window) { renderWindow(window); } diff --git a/src/plugins/scenegraph/softwarecontext/renderloop.h b/src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderloop_p.h index 33ef4f0f8d..ed69f86eff 100644 --- a/src/plugins/scenegraph/softwarecontext/renderloop.h +++ b/src/plugins/scenegraph/softwarecontext/qsgsoftwarerenderloop_p.h @@ -37,19 +37,19 @@ ** ****************************************************************************/ -#ifndef RENDERLOOP_H -#define RENDERLOOP_H +#ifndef QSGSOFTWARERENDERLOOP_H +#define QSGSOFTWARERENDERLOOP_H #include <private/qsgrenderloop_p.h> QT_BEGIN_NAMESPACE -class RenderLoop : public QSGRenderLoop +class QSGSoftwareRenderLoop : public QSGRenderLoop { Q_OBJECT public: - RenderLoop(); - ~RenderLoop(); + QSGSoftwareRenderLoop(); + ~QSGSoftwareRenderLoop(); void show(QQuickWindow *window) override; void hide(QQuickWindow *window) override; @@ -88,4 +88,4 @@ public: QT_END_NAMESPACE -#endif // RENDERLOOP_H +#endif // QSGSOFTWARERENDERLOOP_H diff --git a/src/plugins/scenegraph/softwarecontext/softwarecontext.pro b/src/plugins/scenegraph/softwarecontext/softwarecontext.pro index 603910b8aa..d9fd9a5f14 100644 --- a/src/plugins/scenegraph/softwarecontext/softwarecontext.pro +++ b/src/plugins/scenegraph/softwarecontext/softwarecontext.pro @@ -13,40 +13,40 @@ QMAKE_TARGET_DESCRIPTION = "Quick 2D Renderer for Qt." #DEFINES += QTQUICK2D_DEBUG_FLUSH SOURCES += \ - context.cpp \ - pluginmain.cpp \ - renderloop.cpp \ - rectanglenode.cpp \ - imagenode.cpp \ - pixmaptexture.cpp \ - glyphnode.cpp \ - ninepatchnode.cpp \ - softwarelayer.cpp \ - painternode.cpp \ - renderablenode.cpp \ - renderer.cpp \ - pixmaprenderer.cpp \ - renderablenodeupdater.cpp \ - renderlistbuilder.cpp \ - abstractsoftwarerenderer.cpp + qsgsoftwarecontext.cpp \ + qsgabstractsoftwarerenderer.cpp \ + qsgsoftwareglyphnode.cpp \ + qsgsoftwareimagenode.cpp \ + qsgsoftwareninepatchnode.cpp \ + qsgsoftwarepainternode.cpp \ + qsgsoftwarerectanglenode.cpp \ + qsgsoftwarepixmaprenderer.cpp \ + qsgsoftwarepixmaptexture.cpp \ + qsgsoftwarerenderablenode.cpp \ + qsgsoftwarerenderablenodeupdater.cpp \ + qsgsoftwarerenderer.cpp \ + qsgsoftwarerenderlistbuilder.cpp \ + qsgsoftwarerenderloop.cpp \ + qsgsoftwarelayer.cpp \ + qsgsoftwarecontextplugin.cpp HEADERS += \ - context.h \ - pluginmain.h \ - renderloop.h \ - rectanglenode.h \ - imagenode.h \ - pixmaptexture.h \ - glyphnode.h \ - ninepatchnode.h \ - softwarelayer.h \ - painternode.h \ - renderablenode.h \ - renderer.h \ - pixmaprenderer.h \ - renderablenodeupdater.h \ - renderlistbuilder.h \ - abstractsoftwarerenderer.h + qsgsoftwarecontext_p.h \ + qsgabstractsoftwarerenderer_p.h \ + qsgsoftwareglyphnode_p.h \ + qsgsoftwareimagenode_p.h \ + qsgsoftwareninepatchnode_p.h \ + qsgsoftwarepainternode_p.h \ + qsgsoftwarepixmaprenderer_p.h \ + qsgsoftwarepixmaptexture_p.h \ + qsgsoftwarerectanglenode_p.h \ + qsgsoftwarerenderablenode_p.h \ + qsgsoftwarerenderablenodeupdater_p.h \ + qsgsoftwarerenderer_p.h \ + qsgsoftwarerenderlistbuilder_p.h \ + qsgsoftwarerenderloop_p.h \ + qsgsoftwarelayer_p.h \ + qsgsoftwarecontextplugin_p.h OTHER_FILES += softwarecontext.json |