forked from qt-creator/qt-creator
Update scenegraph API check in isUsable
Do not test for OpenGL-through-QRhi, but rather for anything-through-QRhi. The implementation of the profiler views is not tied to OpenGL anymore. That said, QQuickWidget implies using OpenGL as of now, so in practice we will always have OpenGL at best, but update the tests now to be better prepared for the future. Change-Id: Ic43eac1c5cf0e2ce2ef35cdd8a29b475884a5af8 Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
@@ -76,7 +76,11 @@ PerfProfilerTraceView::PerfProfilerTraceView(QWidget *parent, PerfProfilerTool *
|
||||
|
||||
bool PerfProfilerTraceView::isUsable() const
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
return quickWindow()->rendererInterface()->graphicsApi() == QSGRendererInterface::OpenGL;
|
||||
#else
|
||||
return QSGRendererInterface::isApiRhiBased(quickWindow()->rendererInterface()->graphicsApi());
|
||||
#endif
|
||||
}
|
||||
|
||||
void PerfProfilerTraceView::selectByTypeId(int typeId)
|
||||
|
@@ -296,8 +296,12 @@ void QmlProfilerTraceView::showContextMenu(QPoint position)
|
||||
|
||||
bool QmlProfilerTraceView::isUsable() const
|
||||
{
|
||||
#if QT_VERSION < QT_VERSION_CHECK(6, 0, 0)
|
||||
return d->m_mainView->quickWindow()->rendererInterface()->graphicsApi()
|
||||
== QSGRendererInterface::OpenGL;
|
||||
#else
|
||||
return QSGRendererInterface::isApiRhiBased(d->m_mainView->quickWindow()->rendererInterface()->graphicsApi());
|
||||
#endif
|
||||
}
|
||||
|
||||
bool QmlProfilerTraceView::isSuspended() const
|
||||
|
Reference in New Issue
Block a user