From 049f375b448512945ed8a6c1cadb9d5c063cddd1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Antti=20M=C3=A4=C3=A4tt=C3=A4?= Date: Tue, 19 May 2020 09:07:29 +0300 Subject: [PATCH] Add markers to swapBuffers and QSGContext::initialized Task-number: QTBUG-84289 Change-Id: Ia28ba18daac69fd93c233f040ec9ba78ab2232df --- src/quick/items/qquickwindow.cpp | 9 +++++++++ src/quick/items/qquickwindow_p.h | 4 +++- src/quick/scenegraph/qsgdefaultrendercontext.cpp | 1 + 3 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index c55db04..eba2010 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -1167,6 +1167,15 @@ void QQuickWindowPrivate::cleanup(QSGNode *n) q->maybeUpdate(); } +void QQuickWindowPrivate::fireFrameSwapped() +{ + if (swapCount < 5) { + qInfo () << "QQuickWindow::frameSwapped(swapBuffers)"; + ++swapCount; + } + Q_EMIT q_func()->frameSwapped(); +} + /*! \qmltype Window \instantiates QQuickWindow diff --git a/src/quick/items/qquickwindow_p.h b/src/quick/items/qquickwindow_p.h index 63760a3..e32b8d7 100644 --- a/src/quick/items/qquickwindow_p.h +++ b/src/quick/items/qquickwindow_p.h @@ -240,10 +240,12 @@ public: void updateEffectiveOpacityRoot(QQuickItem *, qreal); void updateDirtyNode(QQuickItem *); - void fireFrameSwapped() { Q_EMIT q_func()->frameSwapped(); } + + void fireFrameSwapped(); void fireOpenGLContextCreated(QOpenGLContext *context) { Q_EMIT q_func()->openglContextCreated(context); } void fireAboutToStop() { Q_EMIT q_func()->sceneGraphAboutToStop(); } + int swapCount = 0; QSGRenderContext *context; QSGRenderer *renderer; QByteArray customRenderMode; // Default renderer supports "clip", "overdraw", "changes", "batches" and blank. diff --git a/src/quick/scenegraph/qsgdefaultrendercontext.cpp b/src/quick/scenegraph/qsgdefaultrendercontext.cpp index 73b79c6..ae4a313 100644 --- a/src/quick/scenegraph/qsgdefaultrendercontext.cpp +++ b/src/quick/scenegraph/qsgdefaultrendercontext.cpp @@ -109,6 +109,7 @@ void QSGDefaultRenderContext::initialize(void *context) m_brokenIBOs = true; #endif + qInfo() << "QSGContext::initialized"; emit initialized(); } -- 2.7.1.windows.1