aboutsummaryrefslogtreecommitdiffstats
path: root/examples/quick/scenegraph/rendernode/softwarerenderer.cpp
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2016-07-27 11:59:17 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2016-08-02 16:15:31 +0000
commit44e86f701247a86da37e3a94b77853b57ab1b303 (patch)
tree109ece6b5393a159062e9b1eca906c176b66035b /examples/quick/scenegraph/rendernode/softwarerenderer.cpp
parentcf186c441dd0d68dbfac416ee6d09d4f923a0a4c (diff)
Add optional flags and rect to QSGRenderNode
Having rendernodes triggering fullscreen updates with the software backend is not ideal. Therefore, introduce the option of reporting that the rendernode is well-behaving, meaning it only writes inside the reported bounding rectangle. Similarly, the OpenGL batch renderer can keep using the depth buffer when the rendernode is known to behave like the renderer expects. Change-Id: I6acc434432c2504776f26e8917b5434b44be293d Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'examples/quick/scenegraph/rendernode/softwarerenderer.cpp')
-rw-r--r--examples/quick/scenegraph/rendernode/softwarerenderer.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/examples/quick/scenegraph/rendernode/softwarerenderer.cpp b/examples/quick/scenegraph/rendernode/softwarerenderer.cpp
index 2f11c56f29..06e406874a 100644
--- a/examples/quick/scenegraph/rendernode/softwarerenderer.cpp
+++ b/examples/quick/scenegraph/rendernode/softwarerenderer.cpp
@@ -68,7 +68,7 @@ void SoftwareRenderNode::render(const RenderState *renderState)
p->setOpacity(inheritedOpacity());
const QRegion *clipRegion = renderState->clipRegion();
if (clipRegion && !clipRegion->isEmpty())
- p->setClipRegion(*clipRegion);
+ p->setClipRegion(*clipRegion, Qt::IntersectClip);
const QPointF p0(m_item->width() - 1, m_item->height() - 1);
const QPointF p1(0, 0);
@@ -89,3 +89,13 @@ QSGRenderNode::StateFlags SoftwareRenderNode::changedStates() const
{
return 0;
}
+
+QSGRenderNode::RenderingFlags SoftwareRenderNode::flags() const
+{
+ return BoundedRectRendering;
+}
+
+QRectF SoftwareRenderNode::rect() const
+{
+ return QRect(0, 0, m_item->width(), m_item->height());
+}