From 2837f1c868b92e7cc8293064ff7ec3f76cdf6c7b Mon Sep 17 00:00:00 2001 From: Ulf Hermann Date: Thu, 24 Nov 2016 11:50:45 +0100 Subject: QmlProfiler: Explicitly specify the offsets for scene graph events The profiler can be switched on in the middle of a frame. In that case the last offset into the timing data would be some random number, which may lead to a crash when recording the sample. However, as we know all the data points we are going to record, we can as well specify where they are supposed to go. The timings themselves may still be random for frames of which we only recorded parts, but the clients can deal with this. Task-number: QTBUG-57304 Change-Id: I1d507f2591516e43d5b3cd25f7939716f2b64ed9 Reviewed-by: Simon Hausmann --- src/quick/scenegraph/qsgadaptationlayer.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/quick/scenegraph/qsgadaptationlayer.cpp') diff --git a/src/quick/scenegraph/qsgadaptationlayer.cpp b/src/quick/scenegraph/qsgadaptationlayer.cpp index bf97133e97..f32829c2ea 100644 --- a/src/quick/scenegraph/qsgadaptationlayer.cpp +++ b/src/quick/scenegraph/qsgadaptationlayer.cpp @@ -179,7 +179,8 @@ void QSGDistanceFieldGlyphCache::update() int count = m_pendingGlyphs.size(); if (profileFrames) renderTime = qsg_render_timer.nsecsElapsed(); - Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphAdaptationLayerFrame); + Q_QUICK_SG_PROFILE_RECORD(QQuickProfiler::SceneGraphAdaptationLayerFrame, + QQuickProfiler::SceneGraphAdaptationLayerGlyphRender); m_pendingGlyphs.reset(); @@ -200,6 +201,7 @@ void QSGDistanceFieldGlyphCache::update() int((now - (renderTime / 1000000)))); } Q_QUICK_SG_PROFILE_END_WITH_PAYLOAD(QQuickProfiler::SceneGraphAdaptationLayerFrame, + QQuickProfiler::SceneGraphAdaptationLayerGlyphStore, (qint64)count); } -- cgit v1.2.3