diff options
author | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-07-15 13:43:08 +0200 |
---|---|---|
committer | Laszlo Agocs <laszlo.agocs@qt.io> | 2016-07-19 10:40:55 +0000 |
commit | 4cb2552313280384b59ee1e7d7fc557c7bd64a68 (patch) | |
tree | 1a6bf0e0abd9a6d952d2d4ab72f20f71e13ba79b /src/quick/scenegraph/coreapi/qsgrendererinterface.cpp | |
parent | b4fc940978e7995e75f17a5386c30ef42333bd38 (diff) |
software: Add support for QSGRenderNode
Have to change getResource() a bit since it turns out it is not suitable
currently for backends that do not have a per-window rendercontext and do
not implement the interface on the rendercontext. Pass in the window to
make sure it can always figure out which window we want the resources for.
(we do not want rendererInterface() to return window-specific instances
created on the fly, with ownership issues, so stick with the simple model
where backends implement the interface on one of their existing classes)
To support clipping, QSGRenderNode::RenderState is extended accordingly.
Also updated the docs since some claims in the rendernode docs are not true
since Qt 5.3.
Change-Id: I34779c83926f5231b888fcab7131e873ae97964f
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/quick/scenegraph/coreapi/qsgrendererinterface.cpp')
-rw-r--r-- | src/quick/scenegraph/coreapi/qsgrendererinterface.cpp | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/quick/scenegraph/coreapi/qsgrendererinterface.cpp b/src/quick/scenegraph/coreapi/qsgrendererinterface.cpp index 04e71441f6..fa543aecad 100644 --- a/src/quick/scenegraph/coreapi/qsgrendererinterface.cpp +++ b/src/quick/scenegraph/coreapi/qsgrendererinterface.cpp @@ -81,9 +81,10 @@ QT_BEGIN_NAMESPACE /*! \enum QSGRendererInterface::Resource - \value Device The graphics device - \value CommandQueue The graphics command queue used by the scenergaph - \value CommandList The command list or buffer used by the scenegraph + \value Device The graphics device, when applicable. + \value CommandQueue The graphics command queue used by the scenegraph, when applicable. + \value CommandList The command list or buffer used by the scenegraph, when applicable. + \value Painter The active QPainter used by the scenegraph, when running with the software backend. */ /*! @@ -134,10 +135,13 @@ QSGRendererInterface::~QSGRendererInterface() example, \c{VkDevice dev = *static_cast<VkDevice *>(result)}). The latter is necessary since such handles may have sizes different from a pointer. + \note The ownership of the returned pointer is never transferred to the caller. + \note This function must only be called on the render thread. */ -void *QSGRendererInterface::getResource(Resource resource) const +void *QSGRendererInterface::getResource(QQuickWindow *window, Resource resource) const { + Q_UNUSED(window); Q_UNUSED(resource); return nullptr; } @@ -147,10 +151,13 @@ void *QSGRendererInterface::getResource(Resource resource) const allows supporting any future resources that are not listed in the Resource enum. + \note The ownership of the returned pointer is never transferred to the caller. + \note This function must only be called on the render thread. */ -void *QSGRendererInterface::getResource(const char *resource) const +void *QSGRendererInterface::getResource(QQuickWindow *window, const char *resource) const { + Q_UNUSED(window); Q_UNUSED(resource); return nullptr; } |