From 5290b04325aa66f3f2934c9f143eee71d98a3249 Mon Sep 17 00:00:00 2001 From: Alan Alpert Date: Mon, 16 Jan 2012 13:01:19 +1000 Subject: Test more of QQuickImageParticle Now the color variance properties are tested, as is the debug code. Just running the debugging code is valid testing, as it contains pointer derefernces that could cause runtime errors, and this codepath is not always enabled at runtime. Additionally, debug mode control has been consolidated in the ParticleSystem. However, this was not necessary for this test addition. Change-Id: Ie56465145461486456462154dfafe546fedabcba Reviewed-by: Martin Jones --- src/quick/particles/qquickimageparticle.cpp | 5 ++--- src/quick/particles/qquickparticlesystem_p.h | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/quick/particles/qquickimageparticle.cpp b/src/quick/particles/qquickimageparticle.cpp index 5ca7d80925..beeebdc233 100644 --- a/src/quick/particles/qquickimageparticle.cpp +++ b/src/quick/particles/qquickimageparticle.cpp @@ -55,8 +55,6 @@ #include QT_BEGIN_NAMESPACE -//###Switch to define later, for now user-friendly (no compilation) debugging is worth it -DEFINE_BOOL_CONFIG_OPTION(qmlParticlesDebug, QML_PARTICLES_DEBUG) #ifndef QT_OPENGL_ES_2 #define SHADER_DEFINES "#version 120\n" @@ -825,7 +823,6 @@ QQuickImageParticle::QQuickImageParticle(QQuickItem* parent) , m_entryEffect(Fade) { setFlag(ItemHasContents); - m_debugMode = qmlParticlesDebug(); } QQuickImageParticle::~QQuickImageParticle() @@ -1222,6 +1219,8 @@ QSGGeometryNode* QQuickImageParticle::buildParticleNodes() if (count() <= 0) return 0; + m_debugMode = m_system->m_debugMode; + if (m_sprites.count() || m_bypassOptimizations) { perfLevel = Sprites; } else if (!m_colortable_name.isEmpty() || !m_sizetable_name.isEmpty() diff --git a/src/quick/particles/qquickparticlesystem_p.h b/src/quick/particles/qquickparticlesystem_p.h index 7a16b77df3..43bcafe347 100644 --- a/src/quick/particles/qquickparticlesystem_p.h +++ b/src/quick/particles/qquickparticlesystem_p.h @@ -302,6 +302,7 @@ public: void updateCurrentTime( int currentTime ); QQuickParticleSystemAnimation* m_animation; bool m_running; + bool m_debugMode; int timeInt; bool initialized; @@ -340,7 +341,6 @@ private: QSignalMapper m_painterMapper; QSignalMapper m_emitterMapper; bool m_paused; - bool m_debugMode; bool m_allDead; bool m_empty; }; -- cgit v1.2.3