Skip to content

Commit 1d1d63a

Browse files
author
Danny
committed
Linux: Cleanup renderer.
- Fixes a softlock I experienced in Pop!_OS. - Slight performance increase.
1 parent e0d4fa3 commit 1d1d63a

File tree

1 file changed

+4
-24
lines changed

1 file changed

+4
-24
lines changed

platform/linux/Rtt_LinuxContext.cpp

Lines changed: 4 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -459,9 +459,8 @@ namespace Rtt
459459

460460
void SolarAppContext::Flush()
461461
{
462-
fCanvas->Refresh(false);
463-
fCanvas->Update();
464462
fRuntime->GetDisplay().Invalidate();
463+
fCanvas->Refresh(false);
465464
}
466465

467466
void SolarAppContext::Pause()
@@ -853,8 +852,7 @@ void SolarFrame::ResetSize()
853852
}
854853

855854
ChangeSize(fContext->GetRuntimeDelegate()->fContentWidth, fContext->GetRuntimeDelegate()->fContentHeight);
856-
Refresh(false);
857-
Update();
855+
GetCanvas()->Refresh(false);
858856
}
859857

860858
void SolarFrame::CreateMenus()
@@ -1345,8 +1343,7 @@ void SolarFrame::OnZoomIn(wxCommandEvent &event)
13451343
frame->GetContext()->GetRuntimeDelegate()->fContentHeight = proposedHeight;
13461344
frame->ChangeSize(proposedWidth, proposedHeight);
13471345
frame->GetContext()->RestartRenderer();
1348-
frame->Refresh(false);
1349-
frame->Update();
1346+
GetCanvas()->Refresh(false);
13501347

13511348
LinuxSimulatorView::Config::zoomedWidth = proposedWidth;
13521349
LinuxSimulatorView::Config::zoomedHeight = proposedHeight;
@@ -1374,8 +1371,7 @@ void SolarFrame::OnZoomOut(wxCommandEvent &event)
13741371
frame->GetContext()->GetRuntimeDelegate()->fContentHeight = proposedHeight;
13751372
frame->ChangeSize(proposedWidth, proposedHeight);
13761373
frame->GetContext()->RestartRenderer();
1377-
frame->Refresh(false);
1378-
frame->Update();
1374+
GetCanvas()->Refresh(false);
13791375

13801376
LinuxSimulatorView::Config::zoomedWidth = proposedWidth;
13811377
LinuxSimulatorView::Config::zoomedHeight = proposedHeight;
@@ -1570,18 +1566,9 @@ void SolarGLCanvas::OnWindowCreate(wxWindowCreateEvent &event)
15701566
{
15711567
// SetCurrent() must have an active window created before being called, making this hte perfect place to do it.
15721568
Rtt_ASSERT(fGLContext);
1573-
15741569
// the current context must be set before we get OGL pointers
15751570
SetCurrent(*fGLContext);
1576-
1577-
if (fContext && fContext->GetRuntime())
1578-
{
1579-
fContext->GetRuntime()->GetDisplay().Invalidate();
1580-
}
1581-
1582-
// generate paint event
15831571
Refresh(false);
1584-
Update();
15851572
}
15861573

15871574
void SolarGLCanvas::OnSize(wxSizeEvent &event)
@@ -1596,12 +1583,5 @@ void SolarGLCanvas::OnSize(wxSizeEvent &event)
15961583

15971584
fWindowHeight = event.GetSize().y;
15981585

1599-
if (fContext && fContext->GetRuntime())
1600-
{
1601-
fContext->GetRuntime()->GetDisplay().Invalidate();
1602-
}
1603-
1604-
// generate a paint event
16051586
Refresh(false);
1606-
Update();
16071587
}

0 commit comments

Comments
 (0)