aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/util
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-04-11 14:49:12 +0200
committerLaszlo Agocs <laszlo.agocs@theqtcompany.com>2016-04-13 09:22:16 +0000
commite188a3d864a5310bf18c3ad759a12560013deb64 (patch)
tree14be7dbedfc604833ad5e6e2abdcef7573e9cb95 /src/quick/util
parent05605d89f9db80bb748c16ea19c566ab0995027e (diff)
Prefix GL-specific shader effect code
Rename the C++ sources and classes. The QML type name remains the same. No changes in functionality. The shader effect, node, material (and uniform animator and particles and bits and pieces here and there...) are highly interconnected and do not follow the usual design practices for Quick and the scenegraph and the adaptation layer. Therefore while we aim for keeping full compatibility for GL apps, other backends will likely get a different ShaderEffect item implementation. The C++ class QQuickShaderEffect itself is currently a dummy with an unchanged API. It is not in use for now but forms the basis for the implementation for other backends. This will be covered in future commits. Change-Id: Ia39ce4b303f8f33e2f241d11e35fa62423e43127 Reviewed-by: Andy Nichols <andy.nichols@theqtcompany.com>
Diffstat (limited to 'src/quick/util')
-rw-r--r--src/quick/util/qquickanimatorjob.cpp19
-rw-r--r--src/quick/util/qquickanimatorjob_p.h4
2 files changed, 12 insertions, 11 deletions
diff --git a/src/quick/util/qquickanimatorjob.cpp b/src/quick/util/qquickanimatorjob.cpp
index f0ecb8150a..a0c787dae5 100644
--- a/src/quick/util/qquickanimatorjob.cpp
+++ b/src/quick/util/qquickanimatorjob.cpp
@@ -44,7 +44,8 @@
#include <private/qquickwindow_p.h>
#include <private/qquickitem_p.h>
#ifndef QT_NO_OPENGL
-# include <private/qquickshadereffectnode_p.h>
+# include <private/qquickopenglshadereffectnode_p.h>
+# include <private/qquickopenglshadereffect_p.h>
#endif
#include <private/qanimationgroupjob_p.h>
@@ -553,7 +554,7 @@ QQuickUniformAnimatorJob::QQuickUniformAnimatorJob()
void QQuickUniformAnimatorJob::setTarget(QQuickItem *target)
{
- if (qobject_cast<QQuickShaderEffect *>(target) != 0)
+ if (qobject_cast<QQuickOpenGLShaderEffect *>(target) != 0)
m_target = target;
}
@@ -566,14 +567,14 @@ void QQuickUniformAnimatorJob::nodeWasDestroyed()
void QQuickUniformAnimatorJob::afterNodeSync()
{
- m_node = static_cast<QQuickShaderEffectNode *>(QQuickItemPrivate::get(m_target)->paintNode);
+ m_node = static_cast<QQuickOpenGLShaderEffectNode *>(QQuickItemPrivate::get(m_target)->paintNode);
if (m_node && m_uniformIndex == -1 && m_uniformType == -1) {
- QQuickShaderEffectMaterial *material =
- static_cast<QQuickShaderEffectMaterial *>(m_node->material());
+ QQuickOpenGLShaderEffectMaterial *material =
+ static_cast<QQuickOpenGLShaderEffectMaterial *>(m_node->material());
bool found = false;
- for (int t=0; !found && t<QQuickShaderEffectMaterialKey::ShaderTypeCount; ++t) {
- const QVector<QQuickShaderEffectMaterial::UniformData> &uniforms = material->uniforms[t];
+ for (int t=0; !found && t<QQuickOpenGLShaderEffectMaterialKey::ShaderTypeCount; ++t) {
+ const QVector<QQuickOpenGLShaderEffectMaterial::UniformData> &uniforms = material->uniforms[t];
for (int i=0; i<uniforms.size(); ++i) {
if (uniforms.at(i).name == m_uniform) {
m_uniformIndex = i;
@@ -597,8 +598,8 @@ void QQuickUniformAnimatorJob::updateCurrentTime(int time)
m_value = m_from + (m_to - m_from) * progress(time);
- QQuickShaderEffectMaterial *material =
- static_cast<QQuickShaderEffectMaterial *>(m_node->material());
+ QQuickOpenGLShaderEffectMaterial *material =
+ static_cast<QQuickOpenGLShaderEffectMaterial *>(m_node->material());
material->uniforms[m_uniformType][m_uniformIndex].value = m_value;
// As we're not touching the nodes, we need to explicitly mark it dirty.
// Otherwise, the renderer will abort repainting if this was the only
diff --git a/src/quick/util/qquickanimatorjob_p.h b/src/quick/util/qquickanimatorjob_p.h
index 118487f937..64e849d322 100644
--- a/src/quick/util/qquickanimatorjob_p.h
+++ b/src/quick/util/qquickanimatorjob_p.h
@@ -68,7 +68,7 @@ class QQuickAbstractAnimation;
class QQuickAnimatorController;
class QQuickAnimatorProxyJobPrivate;
-class QQuickShaderEffectNode;
+class QQuickOpenGLShaderEffectNode;
class QSGOpacityNode;
@@ -296,7 +296,7 @@ public:
private:
QByteArray m_uniform;
- QQuickShaderEffectNode *m_node;
+ QQuickOpenGLShaderEffectNode *m_node;
int m_uniformIndex : 8;
int m_uniformType : 8;