diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2016-04-03 11:35:57 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2016-04-10 21:09:49 +0000 |
commit | c8f44080a34e8a430b2aceb86e6811fbcf85b598 (patch) | |
tree | 82358f96d9524b12a51c7c5f69fbb077c7fdd671 /src/render/renderstates | |
parent | 8c2c20e465f20c61a577b3786154222a2173acd6 (diff) |
QStencilMask creates creation changes
Change-Id: I601adac5931ec845f4ac134d24d6b8bc02dc3989
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src/render/renderstates')
-rw-r--r-- | src/render/renderstates/qstencilmask.cpp | 26 | ||||
-rw-r--r-- | src/render/renderstates/qstencilmask.h | 1 | ||||
-rw-r--r-- | src/render/renderstates/qstencilmask_p.h | 81 | ||||
-rw-r--r-- | src/render/renderstates/renderstates.pri | 3 |
4 files changed, 96 insertions, 15 deletions
diff --git a/src/render/renderstates/qstencilmask.cpp b/src/render/renderstates/qstencilmask.cpp index cb11fd73f..fba387e8b 100644 --- a/src/render/renderstates/qstencilmask.cpp +++ b/src/render/renderstates/qstencilmask.cpp @@ -38,25 +38,13 @@ ****************************************************************************/ #include "qstencilmask.h" -#include <Qt3DRender/private/qrenderstate_p.h> +#include "qstencilmask_p.h" +#include <Qt3DRender/private/qrenderstatecreatedchange_p.h> QT_BEGIN_NAMESPACE namespace Qt3DRender { -class QStencilMaskPrivate : public QRenderStatePrivate -{ -public: - QStencilMaskPrivate() - : QRenderStatePrivate(QRenderStatePrivate::StencilMask) - , m_frontOutputMask(0) - , m_backOutputMask(0) - {} - - uint m_frontOutputMask; - uint m_backOutputMask; -}; - /*! * QStencilMask::QStencilMask */ @@ -109,6 +97,16 @@ void QStencilMask::copy(const QNode *ref) d_func()->m_backOutputMask = otherRef->backOutputMask(); } +Qt3DCore::QNodeCreatedChangeBasePtr QStencilMask::createNodeCreationChange() const +{ + auto creationChange = QRenderStateCreatedChangePtr<QStencilMaskData>::create(this); + auto &data = creationChange->data; + Q_D(const QStencilMask); + data.frontOutputMask = d->m_frontOutputMask; + data.backOutputMask = d->m_backOutputMask; + return creationChange; +} + } // namespace Qt3DRender QT_END_NAMESPACE diff --git a/src/render/renderstates/qstencilmask.h b/src/render/renderstates/qstencilmask.h index f29e1791c..0dd3678a6 100644 --- a/src/render/renderstates/qstencilmask.h +++ b/src/render/renderstates/qstencilmask.h @@ -74,6 +74,7 @@ protected: private: Q_DECLARE_PRIVATE(QStencilMask) QT3D_CLONEABLE(QStencilMask) + Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; } // namespace Qt3DRender diff --git a/src/render/renderstates/qstencilmask_p.h b/src/render/renderstates/qstencilmask_p.h new file mode 100644 index 000000000..84d79385c --- /dev/null +++ b/src/render/renderstates/qstencilmask_p.h @@ -0,0 +1,81 @@ +/**************************************************************************** +** +** 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_QSTENCILMASK_P_H +#define QT3DRENDER_QSTENCILMASK_P_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/qrenderstate_p.h> +#include <Qt3DRender/qstencilmask.h> + +QT_BEGIN_NAMESPACE + +namespace Qt3DRender { + +class QStencilMaskPrivate : public QRenderStatePrivate +{ +public: + QStencilMaskPrivate() + : QRenderStatePrivate(QRenderStatePrivate::StencilMask) + , m_frontOutputMask(0) + , m_backOutputMask(0) + {} + + uint m_frontOutputMask; + uint m_backOutputMask; +}; + +struct QStencilMaskData +{ + uint frontOutputMask; + uint backOutputMask; +}; + +} // namespace Qt3DRender + +QT_END_NAMESPACE + +#endif // QT3DRENDER_QSTENCILMASK_P_H diff --git a/src/render/renderstates/renderstates.pri b/src/render/renderstates/renderstates.pri index 6b31cca2e..1742583b4 100644 --- a/src/render/renderstates/renderstates.pri +++ b/src/render/renderstates/renderstates.pri @@ -38,7 +38,8 @@ HEADERS += \ $$PWD/qfrontface_p.h \ $$PWD/qpointsize_p.h \ $$PWD/qpolygonoffset_p.h \ - $$PWD/qscissortest_p.h + $$PWD/qscissortest_p.h \ + $$PWD/qstencilmask_p.h SOURCES += \ |