summaryrefslogtreecommitdiffstats
path: root/src/declarative
diff options
context:
space:
mode:
authorMartin Jones <martin.jones@nokia.com>2009-06-02 01:59:28 (GMT)
committerMartin Jones <martin.jones@nokia.com>2009-06-02 01:59:28 (GMT)
commit7c963ed70317191bb9f6eec5e8cc79fc985bf00b (patch)
treedcb6b4697e0f5a12874d053d848bf4965616efef /src/declarative
parentc968390815e2bd578460d1a22a86ded10f373610 (diff)
parent02a8ba7ce8e5ca07ed8e3e83f10a18acd6e38a10 (diff)
downloadQt-7c963ed70317191bb9f6eec5e8cc79fc985bf00b.zip
Qt-7c963ed70317191bb9f6eec5e8cc79fc985bf00b.tar.gz
Qt-7c963ed70317191bb9f6eec5e8cc79fc985bf00b.tar.bz2
Merge branch 'kinetic-declarativeui' of git@scm.dev.nokia.troll.no:qt/kinetic into kinetic-declarativeui
Conflicts: src/declarative/util/qfxperf.cpp
Diffstat (limited to 'src/declarative')
-rw-r--r--src/declarative/canvas/qsimplecanvas_opengl.cpp70
-rw-r--r--src/declarative/debugger/qmldebugserver.cpp1
-rw-r--r--src/declarative/fx/qfxpath.cpp2
-rw-r--r--src/declarative/qml/qmlcompiler.cpp2
-rw-r--r--src/declarative/qml/qmlcomponent.cpp3
-rw-r--r--src/declarative/qml/qmlengine.cpp18
-rw-r--r--src/declarative/qml/qmlmetaproperty.cpp4
-rw-r--r--src/declarative/qml/qmlvme.cpp2
-rw-r--r--src/declarative/util/qfxperf.cpp30
-rw-r--r--src/declarative/util/qfxperf.h18
10 files changed, 65 insertions, 85 deletions
diff --git a/src/declarative/canvas/qsimplecanvas_opengl.cpp b/src/declarative/canvas/qsimplecanvas_opengl.cpp
index 72f8324..ec809ff 100644
--- a/src/declarative/canvas/qsimplecanvas_opengl.cpp
+++ b/src/declarative/canvas/qsimplecanvas_opengl.cpp
@@ -224,39 +224,47 @@ void QSimpleCanvasItemPrivate::paintChild(const GLPaintParameters &params,
void QSimpleCanvasItemPrivate::setupChildState(QSimpleCanvasItem *child)
{
- qreal visible = child->visible();
- child->d_func()->data()->activeOpacity = data()->activeOpacity;
- if (visible != 1)
- child->d_func()->data()->activeOpacity *= visible;
+ QSimpleCanvasItemData *const myData = data();
+ QSimpleCanvasItemPrivate *const childPrivate = child->d_func();
+ QSimpleCanvasItemData *const childData = childPrivate->data();
- if (child->d_func()->data()->activeOpacity != 0) {
+ childData->activeOpacity = myData->activeOpacity;
+ if (childData->visible != 1)
+ childData->activeOpacity *= childData->visible;
+
+ if (childData->activeOpacity != 0) {
// Calculate child's transform
- qreal x = child->x();
- qreal y = child->y();
- qreal scale = child->scale();
- QSimpleCanvasItem::Flip flip = child->flip();
-
- QSimpleCanvas::Matrix &am = child->d_func()->data()->transformActive;
- am = data()->transformActive;
- if (x != 0 || y != 0)
+ const qreal x = childData->x;
+ const qreal y = childData->y;
+ const qreal scale = childPrivate->scale;
+ QSimpleCanvasItem::Flip flip = childData->flip;
+
+ QSimpleCanvas::Matrix &am = childData->transformActive;
+ am = myData->transformActive;
+ if (x != 0. || y != 0.)
am.translate(x, y);
- if (scale != 1) {
- QPointF to = child->d_func()->transformOrigin();
- if (to.x() != 0. || to.y() != 0.)
+
+ if (scale != 1.) {
+ QPointF to = childPrivate->transformOrigin();
+ bool translate = (to.x() != 0. || to.y() != 0.);
+ if (translate)
am.translate(to.x(), to.y());
am.scale(scale, scale);
- if (to.x() != 0. || to.y() != 0.)
+ if (translate)
am.translate(-to.x(), -to.y());
}
- if (child->d_func()->data()->transformUser)
- am *= *child->d_func()->data()->transformUser;
+
+ if (childData->transformUser)
+ am *= *childData->transformUser;
+
if (flip) {
QRectF br = child->boundingRect();
am.translate(br.width() / 2., br.height() / 2);
am.rotate(180, (flip & QSimpleCanvasItem::VerticalFlip)?1:0, (flip & QSimpleCanvasItem::HorizontalFlip)?1:0, 0);
am.translate(-br.width() / 2., -br.height() / 2);
}
- child->d_func()->data()->transformValid = true;
+
+ childData->transformValid = true;
}
}
@@ -264,20 +272,30 @@ QRectF QSimpleCanvasItemPrivate::setupPainting(int version, const QRect &boundin
{
Q_Q(QSimpleCanvasItem);
- QRectF filteredBoundRect = q->boundingRect();
- if (filter)
- filteredBoundRect = filter->itemBoundingRect(filteredBoundRect);
- QRectF rv = data()->transformActive.mapRect(filteredBoundRect);
+ bool hasContents = options & QSimpleCanvasItem::HasContents;
+
+ QSimpleCanvasItemData *myData = data();
+
+ QRectF rv;
+ if (hasContents) {
+ QRectF filteredBoundRect = q->boundingRect();
+ if (filter)
+ filteredBoundRect = filter->itemBoundingRect(filteredBoundRect);
+ const QMatrix4x4 &active = myData->transformActive;
+
+ rv = active.mapRect(filteredBoundRect);
+ }
for (int ii = 0; ii < children.count(); ++ii) {
QSimpleCanvasItem *child = children.at(ii);
setupChildState(child);
- if (child->d_func()->data()->activeOpacity != 0)
+ QSimpleCanvasItemData *childData = child->d_func()->data();
+ if (childData->activeOpacity != 0)
rv |= child->d_func()->setupPainting(version, bounding);
}
- data()->lastPaintRect = rv;
+ myData->lastPaintRect = rv;
return rv;
}
diff --git a/src/declarative/debugger/qmldebugserver.cpp b/src/declarative/debugger/qmldebugserver.cpp
index d52884e..23e59e0 100644
--- a/src/declarative/debugger/qmldebugserver.cpp
+++ b/src/declarative/debugger/qmldebugserver.cpp
@@ -283,6 +283,7 @@ void QmlDebugServerPlugin::sendMessage(const QByteArray &message)
QPacket pack;
pack << d->name << message;
d->server->d_func()->protocol->send(pack);
+ d->server->d_func()->connection->flush();
}
void QmlDebugServerPlugin::enabledChanged(bool)
diff --git a/src/declarative/fx/qfxpath.cpp b/src/declarative/fx/qfxpath.cpp
index 5deaaa5..be731b1 100644
--- a/src/declarative/fx/qfxpath.cpp
+++ b/src/declarative/fx/qfxpath.cpp
@@ -357,7 +357,7 @@ void QFxPath::createPointCache() const
{
Q_D(const QFxPath);
#ifdef Q_ENABLE_PERFORMANCE_LOG
- QFxPerfTimer<QFxPerf::PathCache> pc;
+ QFxPerfTimer<QFxPerf::QFxPathViewPathCache> pc;
#endif
qreal pathLength = d->_path.length();
const int points = int(pathLength*2);
diff --git a/src/declarative/qml/qmlcompiler.cpp b/src/declarative/qml/qmlcompiler.cpp
index 3029934..46695b7 100644
--- a/src/declarative/qml/qmlcompiler.cpp
+++ b/src/declarative/qml/qmlcompiler.cpp
@@ -470,7 +470,7 @@ bool QmlCompiler::compile(QmlEngine *engine,
QmlCompiledComponent *out)
{
#ifdef Q_ENABLE_PERFORMANCE_LOG
- QFxPerfTimer<QFxPerf::Compile> pc;
+ QFxPerfTimer<QFxPerf::Compilation> pc;
#endif
exceptions.clear();
diff --git a/src/declarative/qml/qmlcomponent.cpp b/src/declarative/qml/qmlcomponent.cpp
index 24b5dd2..78137e8 100644
--- a/src/declarative/qml/qmlcomponent.cpp
+++ b/src/declarative/qml/qmlcomponent.cpp
@@ -458,9 +458,6 @@ QObject *QmlComponent::beginCreate(QmlContext *context)
return 0;
}
-#ifdef Q_ENABLE_PERFORMANCE_LOG
- QFxPerfTimer<QFxPerf::CreateComponent> perf;
-#endif
if (!d->engine->d_func()->rootComponent)
d->engine->d_func()->rootComponent = this;
diff --git a/src/declarative/qml/qmlengine.cpp b/src/declarative/qml/qmlengine.cpp
index c67c220..18f28ed 100644
--- a/src/declarative/qml/qmlengine.cpp
+++ b/src/declarative/qml/qmlengine.cpp
@@ -1275,9 +1275,6 @@ QmlContextScriptClass::queryProperty(const QScriptValue &object,
QueryFlags flags, uint *id)
{
Q_UNUSED(flags);
-#ifdef Q_ENABLE_PERFORMANCE_LOG
- QFxPerfTimer<QFxPerf::ContextQuery> perf;
-#endif
QmlContext *bindContext =
static_cast<QmlContext*>(object.data().toQObject());
QueryFlags rv = 0;
@@ -1308,9 +1305,6 @@ QScriptValue QmlContextScriptClass::property(const QScriptValue &object,
const QScriptString &name,
uint id)
{
-#ifdef Q_ENABLE_PERFORMANCE_LOG
- QFxPerfTimer<QFxPerf::ContextProperty> perf;
-#endif
QmlContext *bindContext =
static_cast<QmlContext*>(object.data().toQObject());
@@ -1369,9 +1363,6 @@ void QmlContextScriptClass::setProperty(QScriptValue &object,
{
Q_UNUSED(name);
-#ifdef Q_ENABLE_PERFORMANCE_LOG
- QFxPerfTimer<QFxPerf::ObjectSetProperty> perf;
-#endif
QmlContext *bindContext =
static_cast<QmlContext*>(object.data().toQObject());
@@ -1422,9 +1413,6 @@ QScriptClass::QueryFlags QmlObjectScriptClass::queryProperty(const QScriptValue
QueryFlags flags, uint *id)
{
Q_UNUSED(flags);
-#ifdef Q_ENABLE_PERFORMANCE_LOG
- QFxPerfTimer<QFxPerf::ObjectQuery> perf;
-#endif
QObject *obj = object.data().toQObject();
QueryFlags rv = 0;
QString propName = name.toString();
@@ -1443,9 +1431,6 @@ QScriptValue QmlObjectScriptClass::property(const QScriptValue &object,
const QScriptString &name,
uint id)
{
-#ifdef Q_ENABLE_PERFORMANCE_LOG
- QFxPerfTimer<QFxPerf::ObjectProperty> perf;
-#endif
QObject *obj = object.data().toQObject();
#ifdef PROPERTY_DEBUG
@@ -1472,9 +1457,6 @@ void QmlObjectScriptClass::setProperty(QScriptValue &object,
{
Q_UNUSED(name);
-#ifdef Q_ENABLE_PERFORMANCE_LOG
- QFxPerfTimer<QFxPerf::ObjectSetProperty> perf;
-#endif
QObject *obj = object.data().toQObject();
#ifdef PROPERTY_DEBUG
diff --git a/src/declarative/qml/qmlmetaproperty.cpp b/src/declarative/qml/qmlmetaproperty.cpp
index 3aa4f1d..4f39ebc 100644
--- a/src/declarative/qml/qmlmetaproperty.cpp
+++ b/src/declarative/qml/qmlmetaproperty.cpp
@@ -196,10 +196,6 @@ QmlMetaProperty::QmlMetaProperty(QObject *obj, const QString &name)
QmlMetaProperty::QmlMetaProperty(QObject *obj, const QString &name, QmlContext *ctxt)
: d(new QmlMetaPropertyPrivate)
{
-#ifdef Q_ENABLE_PERFORMANCE_LOG
- QFxPerfTimer<QFxPerf::MetaProperty> perf;
-#endif
-
d->context = ctxt;
initProperty(obj, name);
}
diff --git a/src/declarative/qml/qmlvme.cpp b/src/declarative/qml/qmlvme.cpp
index e68afcc..c85524f 100644
--- a/src/declarative/qml/qmlvme.cpp
+++ b/src/declarative/qml/qmlvme.cpp
@@ -201,7 +201,7 @@ QObject *QmlVME::run(QmlContext *ctxt, QmlCompiledComponent *comp, int start, in
#ifdef Q_ENABLE_PERFORMANCE_LOG
- QFxPerfTimer<QFxPerf::CompileRun> cr;
+ QFxPerfTimer<QFxPerf::VMEExecution> cr;
#endif
QmlEnginePrivate::SimpleList<QmlBindableValue> bindValues;
QmlEnginePrivate::SimpleList<QmlParserStatus> parserStatus;
diff --git a/src/declarative/util/qfxperf.cpp b/src/declarative/util/qfxperf.cpp
index 9b0e9b7..e4f0c53 100644
--- a/src/declarative/util/qfxperf.cpp
+++ b/src/declarative/util/qfxperf.cpp
@@ -44,32 +44,24 @@
QT_BEGIN_NAMESPACE
Q_DEFINE_PERFORMANCE_LOG(QFxPerf, "QFx") {
- Q_DEFINE_PERFORMANCE_METRIC(QmlParsing, "QML Parsing")
- Q_DEFINE_PERFORMANCE_METRIC(Compile, "QML Compilation")
- Q_DEFINE_PERFORMANCE_METRIC(CompileRun, "QML Compilation Run")
- Q_DEFINE_PERFORMANCE_METRIC(CreateComponent, "Component creation")
+ Q_DEFINE_PERFORMANCE_METRIC(QmlParsing, "Compilation: QML Parsing")
+ Q_DEFINE_PERFORMANCE_METRIC(Compilation, " QML Compilation")
+ Q_DEFINE_PERFORMANCE_METRIC(VMEExecution, "Execution: QML VME Execution")
Q_DEFINE_PERFORMANCE_METRIC(BindInit, "BindValue Initialization")
- Q_DEFINE_PERFORMANCE_METRIC(BindCompile, "BindValue compile")
Q_DEFINE_PERFORMANCE_METRIC(BindValue, "BindValue execution")
Q_DEFINE_PERFORMANCE_METRIC(BindValueSSE, "BindValue execution SSE")
Q_DEFINE_PERFORMANCE_METRIC(BindValueQt, "BindValue execution QtScript")
- Q_DEFINE_PERFORMANCE_METRIC(ContextQuery, "QtScript: Query Context")
- Q_DEFINE_PERFORMANCE_METRIC(ContextProperty, "QtScript: Context Property")
- Q_DEFINE_PERFORMANCE_METRIC(ObjectQuery, "QtScript: Query Object")
- Q_DEFINE_PERFORMANCE_METRIC(ObjectProperty, "QtScript: Object Property")
- Q_DEFINE_PERFORMANCE_METRIC(ObjectSetProperty, "QtScript: Set Object Property")
Q_DEFINE_PERFORMANCE_METRIC(BindableValueUpdate, "QmlBindableValue::update")
Q_DEFINE_PERFORMANCE_METRIC(PixmapLoad, "Pixmap loading")
- Q_DEFINE_PERFORMANCE_METRIC(MetaProperty, "Meta property resolution")
- Q_DEFINE_PERFORMANCE_METRIC(PathCache, "Path cache")
- Q_DEFINE_PERFORMANCE_METRIC(CreateParticle, "Particle creation")
Q_DEFINE_PERFORMANCE_METRIC(FontDatabase, "Font database creation")
- Q_DEFINE_PERFORMANCE_METRIC(ItemComponentComplete, "QFxItem::componentComplete")
- Q_DEFINE_PERFORMANCE_METRIC(ImageComponentComplete, "QFxImage::componentComplete")
- Q_DEFINE_PERFORMANCE_METRIC(ComponentInstanceComponentComplete, "QFxComponentInstance::componentComplete")
- Q_DEFINE_PERFORMANCE_METRIC(BaseLayoutComponentComplete, "QFxBaseLayout::componentComplete")
- Q_DEFINE_PERFORMANCE_METRIC(TextComponentComplete, "QFxText::componentComplete")
- Q_DEFINE_PERFORMANCE_METRIC(QFxText_setText, "QFxText::setText")
+ Q_DEFINE_PERFORMANCE_METRIC(QFxPathViewPathCache, "FX Items: QFxPathView: Path cache")
+ Q_DEFINE_PERFORMANCE_METRIC(CreateParticle, " QFxParticles: Particle creation")
+ Q_DEFINE_PERFORMANCE_METRIC(ItemComponentComplete, " QFxItem::componentComplete")
+ Q_DEFINE_PERFORMANCE_METRIC(ImageComponentComplete, " QFxImage::componentComplete")
+ Q_DEFINE_PERFORMANCE_METRIC(ComponentInstanceComponentComplete, " QFxComponentInstance::componentComplete")
+ Q_DEFINE_PERFORMANCE_METRIC(BaseLayoutComponentComplete, " QFxBaseLayout::componentComplete")
+ Q_DEFINE_PERFORMANCE_METRIC(TextComponentComplete, " QFxText::componentComplete")
+ Q_DEFINE_PERFORMANCE_METRIC(QFxText_setText, " QFxText::setText")
Q_DEFINE_PERFORMANCE_METRIC(AddScript, "QmlScript::addScriptToEngine")
}
QT_END_NAMESPACE
diff --git a/src/declarative/util/qfxperf.h b/src/declarative/util/qfxperf.h
index 23de8b5..9fcf1d6 100644
--- a/src/declarative/util/qfxperf.h
+++ b/src/declarative/util/qfxperf.h
@@ -51,25 +51,19 @@ QT_BEGIN_NAMESPACE
QT_MODULE(Declarative)
Q_DECLARE_PERFORMANCE_LOG(QFxPerf) {
Q_DECLARE_PERFORMANCE_METRIC(QmlParsing)
- Q_DECLARE_PERFORMANCE_METRIC(Compile)
- Q_DECLARE_PERFORMANCE_METRIC(CompileRun)
- Q_DECLARE_PERFORMANCE_METRIC(CreateComponent)
+
+ Q_DECLARE_PERFORMANCE_METRIC(Compilation)
+ Q_DECLARE_PERFORMANCE_METRIC(VMEExecution)
+
Q_DECLARE_PERFORMANCE_METRIC(BindInit)
- Q_DECLARE_PERFORMANCE_METRIC(BindCompile)
Q_DECLARE_PERFORMANCE_METRIC(BindValue)
Q_DECLARE_PERFORMANCE_METRIC(BindValueSSE)
Q_DECLARE_PERFORMANCE_METRIC(BindValueQt)
- Q_DECLARE_PERFORMANCE_METRIC(ContextQuery)
- Q_DECLARE_PERFORMANCE_METRIC(ContextProperty)
- Q_DECLARE_PERFORMANCE_METRIC(ObjectQuery)
- Q_DECLARE_PERFORMANCE_METRIC(ObjectProperty)
- Q_DECLARE_PERFORMANCE_METRIC(ObjectSetProperty)
Q_DECLARE_PERFORMANCE_METRIC(BindableValueUpdate)
Q_DECLARE_PERFORMANCE_METRIC(PixmapLoad)
- Q_DECLARE_PERFORMANCE_METRIC(MetaProperty)
- Q_DECLARE_PERFORMANCE_METRIC(PathCache)
- Q_DECLARE_PERFORMANCE_METRIC(CreateParticle)
Q_DECLARE_PERFORMANCE_METRIC(FontDatabase)
+ Q_DECLARE_PERFORMANCE_METRIC(QFxPathViewPathCache)
+ Q_DECLARE_PERFORMANCE_METRIC(CreateParticle)
Q_DECLARE_PERFORMANCE_METRIC(ItemComponentComplete)
Q_DECLARE_PERFORMANCE_METRIC(ImageComponentComplete)
Q_DECLARE_PERFORMANCE_METRIC(ComponentInstanceComponentComplete)