Skip to content

Commit

Permalink
Fixes by clang-format (#11056)
Browse files Browse the repository at this point in the history
Co-authored-by: sigurdp <[email protected]>
  • Loading branch information
github-actions[bot] and sigurdp authored Jan 12, 2024
1 parent 60d962b commit be5ed53
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions Fwk/AppFwk/cafViewer/cafOpenGLWidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -71,27 +71,27 @@ OpenGLWidget::OpenGLWidget( cvf::OpenGLContextGroup* contextGroup,
{
// We need to check if we actually got a context that shares resources with shareWidget.
cvf::ref<cvf::OpenGLContext> shareContext = shareWidget->cvfOpenGLContext();
CVF_ASSERT(myOwnerContextGroup == shareContext->group());
CVF_ASSERT( myOwnerContextGroup == shareContext->group() );

if ( isSharing() )
{
makeCurrent();
myOwnerContextGroup->initializeContextGroup(myContext.p());
myOwnerContextGroup->initializeContextGroup( myContext.p() );
}
else
{
// If we didn't, we need to remove the newly created context from the group it has been added to
// since the construction process above has already optimistically added the new context to the
// existing group. In this case, the newly context is basically defunct so we just shut it down
// (which will also remove it from the group)
myOwnerContextGroup->contextAboutToBeShutdown(myContext.p());
myOwnerContextGroup->contextAboutToBeShutdown( myContext.p() );
CVF_ASSERT( myContext->group() == nullptr );
}
}
else
{
makeCurrent();
contextGroup->initializeContextGroup(myContext.p());
contextGroup->initializeContextGroup( myContext.p() );
}
}
}
Expand Down Expand Up @@ -131,7 +131,7 @@ OpenGLWidget::OpenGLWidget( OpenGLWidget* shareWidget, QWidget* parent, Qt::Wind
{
CVF_ASSERT( myContext->group() == shareContext->group() );
makeCurrent();
myOwnerContextGroup->initializeContextGroup(myContext.p());
myOwnerContextGroup->initializeContextGroup( myContext.p() );
}
}
else
Expand All @@ -140,7 +140,7 @@ OpenGLWidget::OpenGLWidget( OpenGLWidget* shareWidget, QWidget* parent, Qt::Wind
// the construction process above has already optimistically added the new context to the existing group.
// In this case, the newly context is basically defunct so we just shut it down (which will also remove it
// from the group)
myOwnerContextGroup->contextAboutToBeShutdown(myContext.p());
myOwnerContextGroup->contextAboutToBeShutdown( myContext.p() );
CVF_ASSERT( myContext->group() == nullptr );
}
}
Expand All @@ -151,8 +151,9 @@ OpenGLWidget::OpenGLWidget( OpenGLWidget* shareWidget, QWidget* parent, Qt::Wind
//--------------------------------------------------------------------------------------------------
cvf::OpenGLContext* OpenGLWidget::cvfOpenGLContext() const
{
const QGLContext* qglContext = context();
const cvfqt::CvfBoundQGLContext_deprecated* contextBinding = dynamic_cast<const cvfqt::CvfBoundQGLContext_deprecated*>( qglContext );
const QGLContext* qglContext = context();
const cvfqt::CvfBoundQGLContext_deprecated* contextBinding =
dynamic_cast<const cvfqt::CvfBoundQGLContext_deprecated*>( qglContext );
CVF_ASSERT( contextBinding );

return contextBinding->cvfOpenGLContext();
Expand All @@ -171,10 +172,10 @@ void OpenGLWidget::cvfShutdownOpenGLContext()
cvf::OpenGLContextGroup* myOwnerContextGroup = myContext->group();

// If shutdown has already been called, the context is no longer member of any group
if (myOwnerContextGroup)
if ( myOwnerContextGroup )
{
makeCurrent();
myOwnerContextGroup->contextAboutToBeShutdown(myContext.p());
myOwnerContextGroup->contextAboutToBeShutdown( myContext.p() );
}
}
}
Expand Down

0 comments on commit be5ed53

Please sign in to comment.