aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/items/qquickview.cpp10
-rw-r--r--src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp16
-rw-r--r--src/quick/scenegraph/coreapi/qsgrenderer.cpp14
-rw-r--r--src/quick/scenegraph/qsgadaptationlayer.cpp12
-rw-r--r--src/quick/scenegraph/qsgrenderloop.cpp12
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp26
-rw-r--r--src/quick/scenegraph/qsgwindowsrenderloop.cpp39
-rw-r--r--src/quick/scenegraph/util/qsgatlastexture.cpp16
-rw-r--r--src/quick/scenegraph/util/qsgtexture.cpp26
-rw-r--r--src/quick/util/qquickpixmapcache.cpp32
10 files changed, 85 insertions, 118 deletions
diff --git a/src/quick/items/qquickview.cpp b/src/quick/items/qquickview.cpp
index 96146ec552..f78ba3520c 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)
{
- QQmlProfilerService::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)
{
- QQmlProfilerService::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)
{
- QQmlProfilerService::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)
{
- QQmlProfilerService::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)
{
- QQmlProfilerService::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 eff8158335..297bea6e6a 100644
--- a/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgbatchrenderer.cpp
@@ -171,11 +171,9 @@ ShaderManager::Shader *ShaderManager::prepareMaterial(QSGMaterial *material)
if (qsg_render_timing)
qDebug(" - compiling material: %dms", (int) qsg_renderer_timer.elapsed());
- if (QQmlProfilerService::enabled) {
- QQmlProfilerService::sceneGraphFrame(
- QQmlProfilerService::SceneGraphContextFrame,
- qsg_renderer_timer.nsecsElapsed());
- }
+ Q_QML_PROFILE(sceneGraphFrame(
+ QQmlProfilerService::SceneGraphContextFrame,
+ qsg_renderer_timer.nsecsElapsed()));
#endif
rewrittenShaders[type] = shader;
@@ -210,11 +208,9 @@ ShaderManager::Shader *ShaderManager::prepareMaterialNoRewrite(QSGMaterial *mate
if (qsg_render_timing)
qDebug(" - compiling material: %dms", (int) qsg_renderer_timer.elapsed());
- if (QQmlProfilerService::enabled) {
- QQmlProfilerService::sceneGraphFrame(
- QQmlProfilerService::SceneGraphContextFrame,
- qsg_renderer_timer.nsecsElapsed());
- }
+ Q_QML_PROFILE(sceneGraphFrame(
+ QQmlProfilerService::SceneGraphContextFrame,
+ qsg_renderer_timer.nsecsElapsed()));
#endif
return shader;
diff --git a/src/quick/scenegraph/coreapi/qsgrenderer.cpp b/src/quick/scenegraph/coreapi/qsgrenderer.cpp
index e35bfe5494..44b80df15d 100644
--- a/src/quick/scenegraph/coreapi/qsgrenderer.cpp
+++ b/src/quick/scenegraph/coreapi/qsgrenderer.cpp
@@ -287,14 +287,12 @@ void QSGRenderer::renderScene(const QSGBindable &bindable)
int(renderTime / 1000000));
}
- if (QQmlProfilerService::enabled) {
- QQmlProfilerService::sceneGraphFrame(
- QQmlProfilerService::SceneGraphRendererFrame,
- preprocessTime,
- updatePassTime - preprocessTime,
- bindTime - updatePassTime,
- renderTime - bindTime);
- }
+ Q_QML_PROFILE(sceneGraphFrame(
+ QQmlProfilerService::SceneGraphRendererFrame,
+ preprocessTime,
+ updatePassTime - preprocessTime,
+ bindTime - updatePassTime,
+ renderTime - bindTime));
#endif
}
diff --git a/src/quick/scenegraph/qsgadaptationlayer.cpp b/src/quick/scenegraph/qsgadaptationlayer.cpp
index cb9e4bdf88..8798208ea3 100644
--- a/src/quick/scenegraph/qsgadaptationlayer.cpp
+++ b/src/quick/scenegraph/qsgadaptationlayer.cpp
@@ -196,13 +196,11 @@ void QSGDistanceFieldGlyphCache::update()
(int) qsg_render_timer.elapsed());
}
- if (QQmlProfilerService::enabled) {
- QQmlProfilerService::sceneGraphFrame(
- QQmlProfilerService::SceneGraphAdaptationLayerFrame,
- count,
- renderTime,
- qsg_render_timer.nsecsElapsed() - renderTime);
- }
+ Q_QML_PROFILE(sceneGraphFrame(
+ QQmlProfilerService::SceneGraphAdaptationLayerFrame,
+ count,
+ renderTime,
+ qsg_render_timer.nsecsElapsed() - renderTime));
#endif
}
diff --git a/src/quick/scenegraph/qsgrenderloop.cpp b/src/quick/scenegraph/qsgrenderloop.cpp
index ac1bdb7841..facb11d275 100644
--- a/src/quick/scenegraph/qsgrenderloop.cpp
+++ b/src/quick/scenegraph/qsgrenderloop.cpp
@@ -342,13 +342,11 @@ void QSGGuiThreadRenderLoop::renderWindow(QQuickWindow *window)
lastFrameTime = QTime::currentTime();
}
- if (QQmlProfilerService::enabled) {
- QQmlProfilerService::sceneGraphFrame(
- QQmlProfilerService::SceneGraphRenderLoopFrame,
- syncTime,
- renderTime,
- swapTime);
- }
+ Q_QML_PROFILE(sceneGraphFrame(
+ QQmlProfilerService::SceneGraphRenderLoopFrame,
+ syncTime,
+ renderTime,
+ swapTime));
// Might have been set during syncSceneGraph()
if (data.updatePending)
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index d8fe947122..98a88a8540 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -609,13 +609,11 @@ void QSGRenderThread::syncAndRender()
int((renderTime - syncTime)/1000000),
int(threadTimer.elapsed() - renderTime/1000000));
- if (QQmlProfilerService::enabled) {
- QQmlProfilerService::sceneGraphFrame(
- QQmlProfilerService::SceneGraphRenderLoopFrame,
- syncTime,
- renderTime - syncTime,
- threadTimer.nsecsElapsed() - renderTime);
- }
+ Q_QML_PROFILE(sceneGraphFrame(
+ QQmlProfilerService::SceneGraphRenderLoopFrame,
+ syncTime,
+ renderTime - syncTime,
+ threadTimer.nsecsElapsed() - renderTime));
#endif
}
@@ -1143,14 +1141,12 @@ void QSGThreadedRenderLoop::polishAndSync(Window *w)
int((syncTime - waitTime)/1000000),
int((timer.nsecsElapsed() - syncTime)/1000000));
- if (QQmlProfilerService::enabled) {
- QQmlProfilerService::sceneGraphFrame(
- QQmlProfilerService::SceneGraphPolishAndSync,
- polishTime,
- waitTime - polishTime,
- syncTime - waitTime,
- timer.nsecsElapsed() - syncTime);
- }
+ Q_QML_PROFILE(sceneGraphFrame(
+ QQmlProfilerService::SceneGraphPolishAndSync,
+ polishTime,
+ waitTime - polishTime,
+ syncTime - waitTime,
+ timer.nsecsElapsed() - syncTime));
#endif
}
diff --git a/src/quick/scenegraph/qsgwindowsrenderloop.cpp b/src/quick/scenegraph/qsgwindowsrenderloop.cpp
index 5d9583cafb..14569788b0 100644
--- a/src/quick/scenegraph/qsgwindowsrenderloop.cpp
+++ b/src/quick/scenegraph/qsgwindowsrenderloop.cpp
@@ -202,13 +202,11 @@ void QSGWindowsRenderLoop::show(QQuickWindow *window)
int((time_current - time_created)/1000000),
int((qsg_render_timer.nsecsElapsed() - time_current)/1000000));
}
- if (QQmlProfilerService::enabled) {
- QQmlProfilerService::sceneGraphFrame(
- QQmlProfilerService::SceneGraphWindowsRenderShow,
- time_created - time_start,
- time_current - time_created,
- qsg_render_timer.nsecsElapsed() - time_current);
- }
+ Q_QML_PROFILE(sceneGraphFrame(
+ QQmlProfilerService::SceneGraphWindowsRenderShow,
+ time_created - time_start,
+ time_current - time_created,
+ qsg_render_timer.nsecsElapsed() - time_current));
#endif
}
@@ -407,11 +405,9 @@ void QSGWindowsRenderLoop::render()
qDebug("WindowsRenderLoop: animations=%d ms",
int((qsg_render_timer.nsecsElapsed() - time_start)/1000000));
}
- if (QQmlProfilerService::Enabled) {
- QQmlProfilerService::sceneGraphFrame(
- QQmlProfilerService::SceneGraphWindowsAnimations,
- qsg_render_timer.nsecsElapsed() - time_start);
- }
+ Q_QML_PROFILE(sceneGraphFrame(
+ QQmlProfilerService::SceneGraphWindowsAnimations,
+ qsg_render_timer.nsecsElapsed() - time_start));
#endif
// It is not given that animations triggered another maybeUpdate()
@@ -473,19 +469,12 @@ void QSGWindowsRenderLoop::renderWindow(QQuickWindow *window)
int((time_rendered - time_synced)/1000000),
int((time_swapped - time_rendered)/1000000));
}
- if (QQmlProfilerService::enabled) {
- QQmlProfilerService::sceneGraphFrame(
- QQmlProfilerService::SceneGraphWindowsPolishFrame,
- time_polished - time_start
- );
-
- QQmlProfilerService::sceneGraphFrame(
- QQmlProfilerService::SceneGraphRenderLoopFrame,
- time_synced - time_polished,
- time_rendered - time_synced,
- time_swapped - time_rendered
- );
- }
+ Q_QML_PROFILE(sceneGraphFrame(QQmlProfilerService::SceneGraphWindowsPolishFrame,
+ time_polished - time_start));
+ Q_QML_PROFILE(sceneGraphFrame(QQmlProfilerService::SceneGraphRenderLoopFrame,
+ time_synced - time_polished,
+ time_rendered - time_synced,
+ time_swapped - time_rendered));
#endif
}
diff --git a/src/quick/scenegraph/util/qsgatlastexture.cpp b/src/quick/scenegraph/util/qsgatlastexture.cpp
index 389945849f..0fce410b62 100644
--- a/src/quick/scenegraph/util/qsgatlastexture.cpp
+++ b/src/quick/scenegraph/util/qsgatlastexture.cpp
@@ -381,15 +381,13 @@ bool Atlas::bind(QSGTexture::Filtering filtering)
(int) (qsg_renderer_timer.elapsed()));
}
- if (QQmlProfilerService::enabled) {
- QQmlProfilerService::sceneGraphFrame(
- QQmlProfilerService::SceneGraphTexturePrepare,
- 0, // bind (not relevant)
- 0, // convert (not relevant)
- 0, // swizzle (not relevant)
- qsg_renderer_timer.nsecsElapsed(), // (upload all of the above)
- 0); // mipmap (not used ever...)
- }
+ Q_QML_PROFILE(sceneGraphFrame(
+ QQmlProfilerService::SceneGraphTexturePrepare,
+ 0, // bind (not relevant)
+ 0, // convert (not relevant)
+ 0, // swizzle (not relevant)
+ qsg_renderer_timer.nsecsElapsed(), // (upload all of the above)
+ 0)); // mipmap (not used ever...)
#endif
}
diff --git a/src/quick/scenegraph/util/qsgtexture.cpp b/src/quick/scenegraph/util/qsgtexture.cpp
index df724d8a01..4243e71844 100644
--- a/src/quick/scenegraph/util/qsgtexture.cpp
+++ b/src/quick/scenegraph/util/qsgtexture.cpp
@@ -634,11 +634,9 @@ void QSGPlainTexture::bind()
m_texture_size.width(),
m_texture_size.height());
}
- if (QQmlProfilerService::enabled) {
- QQmlProfilerService::sceneGraphFrame(
- QQmlProfilerService::SceneGraphTextureDeletion,
- qsg_renderer_timer.nsecsElapsed());
- }
+ Q_QML_PROFILE(sceneGraphFrame(
+ QQmlProfilerService::SceneGraphTextureDeletion,
+ qsg_renderer_timer.nsecsElapsed()));
#endif
}
m_texture_id = 0;
@@ -738,17 +736,13 @@ void QSGPlainTexture::bind()
}
- if (QQmlProfilerService::enabled) {
- mipmapTime = qsg_renderer_timer.nsecsElapsed();
-
- QQmlProfilerService::sceneGraphFrame(
- QQmlProfilerService::SceneGraphTexturePrepare,
- bindTime,
- convertTime - bindTime,
- swizzleTime - convertTime,
- uploadTime - swizzleTime,
- mipmapTime - uploadTime);
- }
+ Q_QML_PROFILE(sceneGraphFrame(
+ QQmlProfilerService::SceneGraphTexturePrepare,
+ bindTime,
+ convertTime - bindTime,
+ swizzleTime - convertTime,
+ uploadTime - swizzleTime,
+ qsg_renderer_timer.nsecsElapsed() - uploadTime));
#endif
diff --git a/src/quick/util/qquickpixmapcache.cpp b/src/quick/util/qquickpixmapcache.cpp
index 055d6b7e29..0260bd1683 100644
--- a/src/quick/util/qquickpixmapcache.cpp
+++ b/src/quick/util/qquickpixmapcache.cpp
@@ -519,8 +519,7 @@ void QQuickPixmapReader::processJobs()
runningJob->loading = true;
QUrl url = runningJob->url;
- QQmlPixmapProfiler pixmapProfiler;
- pixmapProfiler.startLoading(url);
+ Q_QML_PROFILE(pixmapEvent(QQmlProfilerService::PixmapLoadingStarted, url));
QSize requestSize = runningJob->requestSize;
locker.unlock();
@@ -895,14 +894,14 @@ bool QQuickPixmapReply::event(QEvent *event)
if (data) {
Event *de = static_cast<Event *>(event);
data->pixmapStatus = (de->error == NoError) ? QQuickPixmap::Ready : QQuickPixmap::Error;
- QQmlPixmapProfiler pixmapProfiler;
if (data->pixmapStatus == QQuickPixmap::Ready) {
- pixmapProfiler.finishLoading(data->url);
data->textureFactory = de->textureFactory;
data->implicitSize = de->implicitSize;
- pixmapProfiler.setSize(url, data->requestSize.width() > 0 ? data->requestSize : data->implicitSize);
+ Q_QML_PROFILE(pixmapEvent(QQmlProfilerService::PixmapLoadingFinished, data->url));
+ Q_QML_PROFILE(pixmapEvent(QQmlProfilerService::PixmapSizeKnown, url,
+ data->requestSize.width() > 0 ? data->requestSize : data->implicitSize));
} else {
- pixmapProfiler.errorLoading(data->url);
+ Q_QML_PROFILE(pixmapEvent(QQmlProfilerService::PixmapLoadingError, data->url));
data->errorString = de->errorString;
data->removeFromCache(); // We don't continue to cache error'd pixmaps
}
@@ -928,7 +927,7 @@ int QQuickPixmapData::cost() const
void QQuickPixmapData::addref()
{
++refCount;
- QQmlPixmapProfiler().referenceCountChanged(url, refCount);
+ Q_QML_PROFILE(pixmapEvent(QQmlProfilerService::PixmapReferenceCountChanged, url, refCount));
if (prevUnreferencedPtr)
pixmapStore()->referencePixmap(this);
}
@@ -937,7 +936,7 @@ void QQuickPixmapData::release()
{
Q_ASSERT(refCount > 0);
--refCount;
- QQmlPixmapProfiler().referenceCountChanged(url, refCount);
+ Q_QML_PROFILE(pixmapEvent(QQmlProfilerService::PixmapReferenceCountChanged, url, refCount));
if (refCount == 0) {
if (reply) {
QQuickPixmapReply *cancelReply = reply;
@@ -968,8 +967,8 @@ void QQuickPixmapData::addToCache()
QQuickPixmapKey key = { &url, &requestSize };
pixmapStore()->m_cache.insert(key, this);
inCache = true;
- QQmlPixmapProfiler pixmapProfiler;
- pixmapProfiler.cacheCountChanged(url, pixmapStore()->m_cache.count());
+ Q_QML_PROFILE(pixmapEvent(QQmlProfilerService::PixmapCacheCountChanged,
+ url, pixmapStore()->m_cache.count()));
}
}
@@ -977,7 +976,8 @@ void QQuickPixmapData::removeFromCache()
{
if (inCache) {
QQuickPixmapKey key = { &url, &requestSize };
- QQmlPixmapProfiler().cacheCountChanged(url, pixmapStore()->m_cache.count());
+ Q_QML_PROFILE(pixmapEvent(QQmlProfilerService::PixmapCacheCountChanged,
+ url, pixmapStore()->m_cache.count()));
pixmapStore()->m_cache.remove(key);
inCache = false;
}
@@ -1240,18 +1240,18 @@ void QQuickPixmap::load(QQmlEngine *engine, const QUrl &url, const QSize &reques
if (!(options & QQuickPixmap::Asynchronous)) {
bool ok = false;
- QQmlPixmapProfiler pixmapProfiler;
- pixmapProfiler.startLoading(url);
+ Q_QML_PROFILE(pixmapEvent(QQmlProfilerService::PixmapLoadingStarted, url));
d = createPixmapDataSync(this, engine, url, requestSize, &ok);
if (ok) {
- pixmapProfiler.finishLoading(url);
- pixmapProfiler.setSize(url, d->requestSize.width() > 0 ? d->requestSize : d->implicitSize);
+ Q_QML_PROFILE(pixmapEvent(QQmlProfilerService::PixmapLoadingFinished, url));
+ Q_QML_PROFILE(pixmapEvent(QQmlProfilerService::PixmapSizeKnown, url,
+ d->requestSize.width() > 0 ? d->requestSize : d->implicitSize));
if (options & QQuickPixmap::Cache)
d->addToCache();
return;
}
if (d) { // loadable, but encountered error while loading
- pixmapProfiler.errorLoading(url);
+ Q_QML_PROFILE(pixmapEvent(QQmlProfilerService::PixmapLoadingError, url));
return;
}
}