aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@digia.com>2014-01-16 13:18:05 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-01-22 18:10:19 +0100
commit2ce7959eb9e69cd68013fc6a0f77a9556a84365b (patch)
tree64f52ddce97d858c04b69390f504c778bb5ad0c7 /src/quick
parentb287ed4c4dee9d705073badc79cdb0c3e183d19b (diff)
Further pack messages for QQmlProfilerService
Allow multiple detailTypes in each packet and extend the profiling code to make use of that. Note that this changes the usual order of pixmapSizeKnown and PixmapLoadingFinished events. As far as I can see this doesn't affect the QML profiler frontend and the order of these events isn't specified anywhere. Change-Id: Id39ad98594ccf35add4415e08daf9e92ab561237 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/items/qquickview.cpp10
-rw-r--r--src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp6
-rw-r--r--src/quick/scenegraph/coreapi/qsgrenderer.cpp3
-rw-r--r--src/quick/scenegraph/qsgadaptationlayer.cpp3
-rw-r--r--src/quick/scenegraph/qsgrenderloop.cpp3
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp6
-rw-r--r--src/quick/scenegraph/qsgwindowsrenderloop.cpp15
-rw-r--r--src/quick/scenegraph/util/qsgatlastexture.cpp3
-rw-r--r--src/quick/scenegraph/util/qsgtexture.cpp6
-rw-r--r--src/quick/util/qquickpixmapcache.cpp22
10 files changed, 32 insertions, 45 deletions
diff --git a/src/quick/items/qquickview.cpp b/src/quick/items/qquickview.cpp
index f78ba3520c..1a3d225995 100644
--- a/src/quick/items/qquickview.cpp
+++ b/src/quick/items/qquickview.cpp
@@ -603,7 +603,7 @@ void QQuickView::resizeEvent(QResizeEvent *e)
/*! \reimp */
void QQuickView::keyPressEvent(QKeyEvent *e)
{
- Q_QML_PROFILE(addEvent(QQmlProfilerService::Key));
+ Q_QML_PROFILE(addEvent<QQmlProfilerService::Key>());
QQuickWindow::keyPressEvent(e);
}
@@ -611,7 +611,7 @@ void QQuickView::keyPressEvent(QKeyEvent *e)
/*! \reimp */
void QQuickView::keyReleaseEvent(QKeyEvent *e)
{
- Q_QML_PROFILE(addEvent(QQmlProfilerService::Key));
+ Q_QML_PROFILE(addEvent<QQmlProfilerService::Key>());
QQuickWindow::keyReleaseEvent(e);
}
@@ -619,7 +619,7 @@ void QQuickView::keyReleaseEvent(QKeyEvent *e)
/*! \reimp */
void QQuickView::mouseMoveEvent(QMouseEvent *e)
{
- Q_QML_PROFILE(addEvent(QQmlProfilerService::Mouse));
+ Q_QML_PROFILE(addEvent<QQmlProfilerService::Mouse>());
QQuickWindow::mouseMoveEvent(e);
}
@@ -627,7 +627,7 @@ void QQuickView::mouseMoveEvent(QMouseEvent *e)
/*! \reimp */
void QQuickView::mousePressEvent(QMouseEvent *e)
{
- Q_QML_PROFILE(addEvent(QQmlProfilerService::Mouse));
+ Q_QML_PROFILE(addEvent<QQmlProfilerService::Mouse>());
QQuickWindow::mousePressEvent(e);
}
@@ -635,7 +635,7 @@ void QQuickView::mousePressEvent(QMouseEvent *e)
/*! \reimp */
void QQuickView::mouseReleaseEvent(QMouseEvent *e)
{
- Q_QML_PROFILE(addEvent(QQmlProfilerService::Mouse));
+ Q_QML_PROFILE(addEvent<QQmlProfilerService::Mouse>());
QQuickWindow::mouseReleaseEvent(e);
}
diff --git a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
index 297bea6e6a..700ec051ff 100644
--- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
@@ -171,8 +171,7 @@ ShaderManager::Shader *ShaderManager::prepareMaterial(QSGMaterial *material)
if (qsg_render_timing)
qDebug(" - compiling material: %dms", (int) qsg_renderer_timer.elapsed());
- Q_QML_PROFILE(sceneGraphFrame(
- QQmlProfilerService::SceneGraphContextFrame,
+ Q_QML_SG_PROFILE1(QQmlProfilerService::SceneGraphContextFrame, (
qsg_renderer_timer.nsecsElapsed()));
#endif
@@ -208,8 +207,7 @@ ShaderManager::Shader *ShaderManager::prepareMaterialNoRewrite(QSGMaterial *mate
if (qsg_render_timing)
qDebug(" - compiling material: %dms", (int) qsg_renderer_timer.elapsed());
- Q_QML_PROFILE(sceneGraphFrame(
- QQmlProfilerService::SceneGraphContextFrame,
+ Q_QML_SG_PROFILE1(QQmlProfilerService::SceneGraphContextFrame, (
qsg_renderer_timer.nsecsElapsed()));
#endif
diff --git a/src/quick/scenegraph/coreapi/qsgrenderer.cpp b/src/quick/scenegraph/coreapi/qsgrenderer.cpp
index 44b80df15d..047891e17c 100644
--- a/src/quick/scenegraph/coreapi/qsgrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgrenderer.cpp
@@ -287,8 +287,7 @@ void QSGRenderer::renderScene(const QSGBindable &bindable)
int(renderTime / 1000000));
}
- Q_QML_PROFILE(sceneGraphFrame(
- QQmlProfilerService::SceneGraphRendererFrame,
+ Q_QML_SG_PROFILE1(QQmlProfilerService::SceneGraphRendererFrame, (
preprocessTime,
updatePassTime - preprocessTime,
bindTime - updatePassTime,
diff --git a/src/quick/scenegraph/qsgadaptationlayer.cpp b/src/quick/scenegraph/qsgadaptationlayer.cpp
index 8798208ea3..aa678b34a6 100644
--- a/src/quick/scenegraph/qsgadaptationlayer.cpp
+++ b/src/quick/scenegraph/qsgadaptationlayer.cpp
@@ -196,8 +196,7 @@ void QSGDistanceFieldGlyphCache::update()
(int) qsg_render_timer.elapsed());
}
- Q_QML_PROFILE(sceneGraphFrame(
- QQmlProfilerService::SceneGraphAdaptationLayerFrame,
+ Q_QML_SG_PROFILE1(QQmlProfilerService::SceneGraphAdaptationLayerFrame, (
count,
renderTime,
qsg_render_timer.nsecsElapsed() - renderTime));
diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp
index facb11d275..5559745621 100644
--- a/src/quick/scenegraph/qsgrenderloop.cpp
+++ b/src/quick/scenegraph/qsgrenderloop.cpp
@@ -342,8 +342,7 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
lastFrameTime = QTime::currentTime();
}
- Q_QML_PROFILE(sceneGraphFrame(
- QQmlProfilerService::SceneGraphRenderLoopFrame,
+ Q_QML_SG_PROFILE1(QQmlProfilerService::SceneGraphRenderLoopFrame, (
syncTime,
renderTime,
swapTime));
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index 98a88a8540..bc08b70557 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -609,8 +609,7 @@ void QSGRenderThread::syncAndRender()
int((renderTime - syncTime)/1000000),
int(threadTimer.elapsed() - renderTime/1000000));
- Q_QML_PROFILE(sceneGraphFrame(
- QQmlProfilerService::SceneGraphRenderLoopFrame,
+ Q_QML_SG_PROFILE1(QQmlProfilerService::SceneGraphRenderLoopFrame, (
syncTime,
renderTime - syncTime,
threadTimer.nsecsElapsed() - renderTime));
@@ -1141,8 +1140,7 @@ void QSGThreadedRenderLoop::polishAndSync(Window *w)
int((syncTime - waitTime)/1000000),
int((timer.nsecsElapsed() - syncTime)/1000000));
- Q_QML_PROFILE(sceneGraphFrame(
- QQmlProfilerService::SceneGraphPolishAndSync,
+ Q_QML_SG_PROFILE1(QQmlProfilerService::SceneGraphPolishAndSync, (
polishTime,
waitTime - polishTime,
syncTime - waitTime,
diff --git a/src/quick/scenegraph/qsgwindowsrenderloop.cpp b/src/quick/scenegraph/qsgwindowsrenderloop.cpp
index 14569788b0..c3656eac7a 100644
--- a/src/quick/scenegraph/qsgwindowsrenderloop.cpp
+++ b/src/quick/scenegraph/qsgwindowsrenderloop.cpp
@@ -202,8 +202,7 @@ void QSGWindowsRenderLoop::show(QQuickWindow *window)
int((time_current - time_created)/1000000),
int((qsg_render_timer.nsecsElapsed() - time_current)/1000000));
}
- Q_QML_PROFILE(sceneGraphFrame(
- QQmlProfilerService::SceneGraphWindowsRenderShow,
+ Q_QML_SG_PROFILE1(QQmlProfilerService::SceneGraphWindowsRenderShow, (
time_created - time_start,
time_current - time_created,
qsg_render_timer.nsecsElapsed() - time_current));
@@ -405,8 +404,7 @@ void QSGWindowsRenderLoop::render()
qDebug("WindowsRenderLoop: animations=%d ms",
int((qsg_render_timer.nsecsElapsed() - time_start)/1000000));
}
- Q_QML_PROFILE(sceneGraphFrame(
- QQmlProfilerService::SceneGraphWindowsAnimations,
+ Q_QML_SG_PROFILE1(QQmlProfilerService::SceneGraphWindowsAnimations, (
qsg_render_timer.nsecsElapsed() - time_start));
#endif
@@ -469,12 +467,13 @@ void QSGWindowsRenderLoop::renderWindow(QQuickWindow *window)
int((time_rendered - time_synced)/1000000),
int((time_swapped - time_rendered)/1000000));
}
- Q_QML_PROFILE(sceneGraphFrame(QQmlProfilerService::SceneGraphWindowsPolishFrame,
- time_polished - time_start));
- Q_QML_PROFILE(sceneGraphFrame(QQmlProfilerService::SceneGraphRenderLoopFrame,
+
+ Q_QML_SG_PROFILE2(QQmlProfilerService::SceneGraphWindowsPolishFrame,
+ QQmlProfilerService::SceneGraphRenderLoopFrame, (
time_synced - time_polished,
time_rendered - time_synced,
- time_swapped - time_rendered));
+ time_swapped - time_rendered,
+ time_polished - time_start));
#endif
}
diff --git a/src/quick/scenegraph/util/qsgatlastexture.cpp b/src/quick/scenegraph/util/qsgatlastexture.cpp
index 0fce410b62..6e0fdc7290 100644
--- a/src/quick/scenegraph/util/qsgatlastexture.cpp
+++ b/src/quick/scenegraph/util/qsgatlastexture.cpp
@@ -381,8 +381,7 @@ bool Atlas::bind(QSGTexture::Filtering filtering)
(int) (qsg_renderer_timer.elapsed()));
}
- Q_QML_PROFILE(sceneGraphFrame(
- QQmlProfilerService::SceneGraphTexturePrepare,
+ Q_QML_SG_PROFILE1(QQmlProfilerService::SceneGraphTexturePrepare, (
0, // bind (not relevant)
0, // convert (not relevant)
0, // swizzle (not relevant)
diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp
index 4243e71844..d84ccb7a1f 100644
--- a/src/quick/scenegraph/util/qsgtexture.cpp
+++ b/src/quick/scenegraph/util/qsgtexture.cpp
@@ -634,8 +634,7 @@ void QSGPlainTexture::bind()
m_texture_size.width(),
m_texture_size.height());
}
- Q_QML_PROFILE(sceneGraphFrame(
- QQmlProfilerService::SceneGraphTextureDeletion,
+ Q_QML_SG_PROFILE1(QQmlProfilerService::SceneGraphTextureDeletion, (
qsg_renderer_timer.nsecsElapsed()));
#endif
}
@@ -736,8 +735,7 @@ void QSGPlainTexture::bind()
}
- Q_QML_PROFILE(sceneGraphFrame(
- QQmlProfilerService::SceneGraphTexturePrepare,
+ Q_QML_SG_PROFILE1(QQmlProfilerService::SceneGraphTexturePrepare, (
bindTime,
convertTime - bindTime,
swizzleTime - convertTime,
diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp
index 0260bd1683..af66ef26a4 100644
--- a/src/quick/util/qquickpixmapcache.cpp
+++ b/src/quick/util/qquickpixmapcache.cpp
@@ -519,7 +519,7 @@ void QQuickPixmapReader::processJobs()
runningJob->loading = true;
QUrl url = runningJob->url;
- Q_QML_PROFILE(pixmapEvent(QQmlProfilerService::PixmapLoadingStarted, url));
+ Q_QML_PROFILE(pixmapStateChanged<QQmlProfilerService::PixmapLoadingStarted>(url));
QSize requestSize = runningJob->requestSize;
locker.unlock();
@@ -897,11 +897,10 @@ bool QQuickPixmapReply::event(QEvent *event)
if (data->pixmapStatus == QQuickPixmap::Ready) {
data->textureFactory = de->textureFactory;
data->implicitSize = de->implicitSize;
- Q_QML_PROFILE(pixmapEvent(QQmlProfilerService::PixmapLoadingFinished, data->url));
- Q_QML_PROFILE(pixmapEvent(QQmlProfilerService::PixmapSizeKnown, url,
+ Q_QML_PROFILE(pixmapLoadingFinished(data->url,
data->requestSize.width() > 0 ? data->requestSize : data->implicitSize));
} else {
- Q_QML_PROFILE(pixmapEvent(QQmlProfilerService::PixmapLoadingError, data->url));
+ Q_QML_PROFILE(pixmapStateChanged<QQmlProfilerService::PixmapLoadingError>(data->url));
data->errorString = de->errorString;
data->removeFromCache(); // We don't continue to cache error'd pixmaps
}
@@ -927,7 +926,7 @@ int QQuickPixmapData::cost() const
void QQuickPixmapData::addref()
{
++refCount;
- Q_QML_PROFILE(pixmapEvent(QQmlProfilerService::PixmapReferenceCountChanged, url, refCount));
+ Q_QML_PROFILE(pixmapCountChanged<QQmlProfilerService::PixmapReferenceCountChanged>(url, refCount));
if (prevUnreferencedPtr)
pixmapStore()->referencePixmap(this);
}
@@ -936,7 +935,7 @@ void QQuickPixmapData::release()
{
Q_ASSERT(refCount > 0);
--refCount;
- Q_QML_PROFILE(pixmapEvent(QQmlProfilerService::PixmapReferenceCountChanged, url, refCount));
+ Q_QML_PROFILE(pixmapCountChanged<QQmlProfilerService::PixmapReferenceCountChanged>(url, refCount));
if (refCount == 0) {
if (reply) {
QQuickPixmapReply *cancelReply = reply;
@@ -967,7 +966,7 @@ void QQuickPixmapData::addToCache()
QQuickPixmapKey key = { &url, &requestSize };
pixmapStore()->m_cache.insert(key, this);
inCache = true;
- Q_QML_PROFILE(pixmapEvent(QQmlProfilerService::PixmapCacheCountChanged,
+ Q_QML_PROFILE(pixmapCountChanged<QQmlProfilerService::PixmapCacheCountChanged>(
url, pixmapStore()->m_cache.count()));
}
}
@@ -976,7 +975,7 @@ void QQuickPixmapData::removeFromCache()
{
if (inCache) {
QQuickPixmapKey key = { &url, &requestSize };
- Q_QML_PROFILE(pixmapEvent(QQmlProfilerService::PixmapCacheCountChanged,
+ Q_QML_PROFILE(pixmapCountChanged<QQmlProfilerService::PixmapCacheCountChanged>(
url, pixmapStore()->m_cache.count()));
pixmapStore()->m_cache.remove(key);
inCache = false;
@@ -1240,18 +1239,17 @@ void QQuickPixmap::load(QQmlEngine *engine, const QUrl &url, const QSize &reques
if (!(options & QQuickPixmap::Asynchronous)) {
bool ok = false;
- Q_QML_PROFILE(pixmapEvent(QQmlProfilerService::PixmapLoadingStarted, url));
+ Q_QML_PROFILE(pixmapStateChanged<QQmlProfilerService::PixmapLoadingStarted>(url));
d = createPixmapDataSync(this, engine, url, requestSize, &ok);
if (ok) {
- Q_QML_PROFILE(pixmapEvent(QQmlProfilerService::PixmapLoadingFinished, url));
- Q_QML_PROFILE(pixmapEvent(QQmlProfilerService::PixmapSizeKnown, url,
+ Q_QML_PROFILE(pixmapLoadingFinished(url,
d->requestSize.width() > 0 ? d->requestSize : d->implicitSize));
if (options & QQuickPixmap::Cache)
d->addToCache();
return;
}
if (d) { // loadable, but encountered error while loading
- Q_QML_PROFILE(pixmapEvent(QQmlProfilerService::PixmapLoadingError, url));
+ Q_QML_PROFILE(pixmapStateChanged<QQmlProfilerService::PixmapLoadingError>(url));
return;
}
}