1// Copyright (C) 2014 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 "sortpolicy_p.h"
5#include <Qt3DRender/private/qsortpolicy_p.h>
6
7QT_BEGIN_NAMESPACE
8
9using namespace Qt3DCore;
10
11namespace Qt3DRender {
12namespace Render {
13
14SortPolicy::SortPolicy()
15 : FrameGraphNode(FrameGraphNode::SortMethod)
16{
17}
18
19void SortPolicy::syncFromFrontEnd(const QNode *frontEnd, bool firstTime)
20{
21 const QSortPolicy *node = qobject_cast<const QSortPolicy *>(object: frontEnd);
22 if (!node)
23 return;
24
25 FrameGraphNode::syncFromFrontEnd(frontEnd, firstTime);
26
27 const auto sortTypes = node->sortTypes();
28 if (sortTypes != m_sortTypes) {
29 m_sortTypes = sortTypes;
30 markDirty(changes: AbstractRenderer::FrameGraphDirty);
31 }
32}
33
34QList<QSortPolicy::SortType> SortPolicy::sortTypes() const
35{
36 return m_sortTypes;
37}
38
39} // namepace Render
40} // namespace Qt3DRender
41
42QT_END_NAMESPACE
43

source code of qt3d/src/render/framegraph/sortpolicy.cpp