summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Nichols <andy.nichols@digia.com>2014-08-25 12:38:15 +0200
committerLars Knoll <lars.knoll@digia.com>2014-08-25 15:31:56 +0300
commitd3477f8decddb40cc3a64b1e647239dd3579ea16 (patch)
tree336be5628902c0da0aca6b57d3b6ad6dc6cdf418
parent3c5c6f6309d99286a3ecbbce014eb158f4f4013d (diff)
Add support for rendering QSGSimpleRectNode
Change-Id: Ic43877a9128cf0f944abeefd7819f8e99175fbeb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
-rw-r--r--softwarecontext/renderingvisitor.cpp15
1 files changed, 13 insertions, 2 deletions
diff --git a/softwarecontext/renderingvisitor.cpp b/softwarecontext/renderingvisitor.cpp
index f90b23850e..247c4b7c3b 100644
--- a/softwarecontext/renderingvisitor.cpp
+++ b/softwarecontext/renderingvisitor.cpp
@@ -25,6 +25,8 @@
#include "ninepatchnode.h"
#include "painternode.h"
+#include <QtQuick/QSGSimpleRectNode>
+
RenderingVisitor::RenderingVisitor(QPainter *painter)
: painter(painter)
{
@@ -57,13 +59,22 @@ void RenderingVisitor::endVisit(QSGClipNode *)
bool RenderingVisitor::visit(QSGGeometryNode *node)
{
- Q_UNREACHABLE();
+ //Check for QSGSimpleRect
+ QSGSimpleRectNode *rectNode = 0;
+ rectNode = dynamic_cast<QSGSimpleRectNode *>(node);
+ if (rectNode) {
+ if (!rectNode->material()->flags() & QSGMaterial::Blending)
+ painter->setCompositionMode(QPainter::CompositionMode_Source);
+ painter->fillRect(rectNode->rect(), rectNode->color());
+ painter->setCompositionMode(QPainter::CompositionMode_SourceOver);
+ }
+
return true;
}
void RenderingVisitor::endVisit(QSGGeometryNode *node)
{
- Q_UNREACHABLE();
+
}
bool RenderingVisitor::visit(QSGOpacityNode *node)