summaryrefslogtreecommitdiffstats
path: root/src/render/renderstates
diff options
context:
space:
mode:
authorPaul Lemire <paul.lemire@kdab.com>2016-07-04 08:42:31 +0200
committerPaul Lemire <paul.lemire@kdab.com>2016-07-17 21:29:12 +0000
commitf993bd915a7d61677e6887932abeea026aa74553 (patch)
tree4380a0fb4bb6906468a48a23b563c75e40d1c041 /src/render/renderstates
parent2b4bb4fdce0630c71bc84c70f66e3c7943589602 (diff)
RenderStates: remove RenderStateCollection
Removes the multiple inheritance scheme it included and simplify the way render states get added removed. Change-Id: I20ede340f3bf6fcfb95dc84d7d0588d681331b54 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
Diffstat (limited to 'src/render/renderstates')
-rw-r--r--src/render/renderstates/renderstatecollection.cpp109
-rw-r--r--src/render/renderstates/renderstatecollection_p.h96
-rw-r--r--src/render/renderstates/renderstates.pri2
3 files changed, 0 insertions, 207 deletions
diff --git a/src/render/renderstates/renderstatecollection.cpp b/src/render/renderstates/renderstatecollection.cpp
deleted file mode 100644
index f9a7cb305..000000000
--- a/src/render/renderstates/renderstatecollection.cpp
+++ /dev/null
@@ -1,109 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#include "Qt3DRender/private/renderstatecollection_p.h"
-#include <Qt3DRender/private/renderstates_p.h>
-#include <Qt3DRender/private/managers_p.h>
-
-#include <Qt3DRender/qrenderstate.h>
-
-QT_BEGIN_NAMESPACE
-
-namespace Qt3DRender {
-namespace Render {
-
-RenderStateCollection::RenderStateCollection()
- : m_dirty(false)
-{
-}
-
-RenderStateCollection::~RenderStateCollection()
-{
-}
-
-void RenderStateCollection::setDirty(bool dirty)
-{
- QMutexLocker lock(&m_mutex);
- m_dirty = dirty;
-}
-
-QVector<RenderStateNode*> RenderStateCollection::renderStates(RenderStateManager *manager) const
-{
- QMutexLocker lock(&m_mutex);
- if (m_dirty) {
- m_renderStateNodes.clear();
-
- for (const Qt3DCore::QNodeId id : m_renderStateIds) {
- RenderStateNode *node = manager->lookupResource(id);
- if (node)
- m_renderStateNodes.append(node);
- else
- m_renderStateIds.removeAll(id);
- }
-
- m_dirty = false;
- }
-
- return m_renderStateNodes;
-}
-
-bool RenderStateCollection::hasRenderStates() const
-{
- QMutexLocker lock(&m_mutex);
- return !m_renderStateIds.empty();
-}
-
-void RenderStateCollection::appendRenderState(Qt3DCore::QNodeId renderStateId)
-{
- QMutexLocker lock(&m_mutex);
- if (!m_renderStateIds.contains(renderStateId)) {
- m_renderStateIds.append(renderStateId);
- m_dirty = true;
- }
-}
-
-void RenderStateCollection::removeRenderState(Qt3DCore::QNodeId renderStateId)
-{
- QMutexLocker lock(&m_mutex);
- if (m_renderStateIds.removeAll(renderStateId) > 0) {
- m_dirty = true;
- }
-
-}
-
-} // namespace Render
-} // namespace Qt3DRender
-
-QT_END_NAMESPACE
diff --git a/src/render/renderstates/renderstatecollection_p.h b/src/render/renderstates/renderstatecollection_p.h
deleted file mode 100644
index 751d41250..000000000
--- a/src/render/renderstates/renderstatecollection_p.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 Klaralvdalens Datakonsult AB (KDAB).
-** Contact: http://www.qt-project.org/legal
-**
-** This file is part of the Qt3D module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL3$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see http://www.qt.io/terms-conditions. For further
-** information use the contact form at http://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPLv3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or later as published by the Free
-** Software Foundation and appearing in the file LICENSE.GPL included in
-** the packaging of this file. Please review the following information to
-** ensure the GNU General Public License version 2.0 requirements will be
-** met: http://www.gnu.org/licenses/gpl-2.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QT3DRENDER_RENDER_RENDERSTATECOLLECTION_H
-#define QT3DRENDER_RENDER_RENDERSTATECOLLECTION_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists for the convenience
-// of other Qt classes. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include <Qt3DRender/private/renderstatenode_p.h>
-#include <QtCore/qmutex.h>
-
-QT_BEGIN_NAMESPACE
-
-namespace Qt3DRender {
-
-class QRenderState;
-
-namespace Render {
-
-class RenderStateManager;
-
-class Q_AUTOTEST_EXPORT RenderStateCollection
-{
-public:
- RenderStateCollection();
- ~RenderStateCollection();
-
- QVector<RenderStateNode*> renderStates(RenderStateManager *manager) const;
- bool hasRenderStates() const;
-
-protected:
- void appendRenderState(Qt3DCore::QNodeId renderStateId);
- void removeRenderState(Qt3DCore::QNodeId renderStateId);
- void setDirty(bool dirty);
-
-private:
- // Cached RenderStateNodes corresponding to the stored node IDs
- //
- // we need these to be mutable, because the RenderView accesses const
- // instances of this class when we need to update the cached RenderStateNodes
- mutable QVector<Qt3DCore::QNodeId> m_renderStateIds;
- mutable QVector<RenderStateNode*> m_renderStateNodes;
- mutable bool m_dirty;
- mutable QMutex m_mutex;
-};
-
-} // namespace Render
-
-} // namespace Qt3DRender
-
-QT_END_NAMESPACE
-
-#endif // QT3DRENDER_RENDER_RENDERSTATECOLLECTION_H
-
diff --git a/src/render/renderstates/renderstates.pri b/src/render/renderstates/renderstates.pri
index 0441fa90b..76497d310 100644
--- a/src/render/renderstates/renderstates.pri
+++ b/src/render/renderstates/renderstates.pri
@@ -24,7 +24,6 @@ HEADERS += \
$$PWD/renderstates_p.h \
$$PWD/renderstateset_p.h \
$$PWD/qpointsize.h \
- $$PWD/renderstatecollection_p.h \
$$PWD/qseamlesscubemap.h \
$$PWD/qdepthtest.h \
$$PWD/qnodepthmask.h \
@@ -72,7 +71,6 @@ SOURCES += \
$$PWD/renderstates.cpp \
$$PWD/renderstateset.cpp \
$$PWD/qpointsize.cpp \
- $$PWD/renderstatecollection.cpp \
$$PWD/qseamlesscubemap.cpp \
$$PWD/qnodepthmask.cpp \
$$PWD/qrenderstatecreatedchange.cpp \