Skip to content

Commit

Permalink
Add tracing events to Qgs3DMapScene and QgsCameraController
Browse files Browse the repository at this point in the history
  • Loading branch information
dvdkon committed Jan 23, 2025
1 parent ff3d870 commit 1648c1c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/3d/qgs3dmapscene.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -334,8 +334,7 @@ void Qgs3DMapScene::updateScene( bool forceUpdate )
return;
}

if ( forceUpdate )
QgsEventTracing::addEvent( QgsEventTracing::Instant, QStringLiteral( "3D" ), QStringLiteral( "Update Scene" ) );
QgsEventTracing::ScopedEvent traceEvent( QStringLiteral( "3D" ), forceUpdate ? QStringLiteral( "Force update scene" ) : QStringLiteral( "Update scene" ) );

Qgs3DMapSceneEntity::SceneContext sceneContext;
Qt3DRender::QCamera *camera = mEngine->camera();
Expand Down Expand Up @@ -421,6 +420,8 @@ bool Qgs3DMapScene::updateCameraNearFarPlanes()

void Qgs3DMapScene::onFrameTriggered( float dt )
{
QgsEventTracing::addEvent( QgsEventTracing::EventType::Instant, QStringLiteral( "3D" ), QStringLiteral( "Frame begins" ) );

mCameraController->frameTriggered( dt );

updateScene();
Expand Down
3 changes: 3 additions & 0 deletions src/3d/qgscameracontroller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@

#include "qgscameracontroller.h"
#include "moc_qgscameracontroller.cpp"
#include "qgseventtracing.h"
#include "qgsvector3d.h"
#include "qgswindow3dengine.h"
#include "qgs3dmapscene.h"
Expand Down Expand Up @@ -299,6 +300,8 @@ void QgsCameraController::onPositionChanged( Qt3DInput::QMouseEvent *mouse )
if ( !mInputHandlersEnabled )
return;

QgsEventTracing::ScopedEvent traceEvent( QStringLiteral( "3D" ), QStringLiteral( "QgsCameraController::onPositionChanged" ) );

switch ( mCameraNavigationMode )
{
case Qgis::NavigationMode::TerrainBased:
Expand Down

0 comments on commit 1648c1c

Please sign in to comment.