1 | // Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB). |
---|---|
2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
3 | |
4 | #include <private/backendnode_p.h> |
5 | #include <private/abstractrenderer_p.h> |
6 | #include <private/resourceaccessor_p.h> |
7 | #include <private/nodemanagers_p.h> |
8 | #include <Qt3DCore/private/qbackendnode_p.h> |
9 | #include <Qt3DCore/qnode.h> |
10 | |
11 | QT_BEGIN_NAMESPACE |
12 | |
13 | using namespace Qt3DCore; |
14 | |
15 | namespace Qt3DRender { |
16 | namespace Render { |
17 | |
18 | BackendNode::BackendNode(Mode mode) |
19 | : QBackendNode(mode) |
20 | , m_renderer(nullptr) |
21 | { |
22 | } |
23 | |
24 | BackendNode::BackendNode(Qt3DCore::QBackendNodePrivate &dd) |
25 | : QBackendNode(dd) |
26 | , m_renderer(nullptr) |
27 | { |
28 | } |
29 | |
30 | BackendNode::~BackendNode() |
31 | { |
32 | } |
33 | |
34 | void BackendNode::setRenderer(AbstractRenderer *renderer) |
35 | { |
36 | m_renderer = renderer; |
37 | } |
38 | |
39 | AbstractRenderer *BackendNode::renderer() const |
40 | { |
41 | return m_renderer; |
42 | } |
43 | |
44 | void BackendNode::markDirty(AbstractRenderer::BackendNodeDirtySet changes) |
45 | { |
46 | Q_ASSERT(m_renderer); |
47 | m_renderer->markDirty(changes, node: this); |
48 | } |
49 | |
50 | QSharedPointer<RenderBackendResourceAccessor> BackendNode::resourceAccessor() const |
51 | { |
52 | return m_renderer->resourceAccessor(); |
53 | } |
54 | |
55 | void BackendNode::syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) |
56 | { |
57 | Q_UNUSED(firstTime); |
58 | |
59 | d_ptr->setEnabled(frontEnd->isEnabled()); |
60 | } |
61 | |
62 | } // namespace Render |
63 | } // namespace Qt3DRender |
64 | |
65 | QT_END_NAMESPACE |
66 |