diff options
author | Sean Harmer <sean.harmer@kdab.com> | 2016-04-03 09:44:01 +0100 |
---|---|---|
committer | Sean Harmer <sean.harmer@kdab.com> | 2016-04-10 21:09:26 +0000 |
commit | d55304bdbfb9997f988342870d48cfc2469d595b (patch) | |
tree | 8bb8ea13960b64de4ac8c74c904879b4c40dc41e /src | |
parent | 2290501e3b1f2f3dfd2751a23f77aec80d4964cc (diff) |
QBlendEquation creates creation changes
Change-Id: I5abb94ebf2dd66114d4fa6cc5cd783f6725e8a15
Reviewed-by: Paul Lemire <paul.lemire@kdab.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/render/renderstates/qblendequation.cpp | 26 | ||||
-rw-r--r-- | src/render/renderstates/qblendequation.h | 1 | ||||
-rw-r--r-- | src/render/renderstates/qblendequation_p.h | 80 | ||||
-rw-r--r-- | src/render/renderstates/renderstates.pri | 3 |
4 files changed, 93 insertions, 17 deletions
diff --git a/src/render/renderstates/qblendequation.cpp b/src/render/renderstates/qblendequation.cpp index 930373886..bcf482fc1 100644 --- a/src/render/renderstates/qblendequation.cpp +++ b/src/render/renderstates/qblendequation.cpp @@ -38,28 +38,14 @@ ** ****************************************************************************/ -#include "qrenderstate_p.h" #include "qblendequation.h" -#include <private/qnode_p.h> -#include <Qt3DCore/qscenepropertychange.h> +#include "qblendequation_p.h" +#include <Qt3DRender/private/qrenderstatecreatedchange_p.h> QT_BEGIN_NAMESPACE namespace Qt3DRender { -class QBlendEquationPrivate : public QRenderStatePrivate -{ -public: - QBlendEquationPrivate() - : QRenderStatePrivate(QRenderStatePrivate::BlendEquation) - , m_blendFunction(QBlendEquation::Add) - { - } - - Q_DECLARE_PUBLIC(QBlendEquation) - QBlendEquation::BlendFunction m_blendFunction; -}; - void QBlendEquation::copy(const QNode *ref) { QRenderState::copy(ref); @@ -92,6 +78,14 @@ void QBlendEquation::setBlendFunction(QBlendEquation::BlendFunction blendFunctio } } +Qt3DCore::QNodeCreatedChangeBasePtr QBlendEquation::createNodeCreationChange() const +{ + auto creationChange = QRenderStateCreatedChangePtr<QBlendEquationData>::create(this); + auto &data = creationChange->data; + data.blendFunction = d_func()->m_blendFunction; + return creationChange; +} + } // namespace Qt3DRender QT_END_NAMESPACE diff --git a/src/render/renderstates/qblendequation.h b/src/render/renderstates/qblendequation.h index 9bd392357..80ae11c8d 100644 --- a/src/render/renderstates/qblendequation.h +++ b/src/render/renderstates/qblendequation.h @@ -82,6 +82,7 @@ protected: private: Q_DECLARE_PRIVATE(QBlendEquation) QT3D_CLONEABLE(QBlendEquation) + Qt3DCore::QNodeCreatedChangeBasePtr createNodeCreationChange() const Q_DECL_OVERRIDE; }; } // namespace Qt3DRender diff --git a/src/render/renderstates/qblendequation_p.h b/src/render/renderstates/qblendequation_p.h new file mode 100644 index 000000000..d09a29c2f --- /dev/null +++ b/src/render/renderstates/qblendequation_p.h @@ -0,0 +1,80 @@ +/**************************************************************************** +** +** 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_QBLENDEQUATION_P_H +#define QT3DRENDER_QBLENDEQUATION_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/qblendequation.h> + +QT_BEGIN_NAMESPACE + +namespace Qt3DRender { + +class QBlendEquationPrivate : public QRenderStatePrivate +{ +public: + QBlendEquationPrivate() + : QRenderStatePrivate(QRenderStatePrivate::BlendEquation) + , m_blendFunction(QBlendEquation::Add) + { + } + + Q_DECLARE_PUBLIC(QBlendEquation) + QBlendEquation::BlendFunction m_blendFunction; +}; + +struct QBlendEquationData +{ + QBlendEquation::BlendFunction blendFunction; +}; + +} // namespace Qt3DRender + +QT_END_NAMESPACE + +#endif // QT3DRENDER_QBLENDEQUATION_P_H diff --git a/src/render/renderstates/renderstates.pri b/src/render/renderstates/renderstates.pri index 501dfffb6..85ef8207d 100644 --- a/src/render/renderstates/renderstates.pri +++ b/src/render/renderstates/renderstates.pri @@ -28,7 +28,8 @@ HEADERS += \ $$PWD/qseamlesscubemap.h \ $$PWD/qdepthtest.h \ $$PWD/qnodepthmask.h \ - $$PWD/qalphatest_p.h + $$PWD/qalphatest_p.h \ + $$PWD/qblendequation_p.h SOURCES += \ |